]> granicus.if.org Git - clang/commitdiff
When generating debug info for an ObjCInterfaceDecl, try to dig out the definition.
authorDouglas Gregor <dgregor@apple.com>
Thu, 15 Dec 2011 23:32:29 +0000 (23:32 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 15 Dec 2011 23:32:29 +0000 (23:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146705 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 2b67c2e5e4335989fedd13ccbda1fe8ae997c917..fa057e2e4bebebd9d82d6bfbc72ed5dbfd9eeab7 100644 (file)
@@ -1211,7 +1211,8 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
 
   // If this is just a forward declaration return a special forward-declaration
   // debug type since we won't be able to lay out the entire type.
-  if (!ID->isThisDeclarationADefinition()) {
+  ObjCInterfaceDecl *Def = ID->getDefinition();
+  if (!Def) {
     llvm::DIType FwdDecl =
       DBuilder.createStructType(Unit, ID->getName(),
                                 DefUnit, Line, 0, 0,
@@ -1219,6 +1220,7 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
                                 llvm::DIArray(), RuntimeLang);
     return FwdDecl;
   }
+  ID = Def;
 
   // To handle a recursive interface, we first generate a debug descriptor
   // for the struct as a forward declaration. Then (if it is a definition)