Delete an unused function.
[oota-llvm.git] / include / llvm / CodeGen / MachineOperand.h
index dac00921b1a1de8ade72d995657ea8b9c1dd1d7b..b5f6bcd9e7ec897709f202d70b7c59a46b83c39b 100644 (file)
 
 namespace llvm {
   
-class ConstantFP;
 class BlockAddress;
-class MachineBasicBlock;
+class ConstantFP;
 class GlobalValue;
+class MachineBasicBlock;
 class MachineInstr;
-class TargetMachine;
 class MachineRegisterInfo;
 class MDNode;
+class TargetMachine;
 class raw_ostream;
+class MCSymbol;
   
 /// MachineOperand class - Representation of each machine instruction operand.
 ///
@@ -44,7 +45,8 @@ public:
     MO_ExternalSymbol,         ///< Name of external global symbol
     MO_GlobalAddress,          ///< Address of a global value
     MO_BlockAddress,           ///< Address of a basic block
-    MO_Metadata                ///< Metadata reference (for debug info)
+    MO_Metadata,               ///< Metadata reference (for debug info)
+    MO_MCSymbol                ///< MCSymbol reference (for debug/eh info)
   };
 
 private:
@@ -100,7 +102,8 @@ private:
     MachineBasicBlock *MBB;   // For MO_MachineBasicBlock.
     const ConstantFP *CFP;    // For MO_FPImmediate.
     int64_t ImmVal;           // For MO_Immediate.
-    MDNode *MD;               // For MO_Metadata.
+    const MDNode *MD;         // For MO_Metadata.
+    MCSymbol *Sym;            // For MO_MCSymbol
 
     struct {                  // For MO_Register.
       unsigned RegNo;
@@ -167,6 +170,7 @@ public:
   bool isBlockAddress() const { return OpKind == MO_BlockAddress; }
   /// isMetadata - Tests if this is a MO_Metadata operand.
   bool isMetadata() const { return OpKind == MO_Metadata; }
+  bool isMCSymbol() const { return OpKind == MO_MCSymbol; }
 
   //===--------------------------------------------------------------------===//
   // Accessors for Register Operands
@@ -281,6 +285,11 @@ public:
     IsEarlyClobber = Val;
   }
 
+  void setIsDebug(bool Val = true) {
+    assert(isReg() && IsDef && "Wrong MachineOperand accessor");
+    IsDebug = Val;
+  }
+
   //===--------------------------------------------------------------------===//
   // Accessors for various operand types.
   //===--------------------------------------------------------------------===//
@@ -315,6 +324,11 @@ public:
     assert(isBlockAddress() && "Wrong MachineOperand accessor");
     return Contents.OffsetedInfo.Val.BA;
   }
+
+  MCSymbol *getMCSymbol() const {
+    assert(isMCSymbol() && "Wrong MachineOperand accessor");
+    return Contents.Sym;
+  }
   
   /// getOffset - Return the offset from the symbol in this operand. This always
   /// returns 0 for ExternalSymbol operands.
@@ -467,12 +481,18 @@ public:
     Op.setTargetFlags(TargetFlags);
     return Op;
   }
-  static MachineOperand CreateMetadata(MDNode *Meta) {
+  static MachineOperand CreateMetadata(const MDNode *Meta) {
     MachineOperand Op(MachineOperand::MO_Metadata);
     Op.Contents.MD = Meta;
     return Op;
   }
 
+  static MachineOperand CreateMCSymbol(MCSymbol *Sym) {
+    MachineOperand Op(MachineOperand::MO_MCSymbol);
+    Op.Contents.Sym = Sym;
+    return Op;
+  }
+  
   friend class MachineInstr;
   friend class MachineRegisterInfo;
 private: