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
void DIEExpr::printImpl(raw_ostream &O) const {
O << "Expr: ";
Expr->print(O);
}
void DIEExpr::printImpl(raw_ostream &O) const { O << "Expr: " << *Expr; }
#endif
//===----------------------------------------------------------------------===//

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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