aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-04-27 17:59:27 +0000
committerDevang Patel <dpatel@apple.com>2011-04-27 17:59:27 +0000
commit7878f37cf0dc76689c550727d236ee942b66343f (patch)
treecbbc14fa132d9bbee55830006b8f5655fe10d638 /lib/Transforms
parent93e110ba344ddc901dfb2af61d9c21002d8d3080 (diff)
Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SimplifyCFGPass.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 0bcec6b987..1137c2b23f 100644
--- a/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -73,7 +73,8 @@ static void ChangeToUnreachable(Instruction *I, bool UseLLVMTrap) {
if (UseLLVMTrap) {
Function *TrapFn =
Intrinsic::getDeclaration(BB->getParent()->getParent(), Intrinsic::trap);
- CallInst::Create(TrapFn, "", I);
+ CallInst *CallTrap = CallInst::Create(TrapFn, "", I);
+ CallTrap->setDebugLoc(I->getDebugLoc());
}
new UnreachableInst(I->getContext(), I);