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 | dfcc1ff8f8e6f98ba7d12fa194083ff0ba3ec724 (patch) | |
tree | 83503167f6c121259252891077875bd63678e135 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 58ca7bdbf0b7edf8d0ca0978335e2152a160a4f5 (diff) | |
download | bcm5719-llvm-dfcc1ff8f8e6f98ba7d12fa194083ff0ba3ec724.tar.gz bcm5719-llvm-dfcc1ff8f8e6f98ba7d12fa194083ff0ba3ec724.zip |
Added missing print functions that take a raw_ostream
llvm-svn: 57339
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 5a617e81279..81fe48e7a67 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/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; |