[llvm] r273071 - [X86Subtarget] Use isPositionIndependent(). NFC.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 17:03:20 PDT 2016
Author: davide
Date: Fri Jun 17 19:03:20 2016
New Revision: 273071
URL: http://llvm.org/viewvc/llvm-project?rev=273071&view=rev
Log:
[X86Subtarget] Use isPositionIndependent(). NFC.
Differential Revision: http://reviews.llvm.org/D21480
Modified:
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.h
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=273071&r1=273070&r2=273071&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Fri Jun 17 19:03:20 2016
@@ -66,7 +66,7 @@ X86Subtarget::classifyLocalReference(con
// 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 @@ unsigned char X86Subtarget::classifyGlob
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 @@ X86Subtarget::X86Subtarget(const Triple
} 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);
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=273071&r1=273070&r2=273071&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Fri Jun 17 19:03:20 2016
@@ -533,6 +533,10 @@ public:
PICStyle == PICStyles::StubPIC;
}
+ bool isPositionIndependent() const {
+ return TM.getRelocationModel() == Reloc::PIC_;
+ }
+
bool isCallingConvWin64(CallingConv::ID CC) const {
switch (CC) {
// On Win64, all these conventions just use the default convention.
More information about the llvm-commits
mailing list