add support for inserting an uncond branch

llvm-svn: 31003
This commit is contained in:
Chris Lattner 2006-10-17 18:06:55 +00:00
parent 19398ec86e
commit a61f0105bd
1 changed files with 8 additions and 2 deletions

View File

@ -238,8 +238,14 @@ void PPCInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const {
void PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
MachineBasicBlock *FBB,
const std::vector<MachineOperand> &Cond) const {
// Fall through?
if (TBB == 0 && FBB == 0) return;
// Shouldn't be a fall through.
assert(TBB && "InsertBranch must not be told to insert a fallthrough");
// Unconditional branch?
if (FBB == 0) {
BuildMI(&MBB, PPC::B, 1).addMBB(TBB);
return;
}
assert(Cond.size() == 2 && "PPC branch conditions have two components!");