From d374087be5360a353a4239a155b1227057145f48 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 4 Apr 2010 05:04:31 +0000 Subject: 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 --- tools/edis/EDDisassembler.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tools/edis') diff --git a/tools/edis/EDDisassembler.cpp b/tools/edis/EDDisassembler.cpp index f2b2f91577..8729b4998f 100644 --- a/tools/edis/EDDisassembler.cpp +++ b/tools/edis/EDDisassembler.cpp @@ -195,10 +195,7 @@ EDDisassembler::EDDisassembler(CPUKey &key) : InstString.reset(new std::string); InstStream.reset(new raw_string_ostream(*InstString)); - - InstPrinter.reset(Tgt->createMCInstPrinter(syntaxVariant, - *AsmInfo, - *InstStream)); + InstPrinter.reset(Tgt->createMCInstPrinter(syntaxVariant, *AsmInfo)); if (!InstPrinter) return; @@ -314,11 +311,10 @@ bool EDDisassembler::registerIsProgramCounter(unsigned registerID) { return (programCounters.find(registerID) != programCounters.end()); } -int EDDisassembler::printInst(std::string& str, - MCInst& inst) { +int EDDisassembler::printInst(std::string &str, MCInst &inst) { PrinterMutex.acquire(); - InstPrinter->printInst(&inst); + InstPrinter->printInst(&inst, *InstStream); InstStream->flush(); str = *InstString; InstString->clear(); -- cgit v1.2.3