Use operator<< instead of print in a few more places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238315 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2015-05-27 13:05:42 +00:00
parent baaf8b82c3
commit eac1f66427
9 changed files with 13 additions and 18 deletions

View File

@ -354,10 +354,7 @@ unsigned DIEExpr::SizeOfImpl(const AsmPrinter *AP, dwarf::Form Form) const {
} }
#ifndef NDEBUG #ifndef NDEBUG
void DIEExpr::printImpl(raw_ostream &O) const { void DIEExpr::printImpl(raw_ostream &O) const { O << "Expr: " << *Expr; }
O << "Expr: ";
Expr->print(O);
}
#endif #endif
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@ -200,7 +200,7 @@ private:
O << " Hash Value: " << format("0x%x", HashValue) << "\n"; O << " Hash Value: " << format("0x%x", HashValue) << "\n";
O << " Symbol: "; O << " Symbol: ";
if (Sym) if (Sym)
Sym->print(O); O << *Sym;
else else
O << "<none>"; O << "<none>";
O << "\n"; O << "\n";

View File

@ -124,7 +124,7 @@ void MCExpr::print(raw_ostream &OS) const {
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void MCExpr::dump() const { void MCExpr::dump() const {
print(dbgs()); dbgs() << *this;
dbgs() << '\n'; dbgs() << '\n';
} }
#endif #endif

View File

@ -73,7 +73,5 @@ void MCSymbol::print(raw_ostream &OS) const {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void MCSymbol::dump() const { void MCSymbol::dump() const { dbgs() << *this; }
print(dbgs());
}
#endif #endif

View File

@ -26,11 +26,11 @@ void MCValue::print(raw_ostream &OS) const {
if (getRefKind()) if (getRefKind())
OS << ':' << getRefKind() << ':'; OS << ':' << getRefKind() << ':';
getSymA()->print(OS); OS << *getSymA();
if (getSymB()) { if (getSymB()) {
OS << " - "; OS << " - ";
getSymB()->print(OS); OS << *getSymB();
} }
if (getConstant()) if (getConstant())

View File

@ -1691,12 +1691,12 @@ void AArch64Operand::print(raw_ostream &OS) const {
break; break;
} }
case k_Immediate: case k_Immediate:
getImm()->print(OS); OS << *getImm();
break; break;
case k_ShiftedImm: { case k_ShiftedImm: {
unsigned Shift = getShiftedImmShift(); unsigned Shift = getShiftedImmShift();
OS << "<shiftedimm "; OS << "<shiftedimm ";
getShiftedImmVal()->print(OS); OS << *getShiftedImmVal();
OS << ", lsl #" << AArch64_AM::getShiftValue(Shift) << ">"; OS << ", lsl #" << AArch64_AM::getShiftValue(Shift) << ">";
break; break;
} }

View File

@ -2870,7 +2870,7 @@ void ARMOperand::print(raw_ostream &OS) const {
OS << "<banked reg: " << getBankedReg() << ">"; OS << "<banked reg: " << getBankedReg() << ">";
break; break;
case k_Immediate: case k_Immediate:
getImm()->print(OS); OS << *getImm();
break; break;
case k_MemBarrierOpt: case k_MemBarrierOpt:
OS << "<ARM_MB::" << MemBOptToString(getMemBarrierOpt(), false) << ">"; OS << "<ARM_MB::" << MemBOptToString(getMemBarrierOpt(), false) << ">";

View File

@ -1196,14 +1196,14 @@ public:
switch (Kind) { switch (Kind) {
case k_Immediate: case k_Immediate:
OS << "Imm<"; OS << "Imm<";
Imm.Val->print(OS); OS << *Imm.Val;
OS << ">"; OS << ">";
break; break;
case k_Memory: case k_Memory:
OS << "Mem<"; OS << "Mem<";
Mem.Base->print(OS); Mem.Base->print(OS);
OS << ", "; OS << ", ";
Mem.Off->print(OS); OS << *Mem.Off;
OS << ">"; OS << ">";
break; break;
case k_PhysRegister: case k_PhysRegister:

View File

@ -792,10 +792,10 @@ void PPCOperand::print(raw_ostream &OS) const {
OS << getImm(); OS << getImm();
break; break;
case Expression: case Expression:
getExpr()->print(OS); OS << *getExpr();
break; break;
case TLSRegister: case TLSRegister:
getTLSReg()->print(OS); OS << *getTLSReg();
break; break;
} }
} }