make immediates be int64_t like machineoperand. Add some apis

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73809 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-06-20 00:47:37 +00:00
parent 97b52b2a88
commit bb5d44d7c4

View File

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