diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-03-04 18:25:41 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-03-04 18:25:41 +0000 |
commit | 1d6bb9f4171028bd0eb3dfcb59f42b28c279d4be (patch) | |
tree | bd5f9425e10e6616a37eac0815b3566ba1132430 /lib/Target/AArch64/AArch64AsmPrinter.cpp | |
parent | bd7f07563c83e00dae23ea41c0fc4f95995e50cb (diff) | |
download | src-vendor/llvm/llvm-release_80-r355313.tar.gz src-vendor/llvm/llvm-release_80-r355313.zip |
Vendor import of llvm release_80 branch r355313:vendor/llvm/llvm-release_80-r355313
Diffstat (limited to 'lib/Target/AArch64/AArch64AsmPrinter.cpp')
-rw-r--r-- | lib/Target/AArch64/AArch64AsmPrinter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Target/AArch64/AArch64AsmPrinter.cpp b/lib/Target/AArch64/AArch64AsmPrinter.cpp index 0254a572434f..2e1d1f1130a9 100644 --- a/lib/Target/AArch64/AArch64AsmPrinter.cpp +++ b/lib/Target/AArch64/AArch64AsmPrinter.cpp @@ -471,9 +471,18 @@ void AArch64AsmPrinter::EmitJumpTableInfo() { const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables(); if (JT.empty()) return; + const Function &F = MF->getFunction(); const TargetLoweringObjectFile &TLOF = getObjFileLowering(); - MCSection *ReadOnlySec = TLOF.getSectionForJumpTable(MF->getFunction(), TM); - OutStreamer->SwitchSection(ReadOnlySec); + bool JTInDiffSection = + !STI->isTargetCOFF() || + !TLOF.shouldPutJumpTableInFunctionSection( + MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32, + F); + if (JTInDiffSection) { + // Drop it in the readonly section. + MCSection *ReadOnlySec = TLOF.getSectionForJumpTable(F, TM); + OutStreamer->SwitchSection(ReadOnlySec); + } auto AFI = MF->getInfo<AArch64FunctionInfo>(); for (unsigned JTI = 0, e = JT.size(); JTI != e; ++JTI) { |