no really, I can spell!
[oota-llvm.git] / include / llvm / CodeGen / MachineOperand.h
index 0eb204ad4c0975d136f56a6fdc8ba1eb1fd8345e..7d39d973cb32f835df1bda0a5345e88ed258e620 100644 (file)
@@ -109,7 +109,7 @@ private:
         int Index;                // For MO_*Index - The index itself.
         const char *SymbolName;   // For MO_ExternalSymbol.
         GlobalValue *GV;          // For MO_GlobalAddress.
-       MDNode *Node;             // For MO_Metadata.
+        MDNode *Node;             // For MO_Metadata.
       } Val;
       int64_t Offset;   // An offset from the object.
     } OffsetedInfo;
@@ -164,6 +164,8 @@ public:
   bool isGlobal() const { return OpKind == MO_GlobalAddress; }
   /// isSymbol - Tests if this is a MO_ExternalSymbol operand.
   bool isSymbol() const { return OpKind == MO_ExternalSymbol; }
+  /// isMetadata - Tests if this is a MO_Metadata operand.
+  bool isMetadata() const { return OpKind == MO_Metadata; }
 
   //===--------------------------------------------------------------------===//
   // Accessors for Register Operands
@@ -300,6 +302,10 @@ public:
     return Contents.OffsetedInfo.Val.GV;
   }
   
+  MDNode *getMDNode() const {
+    return Contents.OffsetedInfo.Val.Node;
+  }
+  
   int64_t getOffset() const {
     assert((isGlobal() || isSymbol() || isCPI()) &&
            "Wrong MachineOperand accessor");
@@ -321,7 +327,7 @@ public:
   }
 
   void setOffset(int64_t Offset) {
-    assert((isGlobal() || isSymbol() || isCPI()) &&
+    assert((isGlobal() || isSymbol() || isCPI() || isMetadata()) &&
         "Wrong MachineOperand accessor");
     Contents.OffsetedInfo.Offset = Offset;
   }
@@ -427,7 +433,7 @@ public:
     return Op;
   }
   static MachineOperand CreateMDNode(MDNode *N, int64_t Offset,
-                                    unsigned char TargetFlags = 0) {
+                                     unsigned char TargetFlags = 0) {
     MachineOperand Op(MachineOperand::MO_Metadata);
     Op.Contents.OffsetedInfo.Val.Node = N;
     Op.setOffset(Offset);