summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
index 55f9400d93d7..cd7960065703 100644
--- a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
+++ b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
@@ -215,8 +215,8 @@ static bool runImpl(Module &M) {
// If `__cxa_atexit` hits out-of-memory, trap, so that we don't misbehave.
// This should be very rare, because if the process is running out of
// memory before main has even started, something is wrong.
- CallInst::Create(Intrinsic::getDeclaration(&M, Intrinsic::trap), "",
- FailBB);
+ CallInst::Create(Intrinsic::getOrInsertDeclaration(&M, Intrinsic::trap),
+ "", FailBB);
new UnreachableInst(C, FailBB);
ReturnInst::Create(C, RetBB);