summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-08 19:00:30 +0000
committerChris Lattner <sabre@nondot.org>2003-09-08 19:00:30 +0000
commite4d90964096c240c9e29ae414792ed1246db4ee8 (patch)
treefb1b1746b82e0e464c0054e491f75887e4dade0e /lib/Transforms/Utils/InlineFunction.cpp
parent36143fc4440ac1fc2a0fc95a4999bcadc3ec207d (diff)
downloadllvm-e4d90964096c240c9e29ae414792ed1246db4ee8.tar.gz
llvm-e4d90964096c240c9e29ae414792ed1246db4ee8.tar.bz2
llvm-e4d90964096c240c9e29ae414792ed1246db4ee8.tar.xz
Should invokify is always true
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp40
1 files changed, 16 insertions, 24 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index adf4196c1a..864b6ba3db 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/lib/Transforms/Utils/InlineFunction.cpp
@@ -185,10 +185,6 @@ bool InlineFunction(CallSite CS) {
// We only need to check for function calls: inlined invoke instructions
// require no special handling...
if (CallInst *CI = dyn_cast<CallInst>(I)) {
- // FIXME: this should use annotations of the LLVM functions themselves
- // to determine whether or not the function can throw.
- bool ShouldInvokify = true;
-
if (Function *F = CI->getCalledFunction())
if (unsigned ID = F->getIntrinsicID())
if (ID == LLVMIntrinsic::unwind) {
@@ -213,27 +209,23 @@ bool InlineFunction(CallSite CS) {
break; // Done with this basic block!
}
- // If we should convert this function into an invoke instruction, do
- // so now.
- if (ShouldInvokify) {
- // First, split the basic block...
- BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc");
-
- // Next, create the new invoke instruction, inserting it at the end
- // of the old basic block.
- new InvokeInst(CI->getCalledValue(), Split, InvokeDest,
- std::vector<Value*>(CI->op_begin()+1, CI->op_end()),
- CI->getName(), BB->getTerminator());
+ // Convert this function call into an invoke instruction...
- // Delete the unconditional branch inserted by splitBasicBlock
- BB->getInstList().pop_back();
- Split->getInstList().pop_front(); // Delete the original call
-
- // This basic block is now complete, start scanning the next one.
- break;
- } else {
- ++I;
- }
+ // First, split the basic block...
+ BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc");
+
+ // Next, create the new invoke instruction, inserting it at the end
+ // of the old basic block.
+ new InvokeInst(CI->getCalledValue(), Split, InvokeDest,
+ std::vector<Value*>(CI->op_begin()+1, CI->op_end()),
+ CI->getName(), BB->getTerminator());
+
+ // Delete the unconditional branch inserted by splitBasicBlock
+ BB->getInstList().pop_back();
+ Split->getInstList().pop_front(); // Delete the original call
+
+ // This basic block is now complete, start scanning the next one.
+ break;
} else {
++I;
}