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 | 26fec63b14565e9e2d8c9935b276b99be950444a (patch) | |
tree | eff4e475e1f43d86fbb64d5f2be2632a98e45226 /lib/AST/DeclObjC.cpp | |
parent | 36370f58d8a8cc49985bf0a37d912d37eb405211 (diff) |
Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 1da0fab0ba..e088c66229 100644 --- a/lib/AST/DeclObjC.cpp +++ b/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); } |