summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-09 05:19:23 +0000
committerChris Lattner <sabre@nondot.org>2009-07-09 05:19:23 +0000
commit3e41fec4dfda7d2a4f17621f3cb1f00e4c9a0937 (patch)
tree4f44ef085bb6737e6122b6c63cb008f643706527 /llvm/lib/Target
parent82aa63c9b0caebc2cbaf520eba89511749ee8770 (diff)
downloadbcm5719-llvm-3e41fec4dfda7d2a4f17621f3cb1f00e4c9a0937.tar.gz
bcm5719-llvm-3e41fec4dfda7d2a4f17621f3cb1f00e4c9a0937.zip
pc-relative references are *always* to functions, never to globals. ISel
is incapable of lowering direct references to globals like this, zap the code. llvm-svn: 75106
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 72958cb5682..9fe92ade6fa 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/llvm/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<Function>(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<Function>(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;
}
OpenPOWER on IntegriCloud