aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r--llvm/lib/IR/Module.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp
index 704bc8d..ab48d3e 100644
--- a/llvm/lib/IR/Module.cpp
+++ b/llvm/lib/IR/Module.cpp
@@ -89,21 +89,22 @@ Module::~Module() {
void Module::removeDebugIntrinsicDeclarations() {
auto *DeclareIntrinsicFn =
- Intrinsic::getDeclaration(this, Intrinsic::dbg_declare);
+ Intrinsic::getOrInsertDeclaration(this, Intrinsic::dbg_declare);
assert((!isMaterialized() || DeclareIntrinsicFn->hasZeroLiveUses()) &&
"Debug declare intrinsic should have had uses removed.");
DeclareIntrinsicFn->eraseFromParent();
auto *ValueIntrinsicFn =
- Intrinsic::getDeclaration(this, Intrinsic::dbg_value);
+ Intrinsic::getOrInsertDeclaration(this, Intrinsic::dbg_value);
assert((!isMaterialized() || ValueIntrinsicFn->hasZeroLiveUses()) &&
"Debug value intrinsic should have had uses removed.");
ValueIntrinsicFn->eraseFromParent();
auto *AssignIntrinsicFn =
- Intrinsic::getDeclaration(this, Intrinsic::dbg_assign);
+ Intrinsic::getOrInsertDeclaration(this, Intrinsic::dbg_assign);
assert((!isMaterialized() || AssignIntrinsicFn->hasZeroLiveUses()) &&
"Debug assign intrinsic should have had uses removed.");
AssignIntrinsicFn->eraseFromParent();
- auto *LabelntrinsicFn = Intrinsic::getDeclaration(this, Intrinsic::dbg_label);
+ auto *LabelntrinsicFn =
+ Intrinsic::getOrInsertDeclaration(this, Intrinsic::dbg_label);
assert((!isMaterialized() || LabelntrinsicFn->hasZeroLiveUses()) &&
"Debug label intrinsic should have had uses removed.");
LabelntrinsicFn->eraseFromParent();