diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-04 05:04:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-04 05:04:31 +0000 |
commit | d374087be5360a353a4239a155b1227057145f48 (patch) | |
tree | d8a5027115587ce258f71d8a74b240242ba5c82c /include | |
parent | 35c33bd772b3cfb34fdc6b5c9171f955454d0043 (diff) | |
download | external_llvm-d374087be5360a353a4239a155b1227057145f48.zip external_llvm-d374087be5360a353a4239a155b1227057145f48.tar.gz external_llvm-d374087be5360a353a4239a155b1227057145f48.tar.bz2 |
fix an ugly wart in the MCInstPrinter api where the
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCInstPrinter.h | 11 | ||||
-rw-r--r-- | include/llvm/Target/TargetRegistry.h | 8 |
2 files changed, 7 insertions, 12 deletions
diff --git a/include/llvm/MC/MCInstPrinter.h b/include/llvm/MC/MCInstPrinter.h index d2ddc5b..4839a83 100644 --- a/include/llvm/MC/MCInstPrinter.h +++ b/include/llvm/MC/MCInstPrinter.h @@ -20,26 +20,23 @@ class StringRef; /// that converts an MCInst to valid target assembly syntax. class MCInstPrinter { protected: - /// O - The main stream to emit instruction text to. - raw_ostream &O; - /// CommentStream - a stream that comments can be emitted to if desired. /// Each comment must end with a newline. This will be null if verbose /// assembly emission is disable. raw_ostream *CommentStream; const MCAsmInfo &MAI; public: - MCInstPrinter(raw_ostream &o, const MCAsmInfo &mai) - : O(o), CommentStream(0), MAI(mai) {} + MCInstPrinter(const MCAsmInfo &mai) + : CommentStream(0), MAI(mai) {} virtual ~MCInstPrinter(); /// setCommentStream - Specify a stream to emit comments to. void setCommentStream(raw_ostream &OS) { CommentStream = &OS; } - /// printInst - Print the specified MCInst to the current raw_ostream. + /// printInst - Print the specified MCInst to the specified raw_ostream. /// - virtual void printInst(const MCInst *MI) = 0; + virtual void printInst(const MCInst *MI, raw_ostream &OS) = 0; /// getOpcodeName - Return the name of the specified opcode enum (e.g. /// "MOV32ri") or empty if we can't resolve it. diff --git a/include/llvm/Target/TargetRegistry.h b/include/llvm/Target/TargetRegistry.h index 6b6dad8..272205a 100644 --- a/include/llvm/Target/TargetRegistry.h +++ b/include/llvm/Target/TargetRegistry.h @@ -71,8 +71,7 @@ namespace llvm { typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T); typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Target &T, unsigned SyntaxVariant, - const MCAsmInfo &MAI, - raw_ostream &O); + const MCAsmInfo &MAI); typedef MCCodeEmitter *(*CodeEmitterCtorTy)(const Target &T, TargetMachine &TM, MCContext &Ctx); @@ -248,11 +247,10 @@ namespace llvm { } MCInstPrinter *createMCInstPrinter(unsigned SyntaxVariant, - const MCAsmInfo &MAI, - raw_ostream &O) const { + const MCAsmInfo &MAI) const { if (!MCInstPrinterCtorFn) return 0; - return MCInstPrinterCtorFn(*this, SyntaxVariant, MAI, O); + return MCInstPrinterCtorFn(*this, SyntaxVariant, MAI); } |