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
This commit is contained in:
Chris Lattner 2009-07-09 05:19:23 +00:00
parent 1ebd3bfcbd
commit f2c081fc2a

View File

@ -316,29 +316,16 @@ void X86ATTAsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo) {
// non-lazily-resolved stubs // non-lazily-resolved stubs
if (GV->isDeclaration() || GV->isWeakForLinker()) { if (GV->isDeclaration() || GV->isWeakForLinker()) {
// Dynamically-resolved functions need a stub for the function. // Dynamically-resolved functions need a stub for the function.
if (isa<Function>(GV)) { assert(isa<Function>(GV));
// Function stubs are no longer needed for Mac OS X 10.5 and up.
if (Subtarget->isTargetDarwin() && Subtarget->getDarwinVers() >= 9) { // Function stubs are no longer needed for Mac OS X 10.5 and up.
O << Name; if (Subtarget->isTargetDarwin() && Subtarget->getDarwinVers() >= 9) {
} else { O << Name;
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);
}
} else { } else {
GVStubs.insert(Name); FnStubs.insert(Name);
printSuffixedName(Name, "$non_lazy_ptr"); printSuffixedName(Name, "$stub");
assert(MO.getTargetFlags() == 0);
} }
assert(MO.getTargetFlags() == 0);
} else { } else {
O << Name; O << Name;
} }