[X86Subtarget] Use isPositionIndependent(). NFC.
Differential Revision: http://reviews.llvm.org/D21480
llvm-svn: 273071
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 99adf9c..a155070 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -66,7 +66,7 @@
// If this is for a position dependent executable, the static linker can
// figure it out.
- if (TM.getRelocationModel() != Reloc::PIC_)
+ if (!isPositionIndependent())
return X86II::MO_NO_FLAG;
// The COFF dynamic linker just patches the executable sections.
@@ -104,7 +104,7 @@
return X86II::MO_GOTPCREL;
if (isTargetDarwin()) {
- if (RM != Reloc::PIC_)
+ if (!isPositionIndependent())
return X86II::MO_DARWIN_NONLAZY;
return X86II::MO_DARWIN_NONLAZY_PIC_BASE;
}
@@ -334,7 +334,7 @@
} else if (isTargetCOFF()) {
setPICStyle(PICStyles::None);
} else if (isTargetDarwin()) {
- if (TM.getRelocationModel() == Reloc::PIC_)
+ if (isPositionIndependent())
setPICStyle(PICStyles::StubPIC);
else {
assert(TM.getRelocationModel() == Reloc::DynamicNoPIC);