diff options
author | Devang Patel <dpatel@apple.com> | 2011-04-27 17:59:27 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-04-27 17:59:27 +0000 |
commit | 12bf0ab4b53e958a82d731c397a59ed27eb48b5d (patch) | |
tree | 19c052fcc3f7023cb6a36ff4c648405fdbdc8b15 /llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | |
parent | de90f1dd93f2f857629e684e51957fc949599bae (diff) | |
download | bcm5719-llvm-12bf0ab4b53e958a82d731c397a59ed27eb48b5d.tar.gz bcm5719-llvm-12bf0ab4b53e958a82d731c397a59ed27eb48b5d.zip |
Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.
llvm-svn: 130315
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 0bcec6b9871..1137c2b23f9 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/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); |