[llvm-commits] [llvm] r132377 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfCompileUnit.cpp DwarfCompileUnit.h

Devang Patel dpatel at apple.com
Tue May 31 17:23:24 PDT 2011


Author: dpatel
Date: Tue May 31 19:23:24 2011
New Revision: 132377

URL: http://llvm.org/viewvc/llvm-project?rev=132377&view=rev
Log:
Incomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=132377&r1=132376&r2=132377&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue May 31 19:23:24 2011
@@ -609,16 +609,17 @@
 
   // If this is a complete composite type then include it in the
   // list of global types.
-  addGlobalType(Ty, Entry->getEntry());
+  addGlobalType(Ty);
 }
 
 /// addGlobalType - Add a new global type to the compile unit.
 ///
-void CompileUnit::addGlobalType(DIType Ty, DIE *Die) {
+void CompileUnit::addGlobalType(DIType Ty) {
   DIDescriptor Context = Ty.getContext();
   if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl() 
       && (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
-    GlobalTypes[Ty.getName()] = Die;
+    if (DIEEntry *Entry = getDIEEntry(Ty))
+      GlobalTypes[Ty.getName()] = Entry->getEntry();
 }
 
 /// addPubTypes - Add type for pubtypes section.
@@ -633,7 +634,7 @@
     DIType ATy(Args.getElement(i));
     if (!ATy.Verify())
       continue;
-    addGlobalType(ATy, getDIEEntry(ATy)->getEntry());
+    addGlobalType(ATy);
   }
 }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=132377&r1=132376&r2=132377&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Tue May 31 19:23:24 2011
@@ -87,7 +87,7 @@
 
   /// addGlobalType - Add a new global type to the compile unit.
   ///
-  void addGlobalType(DIType Ty, DIE *Die);
+  void addGlobalType(DIType Ty);
 
   /// getDIE - Returns the debug information entry map slot for the
   /// specified debug variable.





More information about the llvm-commits mailing list