Skip to content

Commit a7ad032

Browse files
committed
comgr:fix for removal of createAsmStreamer
1 parent c515ad9 commit a7ad032

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

amd/comgr/src/comgr-compiler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#include "llvm/MC/MCCodeEmitter.h"
7171
#include "llvm/MC/MCContext.h"
7272
#include "llvm/MC/MCInstrInfo.h"
73+
#include "llvm/MC/MCInstPrinter.h"
7374
#include "llvm/MC/MCObjectFileInfo.h"
7475
#include "llvm/MC/MCObjectWriter.h"
7576
#include "llvm/MC/MCParser/MCAsmParser.h"
@@ -462,8 +463,9 @@ bool executeAssemblerImpl(AssemblerInvocation &Opts, DiagnosticsEngine &Diags,
462463

463464
// FIXME: There is a bit of code duplication with addPassesToEmitFile.
464465
if (Opts.OutputType == AssemblerInvocation::FT_Asm) {
465-
MCInstPrinter *IP = TheTarget->createMCInstPrinter(
466-
llvm::Triple(Opts.Triple), Opts.OutputAsmVariant, *MAI, *MCII, *MRI);
466+
std::unique_ptr<MCInstPrinter> InstructionPrinter(
467+
TheTarget->createMCInstPrinter(
468+
llvm::Triple(Opts.Triple), Opts.OutputAsmVariant, *MAI, *MCII, *MRI));
467469
std::unique_ptr<MCCodeEmitter> MCE;
468470
std::unique_ptr<MCAsmBackend> MAB;
469471
if (Opts.ShowEncoding) {
@@ -472,7 +474,7 @@ bool executeAssemblerImpl(AssemblerInvocation &Opts, DiagnosticsEngine &Diags,
472474
MAB.reset(TheTarget->createMCAsmBackend(*STI, *MRI, Options));
473475
}
474476
auto FOut = std::make_unique<formatted_raw_ostream>(*Out);
475-
Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), IP,
477+
Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), std::move(InstructionPrinter),
476478
std::move(MCE), std::move(MAB)));
477479
} else if (Opts.OutputType == AssemblerInvocation::FT_Null) {
478480
Str.reset(createNullStreamer(Ctx));

0 commit comments

Comments
 (0)