Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(226)

Unified Diff: lib/Sema/SemaDeclAttr.cpp

Issue 5520050: Properly handle thread safety attributs on functions with separate definitions.
Patch Set: Created 13 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Parse/ParseDecl.cpp ('k') | test/SemaCXX/warn-thread-safety-analysis.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Sema/SemaDeclAttr.cpp
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 22a2cfe8a6eb0763b6caa6837a53aa0516f41750..e691cb39ebecf222774e23f106770e9fa22f4b54 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -514,11 +514,11 @@ static void handleLockFunAttr(Sema &S, Decl *D, const AttributeList &Attr,
if (exclusive)
D->addAttr(::new (S.Context) ExclusiveLockFunctionAttr(Attr.getRange(),
S.Context, StartArg,
- Size));
+ Size, D));
else
D->addAttr(::new (S.Context) SharedLockFunctionAttr(Attr.getRange(),
S.Context, StartArg,
- Size));
+ Size, D));
}
static void handleTrylockFunAttr(Sema &S, Decl *D, const AttributeList &Attr,
@@ -553,12 +553,14 @@ static void handleTrylockFunAttr(Sema &S, Decl *D, const AttributeList &Attr,
D->addAttr(::new (S.Context) ExclusiveTrylockFunctionAttr(Attr.getRange(),
S.Context,
Attr.getArg(0),
- StartArg, Size));
+ StartArg, Size,
+ D));
else
D->addAttr(::new (S.Context) SharedTrylockFunctionAttr(Attr.getRange(),
S.Context,
Attr.getArg(0),
- StartArg, Size));
+ StartArg, Size,
+ D));
}
static void handleLocksRequiredAttr(Sema &S, Decl *D, const AttributeList &Attr,
@@ -586,11 +588,11 @@ static void handleLocksRequiredAttr(Sema &S, Decl *D, const AttributeList &Attr,
if (exclusive)
D->addAttr(::new (S.Context) ExclusiveLocksRequiredAttr(Attr.getRange(),
S.Context, StartArg,
- Size));
+ Size, D));
else
D->addAttr(::new (S.Context) SharedLocksRequiredAttr(Attr.getRange(),
S.Context, StartArg,
- Size));
+ Size, D));
}
static void handleUnlockFunAttr(Sema &S, Decl *D,
@@ -615,7 +617,7 @@ static void handleUnlockFunAttr(Sema &S, Decl *D,
Expr **StartArg = Size == 0 ? 0 : &Args[0];
D->addAttr(::new (S.Context) UnlockFunctionAttr(Attr.getRange(), S.Context,
- StartArg, Size));
+ StartArg, Size, D));
}
static void handleLockReturnedAttr(Sema &S, Decl *D,
@@ -639,7 +641,8 @@ static void handleLockReturnedAttr(Sema &S, Decl *D,
if (!checkForLockableRecord(S, D, Attr, getRecordType(Arg->getType())))
return;
- D->addAttr(::new (S.Context) LockReturnedAttr(Attr.getRange(), S.Context, Arg));
+ D->addAttr(::new (S.Context) LockReturnedAttr(Attr.getRange(), S.Context,
+ Arg, D));
}
static void handleLocksExcludedAttr(Sema &S, Decl *D,
@@ -665,7 +668,7 @@ static void handleLocksExcludedAttr(Sema &S, Decl *D,
Expr **StartArg = Size == 0 ? 0 : &Args[0];
D->addAttr(::new (S.Context) LocksExcludedAttr(Attr.getRange(), S.Context,
- StartArg, Size));
+ StartArg, Size, D));
}
« no previous file with comments | « lib/Parse/ParseDecl.cpp ('k') | test/SemaCXX/warn-thread-safety-analysis.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b