aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-07-09 13:27:16 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-07-09 13:27:16 +0000
commite87f52d722d4184becb2ecaf4500dd01d176bfc2 (patch)
tree00280a62a740941a48da223a1e74266c34877805 /lib/CodeGen/AsmPrinter.cpp
parent7e7fc82cf3adfab1af673ebef4a671238f9c9bbb (diff)
Switch to new section name handling facility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 6548f56f25..366b8b398f 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/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);