mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Simplify interface to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -34,8 +34,9 @@ bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &II) {
|
||||
// constant value, convert it into an unconditional branch to the constant
|
||||
// destination.
|
||||
//
|
||||
bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II,
|
||||
TerminatorInst *T) {
|
||||
bool ConstantFoldTerminator(BasicBlock *BB) {
|
||||
TerminatorInst *T = BB->getTerminator();
|
||||
|
||||
// Branch - See if we are conditional jumping on constant
|
||||
if (BranchInst *BI = dyn_cast<BranchInst>(T)) {
|
||||
if (BI->isUnconditional()) return false; // Can't optimize uncond branch
|
||||
@ -60,7 +61,6 @@ bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II,
|
||||
// Set the unconditional destination, and change the insn to be an
|
||||
// unconditional branch.
|
||||
BI->setUnconditionalDest(Destination);
|
||||
II = BB->end()-1; // Update instruction iterator!
|
||||
return true;
|
||||
}
|
||||
#if 0
|
||||
|
Reference in New Issue
Block a user