summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CodeExtractor.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/Transforms/Utils/CodeExtractor.cpp
parent900ea21ffb38ba5b783b20f394c43c6c89d58086 (diff)
[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/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CodeExtractor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index f58448dd9562..a090c5ed7492 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -1124,7 +1124,8 @@ static void insertLifetimeMarkersSurroundingCall(
TheCall->getFunction()) &&
"Input memory not defined in original function");
- Function *Func = Intrinsic::getDeclaration(M, MarkerFunc, Mem->getType());
+ Function *Func =
+ Intrinsic::getOrInsertDeclaration(M, MarkerFunc, Mem->getType());
auto Marker = CallInst::Create(Func, {NegativeOne, Mem});
if (InsertBefore)
Marker->insertBefore(TheCall);