From 5ca6bd14a00ba5310ce1a632d3a0cc8f8af31433 Mon Sep 17 00:00:00 2001 From: Mon P Wang Date: Fri, 10 Oct 2008 01:43:55 +0000 Subject: [PATCH] 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 --- lib/CodeGen/MachineInstr.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 5a617e81279..81fe48e7a67 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(V)) { - raw_os_ostream OSS(OS); - PSV->print(OSS); + PSV->print(OS); } else OS << V;