From c8b0c9d8fde1671128981bb75a8c6bc112800da2 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 15 Dec 2011 23:32:29 +0000 Subject: When generating debug info for an ObjCInterfaceDecl, try to dig out the definition. llvm-svn: 146705 --- clang/lib/CodeGen/CGDebugInfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 2b67c2e5e43..fa057e2e4be 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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) -- cgit v1.2.3