[llvm-commits] [llvm] r57339 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp
Mon P Wang
wangmp at apple.com
Thu Oct 9 18:43:55 PDT 2008
Author: wangmp
Date: Thu Oct 9 20:43:55 2008
New Revision: 57339
URL: http://llvm.org/viewvc/llvm-project?rev=57339&view=rev
Log:
Added missing print functions that take a raw_ostream
Modified:
llvm/trunk/lib/CodeGen/MachineInstr.cpp
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=57339&r1=57338&r2=57339&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Oct 9 20:43:55 2008
@@ -164,6 +164,11 @@
/// 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::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 @@
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;
More information about the llvm-commits
mailing list