From 35adce33f1f45caf7f77dc2cc75ff893e9826a43 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 14 Apr 2015 03:51:36 +0000 Subject: [PATCH] DebugInfo: Update signature of DICompileUnit::replace*() Change `DICompileUnit::replaceSubprograms()` and `DICompileUnit::replaceGlobalVariables()` to match the `MDCompileUnit` equivalents that they're wrapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234852 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfo.h | 8 ++++++-- lib/IR/DebugInfo.cpp | 12 ------------ lib/Transforms/IPO/StripSymbols.cpp | 2 +- lib/Transforms/Utils/CloneFunction.cpp | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index 8abc514a8aa..56033dfead0 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/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/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 3ffd13064d4..d289f8079bd 100644 --- a/lib/IR/DebugInfo.cpp +++ b/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(DV) diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp index 817f49fecd3..39d8e7619de 100644 --- a/lib/Transforms/IPO/StripSymbols.cpp +++ b/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/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index 5cc8c6df686..f5ca7ac9efd 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/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 -- 2.34.1