Skip to content

Commit

Permalink
[MC] Remove unneeded setBeginSymbol. NFC
Browse files Browse the repository at this point in the history
getELFSection ensures that the section symbol exists.
  • Loading branch information
MaskRay committed Jun 24, 2024
1 parent a3cf14a commit 905c58f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions llvm/lib/MC/MCParser/ELFAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,16 +716,8 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) {
(Section->getFlags() & ELF::SHF_ALLOC) &&
(Section->getFlags() & ELF::SHF_EXECINSTR)) {
bool InsertResult = getContext().addGenDwarfSection(Section);
if (InsertResult) {
if (getContext().getDwarfVersion() <= 2)
Warning(loc, "DWARF2 only supports one section per compilation unit");

if (!Section->getBeginSymbol()) {
MCSymbol *SectionStartSymbol = getContext().createTempSymbol();
getStreamer().emitLabel(SectionStartSymbol);
Section->setBeginSymbol(SectionStartSymbol);
}
}
if (InsertResult && getContext().getDwarfVersion() <= 2)
Warning(loc, "DWARF2 only supports one section per compilation unit");
}

return false;
Expand Down

0 comments on commit 905c58f

Please sign in to comment.