diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-29 18:00:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-29 18:00:54 +0000 |
commit | 3d207e76a1c7ece5deec3d6ee35af04fe7f6212e (patch) | |
tree | e841f39719b5abfa5c13a8ece6863cf4231d99e3 /lib/Sema/SemaDecl.cpp | |
parent | f1579605adf03f94a2ddddc95c764737ead0efe5 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 56db548aa6..33506401cf 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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); } |