Skip to content

Commit 4696a87

Browse files
MaskRaylravenclaw
authored andcommitted
[MC] getWasmSection: remove unused BeginSymName
This is cargo culting for Mach-O. See llvm#96810
1 parent 5b57fb4 commit 4696a87

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

llvm/include/llvm/MC/MCContext.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -623,27 +623,16 @@ class MCContext {
623623

624624
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
625625
unsigned Flags = 0) {
626-
return getWasmSection(Section, K, Flags, nullptr);
627-
}
628-
629-
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
630-
unsigned Flags, const char *BeginSymName) {
631-
return getWasmSection(Section, K, Flags, "", ~0, BeginSymName);
632-
}
633-
634-
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
635-
unsigned Flags, const Twine &Group,
636-
unsigned UniqueID) {
637-
return getWasmSection(Section, K, Flags, Group, UniqueID, nullptr);
626+
return getWasmSection(Section, K, Flags, "", ~0);
638627
}
639628

640629
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
641630
unsigned Flags, const Twine &Group,
642-
unsigned UniqueID, const char *BeginSymName);
631+
unsigned UniqueID);
643632

644633
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
645634
unsigned Flags, const MCSymbolWasm *Group,
646-
unsigned UniqueID, const char *BeginSymName);
635+
unsigned UniqueID);
647636

648637
/// Get the section for the provided Section name
649638
MCSectionDXContainer *getDXContainerSection(StringRef Section, SectionKind K);

llvm/lib/MC/MCContext.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -745,22 +745,20 @@ MCSectionCOFF *MCContext::getAssociativeCOFFSection(MCSectionCOFF *Sec,
745745

746746
MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind K,
747747
unsigned Flags, const Twine &Group,
748-
unsigned UniqueID,
749-
const char *BeginSymName) {
748+
unsigned UniqueID) {
750749
MCSymbolWasm *GroupSym = nullptr;
751750
if (!Group.isTriviallyEmpty() && !Group.str().empty()) {
752751
GroupSym = cast<MCSymbolWasm>(getOrCreateSymbol(Group));
753752
GroupSym->setComdat(true);
754753
}
755754

756-
return getWasmSection(Section, K, Flags, GroupSym, UniqueID, BeginSymName);
755+
return getWasmSection(Section, K, Flags, GroupSym, UniqueID);
757756
}
758757

759758
MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind Kind,
760759
unsigned Flags,
761760
const MCSymbolWasm *GroupSym,
762-
unsigned UniqueID,
763-
const char *BeginSymName) {
761+
unsigned UniqueID) {
764762
StringRef Group = "";
765763
if (GroupSym)
766764
Group = GroupSym->getName();

llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
11061106
// assembly currently.
11071107
if (Group)
11081108
WasmSym->setComdat(true);
1109-
auto *WS =
1110-
getContext().getWasmSection(SecName, SectionKind::getText(), 0, Group,
1111-
MCContext::GenericSectionID, nullptr);
1109+
auto *WS = getContext().getWasmSection(SecName, SectionKind::getText(), 0,
1110+
Group, MCContext::GenericSectionID);
11121111
getStreamer().switchSection(WS);
11131112
// Also generate DWARF for this section if requested.
11141113
if (getContext().getGenDwarfForAssembly())

0 commit comments

Comments
 (0)