diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:27:16 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 13:27:16 +0000 |
| commit | fe047d241c3964a2a418ead0ecffb06323f34ec1 (patch) | |
| tree | 836dc48741230428b8fc5f62edcd639ace64f6e6 /llvm/lib/CodeGen/AsmPrinter.cpp | |
| parent | 3d3d12f431ef925348fdbfb032aa04cca5894df2 (diff) | |
| download | bcm5719-llvm-fe047d241c3964a2a418ead0ecffb06323f34ec1.tar.gz bcm5719-llvm-fe047d241c3964a2a418ead0ecffb06323f34ec1.zip | |
Switch to new section name handling facility
llvm-svn: 53316
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 6548f56f25d..366b8b398f9 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -293,13 +293,16 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI, // the appropriate section. TargetLowering *LoweringInfo = TM.getTargetLowering(); - const char* JumpTableDataSection = TAI->getJumpTableDataSection(); + const char* JumpTableDataSection = TAI->getJumpTableDataSection(); + const Function *F = MF.getFunction(); + unsigned SectionFlags = TAI->SectionFlagsForGlobal(F); if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) || - !JumpTableDataSection) { + !JumpTableDataSection || + SectionFlags & SectionFlags::Linkonce) { // In PIC mode, we need to emit the jump table to the same section as the // function body itself, otherwise the label differences won't make sense. - // We should also do if the section name is NULL. - const Function *F = MF.getFunction(); + // We should also do if the section name is NULL or function is declared in + // discardable section. SwitchToTextSection(getSectionForFunction(*F).c_str(), F); } else { SwitchToDataSection(JumpTableDataSection); |

