diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /llvm/lib/MC/MCSectionXCOFF.cpp | |
parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) |
Notes
Diffstat (limited to 'llvm/lib/MC/MCSectionXCOFF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSectionXCOFF.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/llvm/lib/MC/MCSectionXCOFF.cpp b/llvm/lib/MC/MCSectionXCOFF.cpp index d52959f15f92..8377e295532a 100644 --- a/llvm/lib/MC/MCSectionXCOFF.cpp +++ b/llvm/lib/MC/MCSectionXCOFF.cpp @@ -15,18 +15,6 @@ using namespace llvm; MCSectionXCOFF::~MCSectionXCOFF() = default; -static StringRef getMappingClassString(XCOFF::StorageMappingClass SMC) { - switch (SMC) { - case XCOFF::XMC_DS: - return "DS"; - case XCOFF::XMC_RW: - return "RW"; - case XCOFF::XMC_PR: - return "PR"; - default: - report_fatal_error("Unhandled storage-mapping class."); - } -} void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, raw_ostream &OS, @@ -35,9 +23,14 @@ void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, if (getMappingClass() != XCOFF::XMC_PR) report_fatal_error("Unhandled storage-mapping class for .text csect"); - OS << "\t.csect " << getSectionName() << "[" - << getMappingClassString(getMappingClass()) - << "]" << '\n'; + OS << "\t.csect " << QualName->getName() << '\n'; + return; + } + + if (getKind().isReadOnly()) { + if (getMappingClass() != XCOFF::XMC_RO) + report_fatal_error("Unhandled storage-mapping class for .rodata csect."); + OS << "\t.csect " << QualName->getName() << '\n'; return; } @@ -45,8 +38,9 @@ void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, switch (getMappingClass()) { case XCOFF::XMC_RW: case XCOFF::XMC_DS: - OS << "\t.csect " << getSectionName() << "[" - << getMappingClassString(getMappingClass()) << "]" << '\n'; + OS << "\t.csect " << QualName->getName() << '\n'; + break; + case XCOFF::XMC_TC: break; case XCOFF::XMC_TC0: OS << "\t.toc\n"; |