summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJulien Lerouge <jlerouge@apple.com>2011-09-09 22:41:49 +0000
committerJulien Lerouge <jlerouge@apple.com>2011-09-09 22:41:49 +0000
commit5a6b6987dcb4592427f4f3fcee9b7ce5dd3ba4fe (patch)
tree3fbd1b68c6991059043061b4e5ea6a2206f7f14e /clang/lib/Sema/SemaDecl.cpp
parent5bfb0e0a852533bc6b9248285503c05127d2395e (diff)
downloadbcm5719-llvm-5a6b6987dcb4592427f4f3fcee9b7ce5dd3ba4fe.tar.gz
bcm5719-llvm-5a6b6987dcb4592427f4f3fcee9b7ce5dd3ba4fe.zip
Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
annotate global, local variables, struct fields, or arbitrary statements (using the __builtin_annotation), rdar://8037476. llvm-svn: 139423
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 355378eded7..d6137e5dba3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1461,8 +1461,14 @@ void Sema::MergeTypedefNameDecl(TypedefNameDecl *New, LookupResult &OldDecls) {
static bool
DeclHasAttr(const Decl *D, const Attr *A) {
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)
if ((*i)->getKind() == A->getKind()) {
+ if (Ann) {
+ if (Ann->getAnnotation() == cast<AnnotateAttr>(*i)->getAnnotation())
+ return true;
+ continue;
+ }
// FIXME: Don't hardcode this check
if (OA && isa<OwnershipAttr>(*i))
return OA->getOwnKind() == cast<OwnershipAttr>(*i)->getOwnKind();
OpenPOWER on IntegriCloud