[llvm] 55a1e0c - [MC] getWasmSection: remove unused BeginSymName
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 29 16:50:15 PDT 2024
Author: Fangrui Song
Date: 2024-06-29T16:50:11-07:00
New Revision: 55a1e0c0cd24aff6a23222a5690d1e7ba3686e9c
URL: https://github.com/llvm/llvm-project/commit/55a1e0c0cd24aff6a23222a5690d1e7ba3686e9c
DIFF: https://github.com/llvm/llvm-project/commit/55a1e0c0cd24aff6a23222a5690d1e7ba3686e9c.diff
LOG: [MC] getWasmSection: remove unused BeginSymName
This is cargo culting for Mach-O. See #96810
Added:
Modified:
llvm/include/llvm/MC/MCContext.h
llvm/lib/MC/MCContext.cpp
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h
index 822a062f56d37..73fe6361cb866 100644
--- a/llvm/include/llvm/MC/MCContext.h
+++ b/llvm/include/llvm/MC/MCContext.h
@@ -623,27 +623,16 @@ class MCContext {
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
unsigned Flags = 0) {
- return getWasmSection(Section, K, Flags, nullptr);
- }
-
- MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
- unsigned Flags, const char *BeginSymName) {
- return getWasmSection(Section, K, Flags, "", ~0, BeginSymName);
- }
-
- MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
- unsigned Flags, const Twine &Group,
- unsigned UniqueID) {
- return getWasmSection(Section, K, Flags, Group, UniqueID, nullptr);
+ return getWasmSection(Section, K, Flags, "", ~0);
}
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
unsigned Flags, const Twine &Group,
- unsigned UniqueID, const char *BeginSymName);
+ unsigned UniqueID);
MCSectionWasm *getWasmSection(const Twine &Section, SectionKind K,
unsigned Flags, const MCSymbolWasm *Group,
- unsigned UniqueID, const char *BeginSymName);
+ unsigned UniqueID);
/// Get the section for the provided Section name
MCSectionDXContainer *getDXContainerSection(StringRef Section, SectionKind K);
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 26a6fac927d49..1f23705a6101f 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -745,22 +745,20 @@ MCSectionCOFF *MCContext::getAssociativeCOFFSection(MCSectionCOFF *Sec,
MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind K,
unsigned Flags, const Twine &Group,
- unsigned UniqueID,
- const char *BeginSymName) {
+ unsigned UniqueID) {
MCSymbolWasm *GroupSym = nullptr;
if (!Group.isTriviallyEmpty() && !Group.str().empty()) {
GroupSym = cast<MCSymbolWasm>(getOrCreateSymbol(Group));
GroupSym->setComdat(true);
}
- return getWasmSection(Section, K, Flags, GroupSym, UniqueID, BeginSymName);
+ return getWasmSection(Section, K, Flags, GroupSym, UniqueID);
}
MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind Kind,
unsigned Flags,
const MCSymbolWasm *GroupSym,
- unsigned UniqueID,
- const char *BeginSymName) {
+ unsigned UniqueID) {
StringRef Group = "";
if (GroupSym)
Group = GroupSym->getName();
diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
index 67fa789af4a77..c63740d267819 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
@@ -1106,9 +1106,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
// assembly currently.
if (Group)
WasmSym->setComdat(true);
- auto *WS =
- getContext().getWasmSection(SecName, SectionKind::getText(), 0, Group,
- MCContext::GenericSectionID, nullptr);
+ auto *WS = getContext().getWasmSection(SecName, SectionKind::getText(), 0,
+ Group, MCContext::GenericSectionID);
getStreamer().switchSection(WS);
// Also generate DWARF for this section if requested.
if (getContext().getGenDwarfForAssembly())
More information about the llvm-commits
mailing list