diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-16 16:34:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-16 16:34:57 +0000 |
commit | 8d2dbbf9ddfd9d762a341d83f83d840ff68ce03d (patch) | |
tree | 2c23d35637f2ea76d7d6cbbfac396fed22a38d43 /lib/AST/DeclObjC.cpp | |
parent | 91ec7894ec186dd36f509682f00486c98d8228ed (diff) |
If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 317dc95f54..02cc988d82 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -225,7 +225,11 @@ void ObjCInterfaceDecl::mergeClassExtensionProtocolList( void ObjCInterfaceDecl::allocateDefinitionData() { assert(!hasDefinition() && "ObjC class already has a definition"); Data = new (getASTContext()) DefinitionData(); - Data->Definition = this; + Data->Definition = this; + + // Make the type point at the definition, now that we have one. + if (TypeForDecl) + cast<ObjCInterfaceType>(TypeForDecl)->Decl = this; } void ObjCInterfaceDecl::startDefinition() { |