mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Revert r63600. It didn't fix the bug, it just moved it a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cd89525434
commit
2eafb8b404
@ -41,8 +41,7 @@ bool llvm::InlineFunction(InvokeInst *II, CallGraph *CG, const TargetData *TD) {
|
|||||||
/// block of the inlined code (the last block is the end of the function),
|
/// block of the inlined code (the last block is the end of the function),
|
||||||
/// and InlineCodeInfo is information about the code that got inlined.
|
/// and InlineCodeInfo is information about the code that got inlined.
|
||||||
static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
|
static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
|
||||||
ClonedCodeInfo &InlinedCodeInfo,
|
ClonedCodeInfo &InlinedCodeInfo) {
|
||||||
CallGraph *CG) {
|
|
||||||
BasicBlock *InvokeDest = II->getUnwindDest();
|
BasicBlock *InvokeDest = II->getUnwindDest();
|
||||||
std::vector<Value*> InvokeDestPHIValues;
|
std::vector<Value*> InvokeDestPHIValues;
|
||||||
|
|
||||||
@ -94,10 +93,6 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
|
|||||||
// Make sure that anything using the call now uses the invoke!
|
// Make sure that anything using the call now uses the invoke!
|
||||||
CI->replaceAllUsesWith(II);
|
CI->replaceAllUsesWith(II);
|
||||||
|
|
||||||
// Update the callgraph.
|
|
||||||
if (CG)
|
|
||||||
(*CG)[Caller]->replaceCallSite(CI, II);
|
|
||||||
|
|
||||||
// Delete the unconditional branch inserted by splitBasicBlock
|
// Delete the unconditional branch inserted by splitBasicBlock
|
||||||
BB->getInstList().pop_back();
|
BB->getInstList().pop_back();
|
||||||
Split->getInstList().pop_front(); // Delete the original call
|
Split->getInstList().pop_front(); // Delete the original call
|
||||||
@ -438,7 +433,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) {
|
|||||||
// any inlined 'unwind' instructions into branches to the invoke exception
|
// any inlined 'unwind' instructions into branches to the invoke exception
|
||||||
// destination, and call instructions into invoke instructions.
|
// destination, and call instructions into invoke instructions.
|
||||||
if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall))
|
if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall))
|
||||||
HandleInlinedInvoke(II, FirstNewBlock, InlinedFunctionInfo, CG);
|
HandleInlinedInvoke(II, FirstNewBlock, InlinedFunctionInfo);
|
||||||
|
|
||||||
// If we cloned in _exactly one_ basic block, and if that block ends in a
|
// If we cloned in _exactly one_ basic block, and if that block ends in a
|
||||||
// return instruction, we splice the body of the inlined callee directly into
|
// return instruction, we splice the body of the inlined callee directly into
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
; RUN: llvm-as < %s | opt -inline -prune-eh
|
|
||||||
; PR3367
|
|
||||||
|
|
||||||
define void @f2() {
|
|
||||||
invoke void @f6()
|
|
||||||
to label %ok1 unwind label %lpad1
|
|
||||||
|
|
||||||
ok1:
|
|
||||||
ret void
|
|
||||||
|
|
||||||
lpad1:
|
|
||||||
invoke void @f4()
|
|
||||||
to label %ok2 unwind label %lpad2
|
|
||||||
|
|
||||||
ok2:
|
|
||||||
call void @f8()
|
|
||||||
unreachable
|
|
||||||
|
|
||||||
lpad2:
|
|
||||||
unreachable
|
|
||||||
}
|
|
||||||
|
|
||||||
declare void @f3()
|
|
||||||
|
|
||||||
define void @f4() {
|
|
||||||
call void @f3()
|
|
||||||
ret void
|
|
||||||
}
|
|
||||||
|
|
||||||
declare void @f6() nounwind
|
|
||||||
|
|
||||||
declare void @f8()
|
|
Loading…
x
Reference in New Issue
Block a user