diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-10-17 18:06:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-10-17 18:06:55 +0000 |
| commit | a61f0105bdd1c6ffc66f7a183af7f548eae54d7f (patch) | |
| tree | 2fdb45b8871177aa5ae8fc1423b50581d408e531 /llvm/lib/Target | |
| parent | 19398ec86e102d2d7f050bfe4429aef55a6911b2 (diff) | |
| download | bcm5719-llvm-a61f0105bdd1c6ffc66f7a183af7f548eae54d7f.tar.gz bcm5719-llvm-a61f0105bdd1c6ffc66f7a183af7f548eae54d7f.zip | |
add support for inserting an uncond branch
llvm-svn: 31003
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index ddb9dbf3162..9bf0746a2a2 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -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!"); |

