Index: tools/llvm-exegesis/lib/Analysis.cpp =================================================================== --- tools/llvm-exegesis/lib/Analysis.cpp +++ tools/llvm-exegesis/lib/Analysis.cpp @@ -114,13 +114,11 @@ writeEscaped(OS, "[error decoding asm snippet]"); return; } - Lines.emplace_back(); - std::string &Line = Lines.back(); - llvm::raw_string_ostream OSS(Line); + llvm::SmallString<128> InstPrinterStr; // FIXME: magic number. + llvm::raw_svector_ostream OSS(InstPrinterStr); InstPrinter_->printInst(&MI, OSS, "", *SubtargetInfo_); Bytes = Bytes.drop_front(MISize); - OSS.flush(); - Line = llvm::StringRef(Line).trim().str(); + Lines.emplace_back(llvm::StringRef(InstPrinterStr).trim()); } writeEscaped(OS, llvm::join(Lines, Separator)); }