[llvm-commits] [llvm] r73809 - /llvm/trunk/include/llvm/MC/MCInst.h

Chris Lattner sabre at nondot.org
Fri Jun 19 17:47:55 PDT 2009


Author: lattner
Date: Fri Jun 19 19:47:37 2009
New Revision: 73809

URL: http://llvm.org/viewvc/llvm-project?rev=73809&view=rev
Log:
make immediates be int64_t like machineoperand.  Add some apis

Modified:
    llvm/trunk/include/llvm/MC/MCInst.h

Modified: llvm/trunk/include/llvm/MC/MCInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCInst.h?rev=73809&r1=73808&r2=73809&view=diff

==============================================================================
--- llvm/trunk/include/llvm/MC/MCInst.h (original)
+++ llvm/trunk/include/llvm/MC/MCInst.h Fri Jun 19 19:47:37 2009
@@ -35,7 +35,7 @@
   
   union {
     unsigned RegVal;
-    uint64_t ImmVal;
+    int64_t ImmVal;
   };
 public:
   
@@ -57,11 +57,11 @@
     RegVal = Reg;
   }
   
-  uint64_t getImm() const {
+  int64_t getImm() const {
     assert(isImm() && "This is not an immediate");
     return ImmVal;
   }
-  void setImm(uint64_t Val) {
+  void setImm(int64_t Val) {
     assert(isImm() && "This is not an immediate");
     ImmVal = Val;
   }
@@ -70,7 +70,7 @@
     Kind = kRegister;
     RegVal = Reg;
   }
-  void MakeImm(uint64_t Val) {
+  void MakeImm(int64_t Val) {
     Kind = kImmediate;
     ImmVal = Val;
   }
@@ -85,11 +85,17 @@
 public:
   MCInst() : Opcode(~0U) {}
   
+  void setOpcode(unsigned Op) { Opcode = Op; }
+  
   unsigned getOpcode() const { return Opcode; }
   DebugLoc getDebugLoc() const { return DebugLoc(); }
   
   const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
   
+  void addOperand(const MCOperand &Op) {
+    Operands.push_back(Op);
+  }
+  
 };
 
 





More information about the llvm-commits mailing list