diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-03 05:46:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-03 05:46:51 +0000 |
commit | f4366a39982d30637c3d5bd90d936337ec1066c8 (patch) | |
tree | 9127e5abf20925b725325bb80a84b47a9b710ada /llvm/lib/MC/MCExpr.cpp | |
parent | 1a67fe8862e91e27bc01c0adea754922200f4a59 (diff) | |
download | bcm5719-llvm-f4366a39982d30637c3d5bd90d936337ec1066c8.tar.gz bcm5719-llvm-f4366a39982d30637c3d5bd90d936337ec1066c8.zip |
Thread an MCAsmInfo pointer through the various MC printing APIs,
and fix a few things using << on MCSymbols to use ->print(). No
functionality change other than unbreaking my previous patch.
llvm-svn: 80890
Diffstat (limited to 'llvm/lib/MC/MCExpr.cpp')
-rw-r--r-- | llvm/lib/MC/MCExpr.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp index bc4241560e8..9a1b641fb49 100644 --- a/llvm/lib/MC/MCExpr.cpp +++ b/llvm/lib/MC/MCExpr.cpp @@ -14,14 +14,14 @@ #include "llvm/Support/raw_ostream.h" using namespace llvm; -void MCExpr::print(raw_ostream &OS) const { +void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const { switch (getKind()) { case MCExpr::Constant: OS << cast<MCConstantExpr>(*this).getValue(); return; case MCExpr::SymbolRef: - cast<MCSymbolRefExpr>(*this).getSymbol().print(OS); + cast<MCSymbolRefExpr>(*this).getSymbol().print(OS, MAI); return; case MCExpr::Unary: { @@ -33,14 +33,14 @@ void MCExpr::print(raw_ostream &OS) const { case MCUnaryExpr::Not: OS << '~'; break; case MCUnaryExpr::Plus: OS << '+'; break; } - UE.getSubExpr()->print(OS); + UE.getSubExpr()->print(OS, MAI); return; } case MCExpr::Binary: { const MCBinaryExpr &BE = cast<MCBinaryExpr>(*this); OS << '('; - BE.getLHS()->print(OS); + BE.getLHS()->print(OS, MAI); OS << ' '; switch (BE.getOpcode()) { default: assert(0 && "Invalid opcode!"); @@ -64,7 +64,7 @@ void MCExpr::print(raw_ostream &OS) const { case MCBinaryExpr::Xor: OS << '^'; break; } OS << ' '; - BE.getRHS()->print(OS); + BE.getRHS()->print(OS, MAI); OS << ')'; return; } @@ -74,7 +74,7 @@ void MCExpr::print(raw_ostream &OS) const { } void MCExpr::dump() const { - print(errs()); + print(errs(), 0); errs() << '\n'; } |