From 547c761dd6578896a80e649d2ca4ec4446ea3e44 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 26 Jan 2010 06:53:37 +0000 Subject: eliminate the TargetLowering::UsesGlobalOffsetTable bool, which is subsumed by TargetLowering::getJumpTableEncoding(). Change uses of it to be more specific. llvm-svn: 94529 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index a91ab22ce1b..42bf35213e3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -481,18 +481,19 @@ void AsmPrinter::EmitJumpTableInfo(MachineFunction &MF) { const std::vector &JT = MJTI->getJumpTables(); if (JT.empty()) return; - bool IsPic = TM.getRelocationModel() == Reloc::PIC_; - // Pick the directive to use to print the jump table entries, and switch to // the appropriate section. const Function *F = MF.getFunction(); bool JTInDiffSection = false; - if (F->isWeakForLinker() || - (IsPic && !TM.getTargetLowering()->usesGlobalOffsetTable())) { - // 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 or function is declared in - // discardable section. + if (// 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. + // FIXME: Need a better predicate for this: what about custom entries? + MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 || + // We should also do if the section name is NULL or function is declared + // in discardable section + // FIXME: this isn't the right predicate, should be based on the MCSection + // for the function. + F->isWeakForLinker()) { OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM)); } else { -- cgit v1.2.3