diff options
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"; |