diff options
author | Tanya Lattner <tonic@nondot.org> | 2004-06-25 00:13:11 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2004-06-25 00:13:11 +0000 |
commit | b140762a45d21aaed054f15adaff0fc2274d939d (patch) | |
tree | a68975838c30f8e7ff326503550a907dc17b3f13 /include/llvm/CodeGen/MachineInstr.h | |
parent | 32b588039e8db86269edab5bd2b49ba1aebb00b8 (diff) |
Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 02c881d64a..97c60f9e3a 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -308,7 +308,13 @@ public: // code.' It's not clear where the duplication is. assert(hasAllocatedReg() && "This operand cannot have a register number!"); regNum = Reg; - } + } + + void setValueReg(Value *val) { + assert(getVRegValueOrNull() != 0 && "Original operand must of type Value*"); + contents.value = val; + } + void setImmedValue(int immVal) { assert(isImmediate() && "Wrong MachineOperand mutator"); contents.immedVal = immVal; @@ -465,7 +471,7 @@ public: // // Debugging support // - void print(std::ostream &OS, const TargetMachine &TM) const; + void print(std::ostream &OS, const TargetMachine *TM) const; void dump() const; friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr); |