summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CodeExtractor.cpp
diff options
context:
space:
mode:
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);