Use MachineBasicBlock::transferSuccessors.
[oota-llvm.git] / include / llvm / CodeGen / MachineOperand.h
index 7fb2b9e7674d59e2b7f48c674258d5b6744ffa92..28d63524bc4edc89ed0788b8381cfe79461a537e 100644 (file)
 #define LLVM_CODEGEN_MACHINEOPERAND_H
 
 #include "llvm/Support/DataTypes.h"
-#include <vector>
 #include <cassert>
 #include <iosfwd>
 
 namespace llvm {
   
+class ConstantFP;
 class MachineBasicBlock;
 class GlobalValue;
 class MachineInstr;
@@ -34,6 +34,7 @@ public:
   enum MachineOperandType {
     MO_Register,                // Register operand.
     MO_Immediate,               // Immediate Operand
+    MO_FPImmediate,
     MO_MachineBasicBlock,       // MachineBasicBlock reference
     MO_FrameIndex,              // Abstract Stack Frame Index
     MO_ConstantPoolIndex,       // Address of indexed Constant in Constant Pool
@@ -77,6 +78,7 @@ private:
   /// Contents union - This contains the payload for the various operand types.
   union {
     MachineBasicBlock *MBB;   // For MO_MachineBasicBlock.
+    ConstantFP *CFP;          // For MO_FPImmediate.
     int64_t ImmVal;           // For MO_Immediate.
 
     struct {                  // For MO_Register.
@@ -120,6 +122,7 @@ public:
   ///
   bool isRegister() const { return OpKind == MO_Register; }
   bool isImmediate() const { return OpKind == MO_Immediate; }
+  bool isFPImmediate() const { return OpKind == MO_FPImmediate; }
   bool isMachineBasicBlock() const { return OpKind == MO_MachineBasicBlock; }
   bool isFrameIndex() const { return OpKind == MO_FrameIndex; }
   bool isConstantPoolIndex() const { return OpKind == MO_ConstantPoolIndex; }
@@ -231,6 +234,11 @@ public:
     return Contents.ImmVal;
   }
   
+  ConstantFP *getFPImm() const {
+    assert(isFPImmediate() && "Wrong MachineOperand accessor");
+    return Contents.CFP;
+  }
+  
   MachineBasicBlock *getMBB() const {
     assert(isMachineBasicBlock() && "Wrong MachineOperand accessor");
     return Contents.MBB;
@@ -313,6 +321,12 @@ public:
     return Op;
   }
   
+  static MachineOperand CreateFPImm(ConstantFP *CFP) {
+    MachineOperand Op(MachineOperand::MO_FPImmediate);
+    Op.Contents.CFP = CFP;
+    return Op;
+  }
+  
   static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp = false,
                                   bool isKill = false, bool isDead = false,
                                   unsigned SubReg = 0) {