summaryrefslogtreecommitdiff
path: root/lib/Target/PIC16/PIC16InstrInfo.cpp
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-03 21:10:15 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-03 21:10:15 +0000
commit68eb509bdc5c7007520d5231cd92de28106236df (patch)
treedb103e2a0755ab86f18c181a2d208a6a63284c97 /lib/Target/PIC16/PIC16InstrInfo.cpp
parent33a8e4360f5050416130517e5c7a1007d06aa90f (diff)
Diffstat (limited to 'lib/Target/PIC16/PIC16InstrInfo.cpp')
-rw-r--r--lib/Target/PIC16/PIC16InstrInfo.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/Target/PIC16/PIC16InstrInfo.cpp b/lib/Target/PIC16/PIC16InstrInfo.cpp
index 2a769e8ad16e..8418423fa06a 100644
--- a/lib/Target/PIC16/PIC16InstrInfo.cpp
+++ b/lib/Target/PIC16/PIC16InstrInfo.cpp
@@ -184,3 +184,31 @@ bool PIC16InstrInfo::isMoveInstr(const MachineInstr &MI,
return false;
}
+/// InsertBranch - Insert a branch into the end of the specified
+/// MachineBasicBlock. This operands to this method are the same as those
+/// returned by AnalyzeBranch. This is invoked in cases where AnalyzeBranch
+/// returns success and when an unconditional branch (TBB is non-null, FBB is
+/// null, Cond is empty) needs to be inserted. It returns the number of
+/// instructions inserted.
+unsigned PIC16InstrInfo::
+InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
+ MachineBasicBlock *FBB,
+ const SmallVectorImpl<MachineOperand> &Cond) const {
+ // Shouldn't be a fall through.
+ assert(TBB && "InsertBranch must not be told to insert a fallthrough");
+
+ if (FBB == 0) { // One way branch.
+ if (Cond.empty()) {
+ // Unconditional branch?
+ DebugLoc dl = DebugLoc::getUnknownLoc();
+ BuildMI(&MBB, dl, get(PIC16::br_uncond)).addMBB(TBB);
+ }
+ return 1;
+ }
+
+ // FIXME: If the there are some conditions specified then conditional branch
+ // should be generated.
+ // For the time being no instruction is being generated therefore
+ // returning NULL.
+ return 0;
+}