[llvm] r234852 - DebugInfo: Update signature of DICompileUnit::replace*()

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Apr 13 20:51:37 PDT 2015


Author: dexonsmith
Date: Mon Apr 13 22:51:36 2015
New Revision: 234852

URL: http://llvm.org/viewvc/llvm-project?rev=234852&view=rev
Log:
DebugInfo: Update signature of DICompileUnit::replace*()

Change `DICompileUnit::replaceSubprograms()` and
`DICompileUnit::replaceGlobalVariables()` to match the `MDCompileUnit`
equivalents that they're wrapping.

Modified:
    llvm/trunk/include/llvm/IR/DebugInfo.h
    llvm/trunk/lib/IR/DebugInfo.cpp
    llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
    llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp

Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234852&r1=234851&r2=234852&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Mon Apr 13 22:51:36 2015
@@ -416,8 +416,12 @@ public:
   DIArray getGlobalVariables() const { return get()->getGlobalVariables(); }
   DIArray getImportedEntities() const { return get()->getImportedEntities(); }
 
-  void replaceSubprograms(DIArray Subprograms);
-  void replaceGlobalVariables(DIArray GlobalVariables);
+  void replaceSubprograms(MDSubprogramArray Subprograms) const {
+    get()->replaceSubprograms(Subprograms);
+  }
+  void replaceGlobalVariables(MDGlobalVariableArray GlobalVariables) const {
+    get()->replaceGlobalVariables(GlobalVariables);
+  }
 
   StringRef getSplitDebugFilename() const {
     return get()->getSplitDebugFilename();

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=234852&r1=234851&r2=234852&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Mon Apr 13 22:51:36 2015
@@ -33,20 +33,8 @@
 using namespace llvm;
 using namespace llvm::dwarf;
 
-//===----------------------------------------------------------------------===//
-// Simple Descriptor Constructors and other Methods
-//===----------------------------------------------------------------------===//
-
 DIScopeRef DIScope::getRef() const { return MDScopeRef::get(get()); }
 
-void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
-  get()->replaceSubprograms(MDSubprogramArray(Subprograms));
-}
-
-void DICompileUnit::replaceGlobalVariables(DIArray GlobalVariables) {
-  get()->replaceGlobalVariables(MDGlobalVariableArray(GlobalVariables));
-}
-
 DIVariable llvm::createInlinedVariable(MDNode *DV, MDNode *InlinedScope,
                                        LLVMContext &VMContext) {
   return cast<MDLocalVariable>(DV)

Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=234852&r1=234851&r2=234852&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Mon Apr 13 22:51:36 2015
@@ -345,7 +345,7 @@ bool StripDeadDebugInfo::runOnModule(Mod
     // subprogram list/global variable list with our new live subprogram/global
     // variable list.
     if (SubprogramChange) {
-      DIC.replaceSubprograms(DIArray(MDNode::get(C, LiveSubprograms)));
+      DIC.replaceSubprograms(MDTuple::get(C, LiveSubprograms));
       Changed = true;
     }
 

Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=234852&r1=234851&r2=234852&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Mon Apr 13 22:51:36 2015
@@ -171,7 +171,7 @@ static void AddOperand(DICompileUnit CU,
   for (auto *SP : SPs)
     NewSPs.push_back(SP);
   NewSPs.push_back(NewSP);
-  CU.replaceSubprograms(DIArray(MDNode::get(CU->getContext(), NewSPs)));
+  CU.replaceSubprograms(MDTuple::get(CU->getContext(), NewSPs));
 }
 
 // Clone the module-level debug info associated with OldFunc. The cloned data





More information about the llvm-commits mailing list