aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2012-10-12 21:38:12 +0000
committerDeLesley Hutchins <delesley@google.com>2012-10-12 21:38:12 +0000
commit3ce9fae275ec05cd648d6093b95eb1d05bc14a98 (patch)
tree2e910de43c81f6bccc12c482c4f999f1328e1ce4 /lib/Sema
parentfba3fb9a14f2d729639e0fdb834e3eeb40a8a12a (diff)
Thread-safety analysis: support multiple thread-safety attributes on
declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaDecl.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index ee246b81a6..a00f60f681 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1724,6 +1724,23 @@ DeclHasAttr(const Decl *D, const Attr *A) {
if (AA)
return false;
+ // The following thread safety attributes can also be duplicated.
+ switch (A->getKind()) {
+ case attr::ExclusiveLocksRequired:
+ case attr::SharedLocksRequired:
+ case attr::LocksExcluded:
+ case attr::ExclusiveLockFunction:
+ case attr::SharedLockFunction:
+ case attr::UnlockFunction:
+ case attr::ExclusiveTrylockFunction:
+ case attr::SharedTrylockFunction:
+ case attr::GuardedBy:
+ case attr::PtGuardedBy:
+ case attr::AcquiredBefore:
+ case attr::AcquiredAfter:
+ return false;
+ }
+
const OwnershipAttr *OA = dyn_cast<OwnershipAttr>(A);
const AnnotateAttr *Ann = dyn_cast<AnnotateAttr>(A);
for (Decl::attr_iterator i = D->attr_begin(), e = D->attr_end(); i != e; ++i)