Skip to content

Commit 867faee

Browse files
committed
[MC] Migrate to createAsmStreamer without unused bool parameters
In bolt/lib/Passes/AsmDump.cpp, the MCInstPrinter is created with false AsmVerbose. The AsmVerbose argument to createAsmStreamer is unused. Deprecate the legacy Target::createAsmStreamer overload, which might be used by downstream.
1 parent 14a543e commit 867faee

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

bolt/lib/Passes/AsmDump.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,8 @@ void dumpFunction(const BinaryFunction &BF) {
139139
auto FOut = std::make_unique<formatted_raw_ostream>(OS);
140140
FOut->SetUnbuffered();
141141
std::unique_ptr<MCStreamer> AsmStreamer(
142-
createAsmStreamer(*LocalCtx, std::move(FOut),
143-
/*isVerboseAsm=*/true,
144-
/*useDwarfDirectory=*/false, InstructionPrinter,
145-
std::move(MCEInstance.MCE), std::move(MAB),
146-
/*ShowInst=*/false));
142+
createAsmStreamer(*LocalCtx, std::move(FOut), InstructionPrinter,
143+
std::move(MCEInstance.MCE), std::move(MAB)));
147144
AsmStreamer->initSections(true, *BC.STI);
148145
std::unique_ptr<TargetMachine> TM(BC.TheTarget->createTargetMachine(
149146
BC.TripleName, "", "", TargetOptions(), std::nullopt));

llvm/include/llvm/MC/TargetRegistry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ MCStreamer *createNullStreamer(MCContext &Ctx);
8686
/// the assembly.
8787
MCStreamer *
8888
createAsmStreamer(MCContext &Ctx, std::unique_ptr<formatted_raw_ostream> OS,
89-
bool isVerboseAsm, bool useDwarfDirectory,
9089
MCInstPrinter *InstPrint, std::unique_ptr<MCCodeEmitter> &&CE,
91-
std::unique_ptr<MCAsmBackend> &&TAB, bool ShowInst);
90+
std::unique_ptr<MCAsmBackend> &&TAB);
9291

9392
MCStreamer *createELFStreamer(MCContext &Ctx,
9493
std::unique_ptr<MCAsmBackend> &&TAB,
@@ -544,6 +543,7 @@ class Target {
544543
MCInstPrinter *IP,
545544
std::unique_ptr<MCCodeEmitter> CE,
546545
std::unique_ptr<MCAsmBackend> TAB) const;
546+
LLVM_DEPRECATED("Use the overload without the 3 unused bool", "")
547547
MCStreamer *
548548
createAsmStreamer(MCContext &Ctx, std::unique_ptr<formatted_raw_ostream> OS,
549549
bool IsVerboseAsm, bool UseDwarfDirectory,

llvm/lib/MC/MCAsmStreamer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,11 +2657,9 @@ void MCAsmStreamer::doFinalizationAtSectionEnd(MCSection *Section) {
26572657

26582658
MCStreamer *llvm::createAsmStreamer(MCContext &Context,
26592659
std::unique_ptr<formatted_raw_ostream> OS,
2660-
bool isVerboseAsm, bool useDwarfDirectory,
26612660
MCInstPrinter *IP,
26622661
std::unique_ptr<MCCodeEmitter> &&CE,
2663-
std::unique_ptr<MCAsmBackend> &&MAB,
2664-
bool ShowInst) {
2662+
std::unique_ptr<MCAsmBackend> &&MAB) {
26652663
return new MCAsmStreamer(Context, std::move(OS), IP, std::move(CE),
26662664
std::move(MAB));
26672665
}

llvm/lib/MC/TargetRegistry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ MCStreamer *Target::createAsmStreamer(MCContext &Ctx,
9494
std::unique_ptr<MCCodeEmitter> CE,
9595
std::unique_ptr<MCAsmBackend> TAB) const {
9696
formatted_raw_ostream &OSRef = *OS;
97-
MCStreamer *S = llvm::createAsmStreamer(Ctx, std::move(OS), false, false, IP,
98-
std::move(CE), std::move(TAB), false);
97+
MCStreamer *S = llvm::createAsmStreamer(Ctx, std::move(OS), IP,
98+
std::move(CE), std::move(TAB));
9999
auto *TO = Ctx.getTargetOptions();
100100
createAsmTargetStreamer(*S, OSRef, IP, TO && TO->AsmVerbose);
101101
return S;

0 commit comments

Comments
 (0)