summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/IR/DebugInfo.h8
-rw-r--r--llvm/lib/IR/DebugInfo.cpp12
-rw-r--r--llvm/lib/Transforms/IPO/StripSymbols.cpp2
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp2
4 files changed, 8 insertions, 16 deletions
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h
index 8abc514a8aa..56033dfead0 100644
--- a/llvm/include/llvm/IR/DebugInfo.h
+++ b/llvm/include/llvm/IR/DebugInfo.h
@@ -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();
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 3ffd13064d4..d289f8079bd 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -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)
diff --git a/llvm/lib/Transforms/IPO/StripSymbols.cpp b/llvm/lib/Transforms/IPO/StripSymbols.cpp
index 817f49fecd3..39d8e7619de 100644
--- a/llvm/lib/Transforms/IPO/StripSymbols.cpp
+++ b/llvm/lib/Transforms/IPO/StripSymbols.cpp
@@ -345,7 +345,7 @@ bool StripDeadDebugInfo::runOnModule(Module &M) {
// 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;
}
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 5cc8c6df686..f5ca7ac9efd 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -171,7 +171,7 @@ static void AddOperand(DICompileUnit CU, MDSubprogramArray SPs, Metadata *NewSP)
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
OpenPOWER on IntegriCloud