Skip to content

Commit b8b2f67

Browse files
committed
.
Created using spr 1.3.5-bogner
1 parent f6d368f commit b8b2f67

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

bolt/lib/Passes/AsmDump.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,14 @@ void dumpFunction(const BinaryFunction &BF) {
134134
std::unique_ptr<MCAsmBackend> MAB(
135135
BC.TheTarget->createMCAsmBackend(*BC.STI, *BC.MRI, MCTargetOptions()));
136136
int AsmPrinterVariant = BC.AsmInfo->getAssemblerDialect();
137-
MCInstPrinter *InstructionPrinter(BC.TheTarget->createMCInstPrinter(
138-
*BC.TheTriple, AsmPrinterVariant, *BC.AsmInfo, *BC.MII, *BC.MRI));
137+
std::unique_ptr<MCInstPrinter> InstructionPrinter(
138+
BC.TheTarget->createMCInstPrinter(*BC.TheTriple, AsmPrinterVariant,
139+
*BC.AsmInfo, *BC.MII, *BC.MRI));
139140
auto FOut = std::make_unique<formatted_raw_ostream>(OS);
140141
FOut->SetUnbuffered();
141-
std::unique_ptr<MCStreamer> AsmStreamer(
142-
createAsmStreamer(*LocalCtx, std::move(FOut), InstructionPrinter,
143-
std::move(MCEInstance.MCE), std::move(MAB)));
142+
std::unique_ptr<MCStreamer> AsmStreamer(createAsmStreamer(
143+
*LocalCtx, std::move(FOut), std::move(InstructionPrinter),
144+
std::move(MCEInstance.MCE), std::move(MAB)));
144145
AsmStreamer->initSections(true, *BC.STI);
145146
std::unique_ptr<TargetMachine> TM(BC.TheTarget->createTargetMachine(
146147
*BC.TheTriple, "", "", TargetOptions(), std::nullopt));

clang/tools/driver/cc1as_main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "llvm/MC/MCAsmInfo.h"
2727
#include "llvm/MC/MCCodeEmitter.h"
2828
#include "llvm/MC/MCContext.h"
29+
#include "llvm/MC/MCInstPrinter.h"
2930
#include "llvm/MC/MCInstrInfo.h"
3031
#include "llvm/MC/MCObjectFileInfo.h"
3132
#include "llvm/MC/MCObjectWriter.h"
@@ -541,8 +542,8 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
541542

542543
// FIXME: There is a bit of code duplication with addPassesToEmitFile.
543544
if (Opts.OutputType == AssemblerInvocation::FT_Asm) {
544-
MCInstPrinter *IP = TheTarget->createMCInstPrinter(
545-
llvm::Triple(Opts.Triple), Opts.OutputAsmVariant, *MAI, *MCII, *MRI);
545+
std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
546+
llvm::Triple(Opts.Triple), Opts.OutputAsmVariant, *MAI, *MCII, *MRI));
546547

547548
std::unique_ptr<MCCodeEmitter> CE;
548549
if (Opts.ShowEncoding)
@@ -551,7 +552,7 @@ static bool ExecuteAssemblerImpl(AssemblerInvocation &Opts,
551552
TheTarget->createMCAsmBackend(*STI, *MRI, MCOptions));
552553

553554
auto FOut = std::make_unique<formatted_raw_ostream>(*Out);
554-
Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), IP,
555+
Str.reset(TheTarget->createAsmStreamer(Ctx, std::move(FOut), std::move(IP),
555556
std::move(CE), std::move(MAB)));
556557
} else if (Opts.OutputType == AssemblerInvocation::FT_Null) {
557558
Str.reset(createNullStreamer(Ctx));

llvm/tools/llvm-ml/llvm-ml.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,12 @@ int llvm_ml_main(int Argc, char **Argv, const llvm::ToolContext &) {
363363
std::unique_ptr<MCInstrInfo> MCII(TheTarget->createMCInstrInfo());
364364
assert(MCII && "Unable to create instruction info!");
365365

366-
std::unique_ptr<MCInstPrinter> IP;
367366
if (FileType == "s") {
368367
const bool OutputATTAsm = InputArgs.hasArg(OPT_output_att_asm);
369368
const unsigned OutputAsmVariant = OutputATTAsm ? 0U // ATT dialect
370369
: 1U; // Intel dialect
371-
IP.reset(TheTarget->createMCInstPrinter(TheTriple, OutputAsmVariant, *MAI,
372-
*MCII, *MRI));
370+
std::unique_ptr<MCInstPrinter> IP(TheTarget->createMCInstPrinter(
371+
TheTriple, OutputAsmVariant, *MAI, *MCII, *MRI));
373372

374373
if (!IP) {
375374
WithColor::error()

0 commit comments

Comments
 (0)