DwarfCompileUnit: Push type safety of DIDescriptor through CompileUnit::createAndAddDIE.
authorDavid Blaikie <dblaikie@gmail.com>
Sat, 16 Nov 2013 00:29:01 +0000 (00:29 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sat, 16 Nov 2013 00:29:01 +0000 (00:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194902 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h

index d5eb8f397d9ed659f41a8caf05d41e1ce96ce687..cb0e89977c1965a3fc3ce2bb0fac85a73de2edbb 100644 (file)
@@ -296,11 +296,11 @@ void CompileUnit::addDIEEntry(DIE *Die, dwarf::Attribute Attribute,
 
 /// Create a DIE with the given Tag, add the DIE to its parent, and
 /// call insertDIE if MD is not null.
-DIE *CompileUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const MDNode *MD) {
+DIE *CompileUnit::createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N) {
   DIE *Die = new DIE(Tag);
   Parent.addChild(Die);
-  if (MD)
-    insertDIE(DIDescriptor(MD), Die);
+  if (N)
+    insertDIE(N, Die);
   return Die;
 }
 
@@ -1541,7 +1541,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
     DIE *ContextDIE = getOrCreateContextDIE(GVContext);
 
     // Add to map.
-    VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, N);
+    VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, GV);
 
     // Add name and type.
     addString(VariableDIE, dwarf::DW_AT_name, GV.getDisplayName());
index 059f2be2104c62c79569c06bae1fc33ad186501c..884e51a7ef8a7cb63a826706354dad0d40d1daea 100644 (file)
@@ -321,7 +321,7 @@ public:
 
   /// Create a DIE with the given Tag, add the DIE to its parent, and
   /// call insertDIE if MD is not null.
-  DIE *createAndAddDIE(unsigned Tag, DIE &Parent, const MDNode *MD = NULL);
+  DIE *createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N = DIDescriptor());
 
   /// Compute the size of a header for this unit, not including the initial
   /// length field.