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/MC/MCSection.cpp | |
parent | acf675b63f9426e61aac2155e29280f7d21f9421 (diff) | |
download | llvm-46beeaa3940ef8380ee99b9f666cd27b884f63e4.zip llvm-46beeaa3940ef8380ee99b9f666cd27b884f63e4.tar.gz llvm-46beeaa3940ef8380ee99b9f666cd27b884f63e4.tar.bz2 |
[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/MC/MCSection.cpp')
-rw-r--r-- | llvm/lib/MC/MCSection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp index 3a7a8a0..85f6492 100644 --- a/llvm/lib/MC/MCSection.cpp +++ b/llvm/lib/MC/MCSection.cpp @@ -20,11 +20,11 @@ using namespace llvm; -MCSection::MCSection(SectionVariant V, StringRef Name, SectionKind K, +MCSection::MCSection(SectionVariant V, StringRef Name, bool IsText, MCSymbol *Begin) : Begin(Begin), BundleGroupBeforeFirstInst(false), HasInstructions(false), - HasLayout(false), IsRegistered(false), DummyFragment(this), Name(Name), - Variant(V), Kind(K) { + HasLayout(false), IsRegistered(false), IsText(IsText), + DummyFragment(this), Name(Name), Variant(V) { // The initial subsection number is 0. Create a fragment list. CurFragList = &Subsections.emplace_back(0u, FragList{}).second; } |