From a61f0105bdd1c6ffc66f7a183af7f548eae54d7f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 17 Oct 2006 18:06:55 +0000 Subject: add support for inserting an uncond branch llvm-svn: 31003 --- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Target') 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 &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!"); -- cgit v1.2.3