From a875e3d4d6ca6d9cbc0af31ffe2b20333c9eaef6 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Thu, 5 Feb 2015 00:58:51 +0000 Subject: [PATCH] [MC] Remove various unused MCAsmInfo parameters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228244 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCInst.h | 11 +++++------ include/llvm/MC/MCValue.h | 2 +- .../RuntimeDyld/RuntimeDyldChecker.cpp | 8 ++------ lib/MC/MCAsmStreamer.cpp | 4 ++-- lib/MC/MCInst.cpp | 11 +++++------ lib/MC/MCValue.cpp | 2 +- 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h index 25cd5ccb08f..5e25372be4a 100644 --- a/include/llvm/MC/MCInst.h +++ b/include/llvm/MC/MCInst.h @@ -139,7 +139,7 @@ public: return Op; } - void print(raw_ostream &OS, const MCAsmInfo *MAI) const; + void print(raw_ostream &OS) const; void dump() const; }; @@ -181,24 +181,23 @@ public: return Operands.insert(I, Op); } - void print(raw_ostream &OS, const MCAsmInfo *MAI) const; + void print(raw_ostream &OS) const; void dump() const; /// \brief Dump the MCInst as prettily as possible using the additional MC /// structures, if given. Operators are separated by the \p Separator /// string. - void dump_pretty(raw_ostream &OS, const MCAsmInfo *MAI = nullptr, - const MCInstPrinter *Printer = nullptr, + void dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer = nullptr, StringRef Separator = " ") const; }; inline raw_ostream& operator<<(raw_ostream &OS, const MCOperand &MO) { - MO.print(OS, nullptr); + MO.print(OS); return OS; } inline raw_ostream& operator<<(raw_ostream &OS, const MCInst &MI) { - MI.print(OS, nullptr); + MI.print(OS); return OS; } diff --git a/include/llvm/MC/MCValue.h b/include/llvm/MC/MCValue.h index dd86979690c..175fed090b3 100644 --- a/include/llvm/MC/MCValue.h +++ b/include/llvm/MC/MCValue.h @@ -55,7 +55,7 @@ public: bool isAbsolute() const { return !SymA && !SymB; } /// print - Print the value to the stream \p OS. - void print(raw_ostream &OS, const MCAsmInfo *MAI) const; + void print(raw_ostream &OS) const; /// dump - Print the value to stderr. void dump() const; diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 309a9b48296..976a434eced 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -260,9 +260,7 @@ private: << "'. Instruction has only " << format("%i", Inst.getNumOperands()) << " operands.\nInstruction is:\n "; - Inst.dump_pretty(ErrMsgStream, - Checker.Disassembler->getContext().getAsmInfo(), - Checker.InstPrinter); + Inst.dump_pretty(ErrMsgStream, Checker.InstPrinter); return std::make_pair(EvalResult(ErrMsgStream.str()), ""); } @@ -272,9 +270,7 @@ private: raw_string_ostream ErrMsgStream(ErrMsg); ErrMsgStream << "Operand '" << format("%i", OpIdx) << "' of instruction '" << Symbol << "' is not an immediate.\nInstruction is:\n "; - Inst.dump_pretty(ErrMsgStream, - Checker.Disassembler->getContext().getAsmInfo(), - Checker.InstPrinter); + Inst.dump_pretty(ErrMsgStream, Checker.InstPrinter); return std::make_pair(EvalResult(ErrMsgStream.str()), ""); } diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 1fe0f63b5a1..2312cd5ea02 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -1256,7 +1256,7 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &S // Show the MCInst if enabled. if (ShowInst) { - Inst.dump_pretty(GetCommentOS(), MAI, InstPrinter.get(), "\n "); + Inst.dump_pretty(GetCommentOS(), InstPrinter.get(), "\n "); GetCommentOS() << "\n"; } @@ -1264,7 +1264,7 @@ void MCAsmStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &S if (InstPrinter) InstPrinter->printInst(&Inst, OS, ""); else - Inst.print(OS, MAI); + Inst.print(OS); EmitEOL(); } diff --git a/lib/MC/MCInst.cpp b/lib/MC/MCInst.cpp index d7b80f58905..521b57fa239 100644 --- a/lib/MC/MCInst.cpp +++ b/lib/MC/MCInst.cpp @@ -15,7 +15,7 @@ using namespace llvm; -void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const { +void MCOperand::print(raw_ostream &OS) const { OS << ""; } -void MCInst::dump_pretty(raw_ostream &OS, const MCAsmInfo *MAI, - const MCInstPrinter *Printer, +void MCInst::dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer, StringRef Separator) const { OS << ""; } diff --git a/lib/MC/MCValue.cpp b/lib/MC/MCValue.cpp index 9dfc56ef23d..53654bd9dec 100644 --- a/lib/MC/MCValue.cpp +++ b/lib/MC/MCValue.cpp @@ -15,7 +15,7 @@ using namespace llvm; -void MCValue::print(raw_ostream &OS, const MCAsmInfo *MAI) const { +void MCValue::print(raw_ostream &OS) const { if (isAbsolute()) { OS << getConstant(); return;