diff options
| author | aengelke <engelke@in.tum.de> | 2024-06-20 10:52:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-20 10:52:49 +0200 |
| commit | 46beeaa3940ef8380ee99b9f666cd27b884f63e4 (patch) | |
| tree | 3109f60e7bc264ec8c2d62ca829c14e6ed5b6870 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
| parent | acf675b63f9426e61aac2155e29280f7d21f9421 (diff) | |
[MC] Remove SectionKind from MCSection (#96067)
There are only three actual uses of the section kind in MCSection:
isText(), XCOFF, and WebAssembly. Store isText() in the MCSection, and
store other info in the actual section variants where required.
ELF and COFF flags also encode all relevant information, so for these
two section variants, remove the SectionKind parameter entirely.
This allows to remove the string switch (which is unnecessary and
inaccurate) from createELFSectionImpl. This was introduced in
[D133456](https://reviews.llvm.org/D133456), but apparently, it was
never hit for non-writable sections anyway and the resulting kind was
never used.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 7d3ea9352bd6..dd7d9e5deac2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2998,8 +2998,7 @@ void DwarfDebug::emitDebugARanges() { if (SCU.Sym->isInSection()) { // Make a note of this symbol and it's section. MCSection *Section = &SCU.Sym->getSection(); - if (!Section->getKind().isMetadata()) - SectionMap[Section].push_back(SCU); + SectionMap[Section].push_back(SCU); } else { // Some symbols (e.g. common/bss on mach-o) can have no section but still // appear in the output. This sucks as we rely on sections to build |
