Provide addc and subc
[oota-llvm.git] / lib / Target / TargetInstrInfo.cpp
1 //===-- TargetInstrInfo.cpp - Target Instruction Information --------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the TargetInstrInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/Target/TargetInstrInfo.h"
15 #include "llvm/Constant.h"
16 #include "llvm/DerivedTypes.h"
17 using namespace llvm;
18
19 TargetInstrInfo::TargetInstrInfo(const TargetInstrDesc* Desc,
20                                  unsigned numOpcodes)
21   : Descriptors(Desc), NumOpcodes(numOpcodes) {
22 }
23
24 TargetInstrInfo::~TargetInstrInfo() {
25 }
26
27 bool TargetInstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {
28   const TargetInstrDesc &TID = MI->getDesc();
29   if (!TID.isTerminator()) return false;
30   
31   // Conditional branch is a special case.
32   if (TID.isBranch() && !TID.isBarrier())
33     return true;
34   if (!TID.isPredicable())
35     return true;
36   return !isPredicated(MI);
37 }