diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-27 20:50:59 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-27 20:50:59 +0000 |
commit | 3a039e339f1fc8a134b1d55cd6c4c6d387a81967 (patch) | |
tree | abcdea7eb4975061cca240f4a8b44364018babc7 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | e83797c3aa94201e89873a5108ebeb6c31d118e5 (diff) | |
download | bcm5719-llvm-3a039e339f1fc8a134b1d55cd6c4c6d387a81967.tar.gz bcm5719-llvm-3a039e339f1fc8a134b1d55cd6c4c6d387a81967.zip |
objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.
llvm-svn: 138709
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index ef54fbcad88..5e19148c38d 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -5405,12 +5405,11 @@ static void AddInterfaceResults(DeclContext *Ctx, DeclContext *CurContext, // Record any forward-declared interfaces we find. if (ObjCClassDecl *Forward = dyn_cast<ObjCClassDecl>(*D)) { - for (ObjCClassDecl::iterator C = Forward->begin(), CEnd = Forward->end(); - C != CEnd; ++C) - if ((!OnlyForwardDeclarations || C->getInterface()->isForwardDecl()) && - (!OnlyUnimplemented || !C->getInterface()->getImplementation())) - Results.AddResult(Result(C->getInterface(), 0), CurContext, - 0, false); + ObjCInterfaceDecl *IDecl = Forward->getForwardInterfaceDecl(); + if ((!OnlyForwardDeclarations || IDecl->isForwardDecl()) && + (!OnlyUnimplemented || !IDecl->getImplementation())) + Results.AddResult(Result(IDecl, 0), CurContext, + 0, false); } } } |