Fix compilation of 126.gcc: intrinsic functions cannot throw, so they are not

allowed in invoke instructions.  Thus, if we are inlining a call to an intrinsic
function into an invoke site, we don't need to turn the call into an invoke!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11384 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-02-13 16:47:35 +00:00
parent 0db085baec
commit 494b6920b0

View File

@ -123,8 +123,12 @@ bool llvm::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)) {
// Convert this function call into an invoke instruction... // Convert this function call into an invoke instruction... if it's
// not an intrinsic function call (which are known to not throw).
if (CI->getCalledFunction() &&
CI->getCalledFunction()->getIntrinsicID()) {
++I;
} else {
// First, split the basic block... // First, split the basic block...
BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc"); BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc");
@ -151,6 +155,7 @@ bool llvm::InlineFunction(CallSite CS) {
// This basic block is now complete, start scanning the next one. // This basic block is now complete, start scanning the next one.
break; break;
}
} else { } else {
++I; ++I;
} }