diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-06-20 00:47:37 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-06-20 00:47:37 +0000 |
| commit | 367274280146ba88a451c28c5764e70beb257342 (patch) | |
| tree | 01df94970a0a1a18903d8e8ea0c1b6c2442204df | |
| parent | dcdc4daa5df80f8f4bb593df165e55872ba3b689 (diff) | |
| download | bcm5719-llvm-367274280146ba88a451c28c5764e70beb257342.tar.gz bcm5719-llvm-367274280146ba88a451c28c5764e70beb257342.zip | |
make immediates be int64_t like machineoperand. Add some apis
llvm-svn: 73809
| -rw-r--r-- | llvm/include/llvm/MC/MCInst.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/include/llvm/MC/MCInst.h b/llvm/include/llvm/MC/MCInst.h index 4f7e6cf0b49..8eaec7b3720 100644 --- a/llvm/include/llvm/MC/MCInst.h +++ b/llvm/include/llvm/MC/MCInst.h @@ -35,7 +35,7 @@ class MCOperand { union { unsigned RegVal; - uint64_t ImmVal; + int64_t ImmVal; }; public: @@ -57,11 +57,11 @@ public: 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 @@ public: Kind = kRegister; RegVal = Reg; } - void MakeImm(uint64_t Val) { + void MakeImm(int64_t Val) { Kind = kImmediate; ImmVal = Val; } @@ -85,11 +85,17 @@ class MCInst { 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); + } + }; |

