[MC] Remove unused NoExecStack parameter from MCStreamer::initSections. NFC (#188184)

Unused after commit 34bc5d580b73c0ca79653bb03e5c50419be2c634
This commit is contained in:
Fangrui Song 2026-03-24 00:42:09 -07:00 committed by GitHub
parent 1a5e52168c
commit d1b9b4c548
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 19 additions and 20 deletions

View File

@ -2628,7 +2628,7 @@ BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
*TheTriple, *LocalCtx, std::unique_ptr<MCAsmBackend>(MAB), std::move(OW),
std::unique_ptr<MCCodeEmitter>(MCEInstance.MCE.release()), *STI));
Streamer->initSections(false, *STI);
Streamer->initSections(*STI);
MCSection *Section = MCEInstance.LocalMOFI->getTextSection();
Section->setHasInstructions(true);

View File

@ -194,7 +194,7 @@ private:
} // anonymous namespace
void BinaryEmitter::emitAll(StringRef OrgSecPrefix) {
Streamer.initSections(false, *BC.STI);
Streamer.initSections(*BC.STI);
Streamer.setUseAssemblerInfoForParsing(false);
if (opts::UpdateDebugSections && BC.isELF()) {

View File

@ -142,7 +142,7 @@ void dumpFunction(const BinaryFunction &BF) {
std::unique_ptr<MCStreamer> AsmStreamer(createAsmStreamer(
*LocalCtx, std::move(FOut), std::move(InstructionPrinter),
std::move(MCEInstance.MCE), std::move(MAB)));
AsmStreamer->initSections(true, *BC.STI);
AsmStreamer->initSections(*BC.STI);
std::unique_ptr<TargetMachine> TM(BC.TheTarget->createTargetMachine(
*BC.TheTriple, "", "", TargetOptions(), std::nullopt));
std::unique_ptr<AsmPrinter> MAP(

View File

@ -47,7 +47,7 @@ public:
/// \name MCStreamer Interface
/// @{
void initSections(bool NoExecStack, const MCSubtargetInfo &STI) override;
void initSections(const MCSubtargetInfo &STI) override;
void changeSection(MCSection *Section, uint32_t Subsection = 0) override;
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment &F,

View File

@ -468,7 +468,7 @@ public:
void switchSectionNoPrint(MCSection *Section);
/// Create the default sections and set the initial one.
virtual void initSections(bool NoExecStack, const MCSubtargetInfo &STI);
virtual void initSections(const MCSubtargetInfo &STI);
MCSymbol *endSection(MCSection *Section);

View File

@ -42,7 +42,7 @@ public:
/// \name MCStreamer interface
/// \{
void initSections(bool NoExecStack, const MCSubtargetInfo &STI) override;
void initSections(const MCSubtargetInfo &STI) override;
void changeSection(MCSection *Section, uint32_t Subsection = 0) override;
void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;

View File

@ -556,7 +556,7 @@ bool AsmPrinter::doInitialization(Module &M) {
// information (such as the embedded command line) to be associated
// with all sections in the object file rather than a single section.
if (!Target.isOSBinFormatXCOFF())
OutStreamer->initSections(false, *TM.getMCSubtargetInfo());
OutStreamer->initSections(*TM.getMCSubtargetInfo());
// Emit the version-min deployment target directive if needed.
//

View File

@ -49,7 +49,7 @@ ELFObjectWriter &MCELFStreamer::getWriter() {
return static_cast<ELFObjectWriter &>(getAssembler().getWriter());
}
void MCELFStreamer::initSections(bool, const MCSubtargetInfo &STI) {
void MCELFStreamer::initSections(const MCSubtargetInfo &STI) {
MCContext &Ctx = getContext();
switchSection(Ctx.getObjectFileInfo()->getTextSection());
emitCodeAlignment(Align(Ctx.getObjectFileInfo()->getTextSectionAlignment()),

View File

@ -942,7 +942,7 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
// Create the initial section, if requested.
if (!NoInitialTextSection)
Out.initSections(false, getTargetParser().getSTI());
Out.initSections(getTargetParser().getSTI());
// Prime the lexer.
Lex();
@ -1056,7 +1056,7 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
bool AsmParser::checkForValidSection() {
if (!ParsingMSInlineAsm && !getStreamer().getCurrentFragment()) {
Out.initSections(false, getTargetParser().getSTI());
Out.initSections(getTargetParser().getSTI());
return Error(getTok().getLoc(),
"expected section directive before assembly directive");
}

View File

@ -1203,7 +1203,7 @@ const AsmToken MasmParser::peekTok(bool ShouldSkipSpace) {
bool MasmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
// Create the initial section, if requested.
if (!NoInitialTextSection)
Out.initSections(false, getTargetParser().getSTI());
Out.initSections(getTargetParser().getSTI());
// Prime the lexer.
Lex();
@ -1273,7 +1273,7 @@ bool MasmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
bool MasmParser::checkForValidSection() {
if (!ParsingMSInlineAsm && !(getStreamer().getCurrentFragment() &&
getStreamer().getCurrentSectionOnly())) {
Out.initSections(false, getTargetParser().getSTI());
Out.initSections(getTargetParser().getSTI());
return Error(getTok().getLoc(),
"expected section directive before assembly directive");
}

View File

@ -386,7 +386,7 @@ void MCStreamer::emitEHSymAttributes(const MCSymbol *Symbol,
MCSymbol *EHSymbol) {
}
void MCStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) {
void MCStreamer::initSections(const MCSubtargetInfo &STI) {
switchSectionNoPrint(getContext().getObjectFileInfo()->getTextSection());
}

View File

@ -134,8 +134,7 @@ WinCOFFObjectWriter &MCWinCOFFStreamer::getWriter() {
return static_cast<WinCOFFObjectWriter &>(getAssembler().getWriter());
}
void MCWinCOFFStreamer::initSections(bool NoExecStack,
const MCSubtargetInfo &STI) {
void MCWinCOFFStreamer::initSections(const MCSubtargetInfo &STI) {
// FIXME: this is identical to the ELF one.
// This emulates the same behavior of GNU as. This makes it easier
// to compare the output as the major sections are in the same order.

View File

@ -12322,7 +12322,7 @@ bool ARMAsmParser::parseDirectiveEven(SMLoc L) {
return true;
if (!Section) {
getStreamer().initSections(false, getSTI());
getStreamer().initSections(getSTI());
Section = getStreamer().getCurrentSectionOnly();
}

View File

@ -4877,7 +4877,7 @@ bool X86AsmParser::parseDirectiveEven(SMLoc L) {
const MCSection *Section = getStreamer().getCurrentSectionOnly();
if (!Section) {
getStreamer().initSections(false, getSTI());
getStreamer().initSections(getSTI());
Section = getStreamer().getCurrentSectionOnly();
}
if (getContext().getAsmInfo()->useCodeAlign(*Section))

View File

@ -153,7 +153,7 @@ int Disassembler::disassemble(const Target &T, const std::string &TripleName,
}
// Set up initial section manually here
Streamer.initSections(false, STI);
Streamer.initSections(STI);
bool ErrorOccurred = false;

View File

@ -132,7 +132,7 @@ SmallString<0> DWARFExpressionCopyBytesTest::emitObjFile(StringRef ExprBytes) {
SmallString<0> Storage;
raw_svector_ostream VecOS(Storage);
StreamerContext C = createStreamer(VecOS);
C.Streamer->initSections(false, *STI);
C.Streamer->initSections(*STI);
MCSection *Section = C.MOFI->getTextSection();
Section->setHasInstructions(true);
C.Streamer->switchSection(Section);

View File

@ -93,7 +93,7 @@ public:
MCStreamer *TheStreamer = C.Streamer.get();
MCAssembler &Assembler =
static_cast<MCObjectStreamer *>(TheStreamer)->getAssembler();
TheStreamer->initSections(false, *STI);
TheStreamer->initSections(*STI);
// Create a mock function
MCSection *Section = C.MOFI->getTextSection();