From: Chris Lattner Date: Thu, 9 Jul 2009 05:19:23 +0000 (+0000) Subject: pc-relative references are *always* to functions, never to globals. ISel X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f2c081fc2a5fc16d1e540d187fabd1f1091b99e5;p=oota-llvm.git pc-relative references are *always* to functions, never to globals. ISel is incapable of lowering direct references to globals like this, zap the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75106 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 72958cb5682..9fe92ade6fa 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -316,29 +316,16 @@ void X86ATTAsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo) { // non-lazily-resolved stubs if (GV->isDeclaration() || GV->isWeakForLinker()) { // Dynamically-resolved functions need a stub for the function. - if (isa(GV)) { - // Function stubs are no longer needed for Mac OS X 10.5 and up. - if (Subtarget->isTargetDarwin() && Subtarget->getDarwinVers() >= 9) { - O << Name; - } else { - FnStubs.insert(Name); - printSuffixedName(Name, "$stub"); - } - assert(MO.getTargetFlags() == 0); - } else if (GV->hasHiddenVisibility()) { - if (!GV->isDeclaration() && !GV->hasCommonLinkage()) - // Definition is not definitely in the current translation unit. - O << Name; - else { - HiddenGVStubs.insert(Name); - printSuffixedName(Name, "$non_lazy_ptr"); - assert(MO.getTargetFlags() == 0); - } + assert(isa(GV)); + + // Function stubs are no longer needed for Mac OS X 10.5 and up. + if (Subtarget->isTargetDarwin() && Subtarget->getDarwinVers() >= 9) { + O << Name; } else { - GVStubs.insert(Name); - printSuffixedName(Name, "$non_lazy_ptr"); - assert(MO.getTargetFlags() == 0); + FnStubs.insert(Name); + printSuffixedName(Name, "$stub"); } + assert(MO.getTargetFlags() == 0); } else { O << Name; }