]> granicus.if.org Git - clang/commitdiff
Fix even more bugs in debug info support:
authorChris Lattner <sabre@nondot.org>
Mon, 10 Nov 2008 06:10:01 +0000 (06:10 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 10 Nov 2008 06:10:01 +0000 (06:10 +0000)
1. emit proper debug info for forward decls of structs.
2. emit DW_TAG_member nodes around members of a field like llvm-gcc does.

This slows down debug info generation, but is required for correctness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58973 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 4b3ef0ebd08eb82a32265804812b5702538eb552..42139353ebe60c5e7cb2610fbfc97eef880031de 100644 (file)
@@ -192,9 +192,6 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
                                      llvm::DICompileUnit Unit) {
   const RecordDecl *Decl = Ty->getDecl();
   
-  if (!Decl->getDefinition(M->getContext()))
-    return llvm::DIType();
-  
   unsigned Tag;
   if (Decl->isStruct())
     Tag = llvm::dwarf::DW_TAG_structure_type;
@@ -244,7 +241,6 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
     FieldDecl *Field = *I;
     llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit);
     
-#if 0
     const char *FieldName = Field->getName();
     if (FieldName == 0) FieldName = "";
 
@@ -265,7 +261,6 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
                                              FieldName, FieldDefUnit,
                                              FieldLine, FieldSize, FieldAlign,
                                              FieldOffset, 0, FieldTy);
-#endif
     EltTys.push_back(FieldTy);
   }