1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[X86Subtarget] Use isPositionIndependent(). NFC.

Differential Revision:  http://reviews.llvm.org/D21480

llvm-svn: 273071
This commit is contained in:
Davide Italiano 2016-06-18 00:03:20 +00:00
parent b3e867c3ad
commit c737806859
2 changed files with 7 additions and 3 deletions

View File

@ -66,7 +66,7 @@ X86Subtarget::classifyLocalReference(const GlobalValue *GV) const {
// 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::classifyGlobalReference(const GlobalValue *GV,
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 &TT, StringRef CPU, StringRef FS,
} 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);

View File

@ -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.