[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Nov 30 23:31:01 PST 2003
Changes in directory llvm/include/llvm/CodeGen:
MachineInstr.h updated: 1.115 -> 1.116
---
Log message:
Add some "useful" methods
---
Diffs of the changes: (+6 -0)
Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.115 llvm/include/llvm/CodeGen/MachineInstr.h:1.116
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.115 Tue Nov 11 16:41:31 2003
+++ llvm/include/llvm/CodeGen/MachineInstr.h Sun Nov 30 23:30:29 2003
@@ -261,6 +261,8 @@
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;
@@ -305,6 +307,10 @@
// ********** TODO: get rid of this duplicate code! ***********
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);
More information about the llvm-commits
mailing list