summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-16 16:34:57 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-16 16:34:57 +0000
commit7671e53b668093edbf3f20fc5e43a341626c743a (patch)
treef3b6eab1aae11c05ca1fe4121dbbc01156ffc56a /clang/lib/AST/DeclObjC.cpp
parent2a05f691ab97e01b65b78df1107f2134a6f5d4ae (diff)
downloadbcm5719-llvm-7671e53b668093edbf3f20fc5e43a341626c743a.tar.gz
bcm5719-llvm-7671e53b668093edbf3f20fc5e43a341626c743a.zip
If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType
llvm-svn: 146740
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 317dc95f540..02cc988d82d 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/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() {
OpenPOWER on IntegriCloud