diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-01 19:29:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-01 19:29:29 +0000 |
commit | e6e48b1490fe79ca8d44718e48f8644a28efa097 (patch) | |
tree | 5a6249e5bdcfbd786cbf68de755aca1c133a7e92 /clang/lib/AST/DeclObjC.cpp | |
parent | 01fb1135d66125f02111f04273684d25d73d2645 (diff) | |
download | bcm5719-llvm-e6e48b1490fe79ca8d44718e48f8644a28efa097.tar.gz bcm5719-llvm-e6e48b1490fe79ca8d44718e48f8644a28efa097.zip |
Move the data that corresponds to the definition of a protocol into a
separately-allocated DefinitionData structure. Introduce various
functions that will help with the separation of declarations from
definitions (isThisDeclarationADefinition(), hasDefinition(),
getDefinition()).
llvm-svn: 147408
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 75100ecb3cb..f5828fcb4ce 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -1003,9 +1003,19 @@ ObjCMethodDecl *ObjCProtocolDecl::lookupMethod(Selector Sel, return NULL; } +void ObjCProtocolDecl::allocateDefinitionData() { + assert(!Data && "Protocol already has a definition!"); + Data = new (getASTContext()) DefinitionData; +} + +void ObjCProtocolDecl::startDefinition() { + allocateDefinitionData(); +} + void ObjCProtocolDecl::completedForwardDecl() { - assert(isForwardDecl() && "Only valid to call for forward refs"); + assert(!hasDefinition() && "Only valid to call for forward refs"); isForwardProtoDecl = false; + startDefinition(); if (ASTMutationListener *L = getASTContext().getASTMutationListener()) L->CompletedObjCForwardRef(this); } |