diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-23 21:18:59 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-23 21:18:59 +0000 |
| commit | 2d3cce71eeb929efbab95466ba3847ea8e3d09c1 (patch) | |
| tree | 36a5ea4e01cba40f8dcfa79f5d4837b38ead74ed /llvm/lib/Target | |
| parent | d14d05affeb6d04c6ed861f6df12ba0c0c8fe827 (diff) | |
| download | bcm5719-llvm-2d3cce71eeb929efbab95466ba3847ea8e3d09c1.tar.gz bcm5719-llvm-2d3cce71eeb929efbab95466ba3847ea8e3d09c1.zip | |
Uses shouldAssumeDSOLocal.
With that SystemZ knows to avoid a GOT for PIE.
llvm-svn: 273614
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/SystemZ/SystemZSubtarget.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp b/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp index 0b49fcdd8f7..5f947495e32 100644 --- a/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp +++ b/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp @@ -9,6 +9,7 @@ #include "SystemZSubtarget.h" #include "MCTargetDesc/SystemZMCTargetDesc.h" +#include "llvm/CodeGen/Analysis.h" #include "llvm/IR/GlobalValue.h" using namespace llvm; @@ -44,15 +45,6 @@ SystemZSubtarget::SystemZSubtarget(const Triple &TT, const std::string &CPU, InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this), TSInfo(), FrameLowering() {} -// Return true if GV binds locally under reloc model RM. -static bool bindsLocally(const GlobalValue *GV, Reloc::Model RM) { - // For non-PIC, all symbols bind locally. - if (RM == Reloc::Static) - return true; - - return GV->hasLocalLinkage() || !GV->hasDefaultVisibility(); -} - bool SystemZSubtarget::isPC32DBLSymbol(const GlobalValue *GV, Reloc::Model RM, CodeModel::Model CM) const { @@ -63,7 +55,7 @@ bool SystemZSubtarget::isPC32DBLSymbol(const GlobalValue *GV, // For the small model, all locally-binding symbols are in range. if (CM == CodeModel::Small) - return bindsLocally(GV, RM); + return shouldAssumeDSOLocal(RM, TargetTriple, *GV->getParent(), GV); // For Medium and above, assume that the symbol is not within the 4GB range. // Taking the address of locally-defined text would be OK, but that |

