mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Fix minor problems in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3668 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -50,7 +50,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
|||||||
if (F.getReturnType() != Type::VoidTy) {
|
if (F.getReturnType() != Type::VoidTy) {
|
||||||
// If the function doesn't return void... add a PHI node to the block...
|
// If the function doesn't return void... add a PHI node to the block...
|
||||||
PHINode *PN = new PHINode(F.getReturnType(), "UnifiedRetVal",
|
PHINode *PN = new PHINode(F.getReturnType(), "UnifiedRetVal",
|
||||||
NewRetBlock.end());
|
NewRetBlock->end());
|
||||||
|
|
||||||
// Add an incoming element to the PHI node for every return instruction that
|
// Add an incoming element to the PHI node for every return instruction that
|
||||||
// is merging into this new block...
|
// is merging into this new block...
|
||||||
@ -59,10 +59,10 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
|||||||
PN->addIncoming((*I)->getTerminator()->getOperand(0), *I);
|
PN->addIncoming((*I)->getTerminator()->getOperand(0), *I);
|
||||||
|
|
||||||
// Add a return instruction to return the result of the PHI node...
|
// Add a return instruction to return the result of the PHI node...
|
||||||
new ReturnInst(PN, NewRetBlock.end());
|
new ReturnInst(PN, NewRetBlock->end());
|
||||||
} else {
|
} else {
|
||||||
// If it returns void, just add a return void instruction to the block
|
// If it returns void, just add a return void instruction to the block
|
||||||
new ReturnInst(0, NewRetBlock.end());
|
new ReturnInst(0, NewRetBlock->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over all of the blocks, replacing the return instruction with an
|
// Loop over all of the blocks, replacing the return instruction with an
|
||||||
|
Reference in New Issue
Block a user