diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-15 18:17:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-15 18:17:27 +0000 |
commit | a323c4c3cd82b66fd89ec5032075a43e693ef3fe (patch) | |
tree | b1ed8111d19042f8d245d2dd9d52ef4ea20686ae /clang/lib/AST/DeclObjC.cpp | |
parent | 40b88d675685a416c69b887e28a00ccfb7436eb0 (diff) | |
download | bcm5719-llvm-a323c4c3cd82b66fd89ec5032075a43e693ef3fe.tar.gz bcm5719-llvm-a323c4c3cd82b66fd89ec5032075a43e693ef3fe.zip |
Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.
llvm-svn: 146669
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 1da0fab0ba4..e088c66229b 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -224,14 +224,14 @@ void ObjCInterfaceDecl::mergeClassExtensionProtocolList( void ObjCInterfaceDecl::allocateDefinitionData() { assert(!hasDefinition() && "ObjC class already has a definition"); - Definition.setPointer(new (getASTContext()) DefinitionData()); - Definition.setInt(true); + Data = new (getASTContext()) DefinitionData(); + Data->Definition = this; // Update all of the declarations with a pointer to the definition. for (redecl_iterator RD = redecls_begin(), RDEnd = redecls_end(); RD != RDEnd; ++RD) { if (*RD != this) - RD->Definition.setPointer(Definition.getPointer()); + RD->Data = Data; } } @@ -684,7 +684,7 @@ ObjCInterfaceDecl:: ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, SourceLocation CLoc, bool FD, bool isInternal) : ObjCContainerDecl(ObjCInterface, DC, Id, CLoc, atLoc), - TypeForDecl(0), Definition(), InitiallyForwardDecl(FD) + TypeForDecl(0), Data(), InitiallyForwardDecl(FD) { setImplicit(isInternal); } |