mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-08 21:47:23 +00:00
Should invokify is always true
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
36143fc444
commit
e4d9096409
@ -185,10 +185,6 @@ bool InlineFunction(CallSite CS) {
|
|||||||
// We only need to check for function calls: inlined invoke instructions
|
// We only need to check for function calls: inlined invoke instructions
|
||||||
// require no special handling...
|
// require no special handling...
|
||||||
if (CallInst *CI = dyn_cast<CallInst>(I)) {
|
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 (Function *F = CI->getCalledFunction())
|
||||||
if (unsigned ID = F->getIntrinsicID())
|
if (unsigned ID = F->getIntrinsicID())
|
||||||
if (ID == LLVMIntrinsic::unwind) {
|
if (ID == LLVMIntrinsic::unwind) {
|
||||||
@ -213,27 +209,23 @@ bool InlineFunction(CallSite CS) {
|
|||||||
break; // Done with this basic block!
|
break; // Done with this basic block!
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we should convert this function into an invoke instruction, do
|
// Convert this function call into an invoke instruction...
|
||||||
// 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());
|
|
||||||
|
|
||||||
// Delete the unconditional branch inserted by splitBasicBlock
|
// First, split the basic block...
|
||||||
BB->getInstList().pop_back();
|
BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc");
|
||||||
Split->getInstList().pop_front(); // Delete the original call
|
|
||||||
|
// Next, create the new invoke instruction, inserting it at the end
|
||||||
// This basic block is now complete, start scanning the next one.
|
// of the old basic block.
|
||||||
break;
|
new InvokeInst(CI->getCalledValue(), Split, InvokeDest,
|
||||||
} else {
|
std::vector<Value*>(CI->op_begin()+1, CI->op_end()),
|
||||||
++I;
|
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 {
|
} else {
|
||||||
++I;
|
++I;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user