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 | 2dc7723474c54efcbcac6265dad0a7271902f1a5 (patch) | |
tree | 03f42da2c20835749d6b4a28bcd6279a86b16b57 /lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | 32bd5f4f6a374f9ab0fcbd2cf6a8561019a6fd56 (diff) | |
download | llvm-2dc7723474c54efcbcac6265dad0a7271902f1a5.tar.gz llvm-2dc7723474c54efcbcac6265dad0a7271902f1a5.tar.bz2 llvm-2dc7723474c54efcbcac6265dad0a7271902f1a5.tar.xz |
add support for inserting an uncond branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.cpp b/lib/Target/PowerPC/PPCInstrInfo.cpp index ddb9dbf316..9bf0746a2a 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/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!"); |