aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorRahul Joshi <rjoshi@nvidia.com>2024-10-11 05:26:03 -0700
committerGitHub <noreply@github.com>2024-10-11 05:26:03 -0700
commitfa789dffb1e12c2aece0187aeacc48dfb1768340 (patch)
treecebfdc0d8b0111115cbefeb8d2927fe8c2cfbdfb /llvm/lib/IR/Module.cpp
parent900ea21ffb38ba5b783b20f394c43c6c89d58086 (diff)
downloadllvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.zip
llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.tar.gz
llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.tar.bz2
[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)
Rename the function to reflect its correct behavior and to be consistent with `Module::getOrInsertFunction`. This is also in preparation of adding a new `Intrinsic::getDeclaration` that will have behavior similar to `Module::getFunction` (i.e, just lookup, no creation).
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();