diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-20 23:41:56 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-20 23:41:56 +0000 |
commit | 0d34826218ea5e4834b0b9372da08b1f48e8cc95 (patch) | |
tree | 322f70c3859bfeb56d399504974f9d7001ea368d /llvm/lib/Target/X86/X86Subtarget.cpp | |
parent | a99cd049d0fa4fcf15342e2fdcde2915b2dea15e (diff) | |
download | bcm5719-llvm-0d34826218ea5e4834b0b9372da08b1f48e8cc95.tar.gz bcm5719-llvm-0d34826218ea5e4834b0b9372da08b1f48e8cc95.zip |
Simplify PICStyles.
The main difference is that StubDynamicNoPIC is gone. The
dynamic-no-pic mode as the name implies is simply not pic. It is just
conservative about what it assumes to be dso local.
llvm-svn: 273222
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp index a1550701de5..4eddfacbafd 100644 --- a/llvm/lib/Target/X86/X86Subtarget.cpp +++ b/llvm/lib/Target/X86/X86Subtarget.cpp @@ -325,24 +325,16 @@ X86Subtarget::X86Subtarget(const Triple &TT, StringRef CPU, StringRef FS, TSInfo(), InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this), FrameLowering(*this, getStackAlignment()) { // Determine the PICStyle based on the target selected. - if (TM.getRelocationModel() == Reloc::Static) { - // Unless we're in PIC or DynamicNoPIC mode, set the PIC style to None. + if (!isPositionIndependent()) setPICStyle(PICStyles::None); - } else if (is64Bit()) { - // PIC in 64 bit mode is always rip-rel. + else if (is64Bit()) setPICStyle(PICStyles::RIPRel); - } else if (isTargetCOFF()) { + else if (isTargetCOFF()) setPICStyle(PICStyles::None); - } else if (isTargetDarwin()) { - if (isPositionIndependent()) - setPICStyle(PICStyles::StubPIC); - else { - assert(TM.getRelocationModel() == Reloc::DynamicNoPIC); - setPICStyle(PICStyles::StubDynamicNoPIC); - } - } else if (isTargetELF()) { + else if (isTargetDarwin()) + setPICStyle(PICStyles::StubPIC); + else if (isTargetELF()) setPICStyle(PICStyles::GOT); - } } bool X86Subtarget::enableEarlyIfConversion() const { |