mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
In "empty" bb, the return instruction may not be first instruction, if dbg value intrinsics are present in this bb. Use terminator to find return instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98565 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
757e75b033
commit
ca70495797
@ -244,7 +244,7 @@ static bool MergeEmptyReturnBlocks(Function &F) {
|
||||
// If the canonical return block has no PHI node, create one now.
|
||||
PHINode *RetBlockPHI = dyn_cast<PHINode>(RetBlock->begin());
|
||||
if (RetBlockPHI == 0) {
|
||||
Value *InVal = cast<ReturnInst>(RetBlock->begin())->getOperand(0);
|
||||
Value *InVal = cast<ReturnInst>(RetBlock->getTerminator())->getOperand(0);
|
||||
RetBlockPHI = PHINode::Create(Ret->getOperand(0)->getType(), "merge",
|
||||
&RetBlock->front());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user