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

Devang Patel dpatel at apple.com
Tue May 31 16:30:30 PDT 2011


Author: dpatel
Date: Tue May 31 18:30:30 2011
New Revision: 132373

URL: http://llvm.org/viewvc/llvm-project?rev=132373&view=rev
Log:
Refactor.

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=132373&r1=132372&r2=132373&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue May 31 18:30:30 2011
@@ -609,10 +609,16 @@
 
   // If this is a complete composite type then include it in the
   // list of global types.
+  addGlobalType(Ty, Entry->getEntry());
+}
+
+/// addGlobalType - Add a new global type to the compile unit.
+///
+void CompileUnit::addGlobalType(DIType Ty, DIE *Die) {
   DIDescriptor Context = Ty.getContext();
   if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl() 
       && (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
-    addGlobalType(Ty.getName(), Entry->getEntry());
+    GlobalTypes[Ty.getName()] = Die;
 }
 
 /// addPubTypes - Add type for pubtypes section.
@@ -627,12 +633,7 @@
     DIType ATy(Args.getElement(i));
     if (!ATy.Verify())
       continue;
-    DICompositeType CATy = getDICompositeType(ATy);
-    if (DIDescriptor(CATy).Verify() && !CATy.getName().empty()
-        && !CATy.isForwardDecl()) {
-      if (DIEEntry *Entry = getDIEEntry(CATy))
-        addGlobalType(CATy.getName(), Entry->getEntry());
-    }
+    addGlobalType(ATy, getDIEEntry(ATy)->getEntry());
   }
 }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=132373&r1=132372&r2=132373&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Tue May 31 18:30:30 2011
@@ -87,9 +87,7 @@
 
   /// addGlobalType - Add a new global type to the compile unit.
   ///
-  void addGlobalType(StringRef Name, DIE *Die) {
-    GlobalTypes[Name] = Die;
-  }
+  void addGlobalType(DIType Ty, DIE *Die);
 
   /// getDIE - Returns the debug information entry map slot for the
   /// specified debug variable.





More information about the llvm-commits mailing list