summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-29 18:00:54 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-29 18:00:54 +0000
commitc821f739b5a82da232e14c7e577edade68f763fd (patch)
tree1b45fb947e1d7e339cbbcb9f61777bff157a7990 /clang/lib/Sema
parent82f80d49670aaf7ac774b29300a627670a488097 (diff)
downloadbcm5719-llvm-c821f739b5a82da232e14c7e577edade68f763fd.tar.gz
bcm5719-llvm-c821f739b5a82da232e14c7e577edade68f763fd.zip
Mark a struct definition in an objc container with the TopLevelDeclInObjCContainer bit.
Fixes accurately getting a cursor inside an objc container containing a struct definition, from a PCH/preamble file. rdar://12584613 llvm-svn: 173811
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 56db548aa6d..33506401cfe 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9761,7 +9761,11 @@ void Sema::ActOnTagFinishDefinition(Scope *S, Decl *TagD,
// Exit this scope of this tag's definition.
PopDeclContext();
-
+
+ if (getCurLexicalContext()->isObjCContainer() &&
+ Tag->getDeclContext()->isFileContext())
+ Tag->setTopLevelDeclInObjCContainer();
+
// Notify the consumer that we've defined a tag.
Consumer.HandleTagDeclDefinition(Tag);
}
OpenPOWER on IntegriCloud