diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 |
commit | 480093f4440d54b30b3025afeac24b48f2ba7a2e (patch) | |
tree | 162e72994062888647caf0d875428db9445491a8 /contrib/llvm-project/llvm/lib/MC/MCSectionXCOFF.cpp | |
parent | 489b1cf2ecf5b9b4a394857987014bfb09067726 (diff) | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) | |
download | src-480093f4440d54b30b3025afeac24b48f2ba7a2e.tar.gz src-480093f4440d54b30b3025afeac24b48f2ba7a2e.zip |
Merge ^/vendor/lvm-project/master up to its last change (upstream commit
e26a78e70), and resolve conflicts.
Notes
Notes:
svn path=/projects/clang1000-import/; revision=357095
Diffstat (limited to 'contrib/llvm-project/llvm/lib/MC/MCSectionXCOFF.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/MC/MCSectionXCOFF.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/contrib/llvm-project/llvm/lib/MC/MCSectionXCOFF.cpp b/contrib/llvm-project/llvm/lib/MC/MCSectionXCOFF.cpp index d52959f15f92..8377e295532a 100644 --- a/contrib/llvm-project/llvm/lib/MC/MCSectionXCOFF.cpp +++ b/contrib/llvm-project/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"; |