MC/AsmMatcher: Fix indirect 80-col viola.
[oota-llvm.git] / utils / TableGen / CodeGenInstruction.h
index f5b22396360c34830ff52d2c9c3148d16bb37a24..d58bfb12968d1c709158148ce754942ea7e705c7 100644 (file)
@@ -213,6 +213,7 @@ namespace llvm {
     bool isBranch;
     bool isIndirectBranch;
     bool isCompare;
+    bool isMoveImm;
     bool isBarrier;
     bool isCall;
     bool canFoldAsLoad;
@@ -267,10 +268,30 @@ namespace llvm {
     
     
     struct ResultOperand {
+    private:
       StringRef Name;
       Record *R;
       
-      ResultOperand(StringRef N, Record *r) : Name(N), R(r) {}
+      int64_t Imm;
+    public:      
+      enum {
+        K_Record,
+        K_Imm,
+        K_Reg
+      } Kind;
+      
+      ResultOperand(StringRef N, Record *r) : Name(N), R(r), Kind(K_Record) {}
+      ResultOperand(int64_t I) : Imm(I), Kind(K_Imm) {}
+      ResultOperand(Record *r) : R(r), Kind(K_Reg) {}
+
+      bool isRecord() const { return Kind == K_Record; }
+      bool isImm() const { return Kind == K_Imm; }
+      bool isReg() const { return Kind == K_Reg; }
+      
+      StringRef getName() const { assert(isRecord()); return Name; }
+      Record *getRecord() const { assert(isRecord()); return R; }
+      int64_t getImm() const { assert(isImm()); return Imm; }
+      Record *getRegister() const { assert(isReg()); return R; }
     };
     
     /// ResultOperands - The decoded operands for the result instruction.