[llvm] r194979 - DwarfCompileUnit: Add type safety to createGlobalVariableDIE

David Blaikie dblaikie at gmail.com
Sun Nov 17 13:55:13 PST 2013


Author: dblaikie
Date: Sun Nov 17 15:55:13 2013
New Revision: 194979

URL: http://llvm.org/viewvc/llvm-project?rev=194979&view=rev
Log:
DwarfCompileUnit: Add type safety to createGlobalVariableDIE

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=194979&r1=194978&r2=194979&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Sun Nov 17 15:55:13 2013
@@ -1508,8 +1508,7 @@ static const ConstantExpr *getMergedGlob
 }
 
 /// createGlobalVariableDIE - create global variable DIE.
-void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
-  DIGlobalVariable GV(N);
+void CompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
 
   // Check for pre-existence.
   if (getDIE(GV))
@@ -1617,7 +1616,7 @@ void CompileUnit::createGlobalVariableDI
     // it is not a static member.
     if (!IsStaticMember)
       addConstantValue(VariableDIE, CI, isUnsignedDIType(DD, GTy));
-  } else if (const ConstantExpr *CE = getMergedGlobalExpr(N->getOperand(11))) {
+  } else if (const ConstantExpr *CE = getMergedGlobalExpr(GV->getOperand(11))) {
     addToAccelTable = true;
     // GV is a merged global.
     DIEBlock *Block = new (DIEValueAllocator) DIEBlock();

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=194979&r1=194978&r2=194979&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Sun Nov 17 15:55:13 2013
@@ -310,7 +310,7 @@ public:
   DIE *getOrCreateContextDIE(DIScope Context);
 
   /// createGlobalVariableDIE - create global variable DIE.
-  void createGlobalVariableDIE(const MDNode *N);
+  void createGlobalVariableDIE(DIGlobalVariable GV);
 
   /// constructContainingTypeDIEs - Construct DIEs for types that contain
   /// vtables.

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=194979&r1=194978&r2=194979&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sun Nov 17 15:55:13 2013
@@ -923,7 +923,7 @@ void DwarfDebug::beginModule() {
               ScopesWithImportedEntities.end(), less_first());
     DIArray GVs = CUNode.getGlobalVariables();
     for (unsigned i = 0, e = GVs.getNumElements(); i != e; ++i)
-      CU->createGlobalVariableDIE(GVs.getElement(i));
+      CU->createGlobalVariableDIE(DIGlobalVariable(GVs.getElement(i)));
     DIArray SPs = CUNode.getSubprograms();
     for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
       constructSubprogramDIE(CU, SPs.getElement(i));





More information about the llvm-commits mailing list