diff options
author | Mon P Wang <wangmp@apple.com> | 2008-10-10 01:43:55 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-10-10 01:43:55 +0000 |
commit | 5ca6bd14a00ba5310ce1a632d3a0cc8f8af31433 (patch) | |
tree | 2dc72c51de34f900155424141cc277c0bedb7f0a /lib/CodeGen/MachineInstr.cpp | |
parent | 47bd1d4bf3c63c8c10db6ff42a867b7c84a30f0e (diff) |
Added missing print functions that take a raw_ostream
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 5a617e8127..81fe48e7a6 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -164,6 +164,11 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { /// print - Print the specified machine operand. /// void MachineOperand::print(std::ostream &OS, const TargetMachine *TM) const { + raw_os_ostream RawOS(OS); + print(RawOS, TM); +} + +void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const { switch (getType()) { case MachineOperand::MO_Register: if (getReg() == 0 || TargetRegisterInfo::isVirtualRegister(getReg())) { @@ -768,6 +773,11 @@ void MachineInstr::dump() const { } void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const { + raw_os_ostream RawOS(OS); + print(RawOS, TM); +} + +void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const { // Specialize printing if op#0 is definition unsigned StartOp = 0; if (getNumOperands() && getOperand(0).isReg() && getOperand(0).isDef()) { @@ -810,8 +820,7 @@ void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const { else if (!V->getName().empty()) OS << V->getName(); else if (const PseudoSourceValue *PSV = dyn_cast<PseudoSourceValue>(V)) { - raw_os_ostream OSS(OS); - PSV->print(OSS); + PSV->print(OS); } else OS << V; |