diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-31 17:37:55 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-08-31 17:37:55 +0000 |
commit | 140ab234c23f392d5422691c5de1ee3c15026def (patch) | |
tree | d1bef810b42aec8127d449219e44c70026dbfcf6 /include | |
parent | 20174221af145554b76a0b0f5e4eb3ac70d05945 (diff) |
objective-c - This patch buffers method implementations
and does the Sema on their body after the entire
class/category @implementation is seen. This change allows messaging
of forward private methods, as well as, access to
synthesized ivars of properties with foward synthesize
declarations; among others. In effect, this patch removes
several restrictions placed on objective-c due to in-place
semantics processing of methods.
This is part of // rdar://8843851.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Parse/Parser.h | 5 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 0925a109fd..35da9c4de1 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1022,6 +1022,7 @@ private: void ParseLexedMethodDef(LexedMethod &LM); void ParseLexedMemberInitializers(ParsingClass &Class); void ParseLexedMemberInitializer(LateParsedMemberInitializer &MI); + Decl *ParseLexedObjCMethodDefs(LexedMethod &LM); bool ConsumeAndStoreUntil(tok::TokenKind T1, CachedTokens &Toks, bool StopAtSemi = true, @@ -1080,9 +1081,11 @@ private: Decl *ObjCImpDecl; SmallVector<Decl *, 4> PendingObjCImpDecl; + typedef SmallVector<LexedMethod*, 2> LateParsedObjCMethodContainer; + LateParsedObjCMethodContainer LateParsedObjCMethods; Decl *ParseObjCAtImplementationDeclaration(SourceLocation atLoc); - Decl *ParseObjCAtEndDeclaration(SourceRange atEnd); + DeclGroupPtrTy ParseObjCAtEndDeclaration(SourceRange atEnd); Decl *ParseObjCAtAliasDeclaration(SourceLocation atLoc); Decl *ParseObjCPropertySynthesize(SourceLocation atLoc); Decl *ParseObjCPropertyDynamic(SourceLocation atLoc); diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index df64349b22..16411a0fe6 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -1958,6 +1958,10 @@ public: AddMethodToGlobalPool(Method, impl, /*instance*/false); } + /// AddAnyMethodToGlobalPool - Add any method, instance or factory to global + /// pool. + void AddAnyMethodToGlobalPool(Decl *D); + /// LookupInstanceMethodInGlobalPool - Returns the method and warns if /// there are multiple signatures. ObjCMethodDecl *LookupInstanceMethodInGlobalPool(Selector Sel, SourceRange R, |