diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-01 05:30:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-01 05:30:29 +0000 |
commit | 786a518f47fca5521d036031f78e3f2470a7a49a (patch) | |
tree | ac7724f4d5cf7c2ebdc44222fa55cd9a6a50a60d /include/llvm/CodeGen/MachineInstr.h | |
parent | 9b527704f75d1ae15b9c290090c8991171a13af1 (diff) |
Add some "useful" methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 2eb373f462..3e8c35a70f 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -261,6 +261,8 @@ public: return regNum; } int64_t getImmedValue() const { assert(isImmediate()); return immedVal; } + void setImmedValue(int64_t ImmVal) { assert(isImmediate()); immedVal=ImmVal; } + MachineBasicBlock *getMachineBasicBlock() const { assert(isMachineBasicBlock() && "Can't get MBB in non-MBB operand!"); return MBB; @@ -306,6 +308,10 @@ public: unsigned getReg() const { return getAllocatedRegNum(); } + void setReg(unsigned Reg) { + assert(hasAllocatedReg() && "This operand cannot have a register number!"); + regNum = Reg; + } friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); |