[llvm] r273903 - Use isPositionIndependent(). NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 27 11:37:44 PDT 2016
Author: rafael
Date: Mon Jun 27 13:37:44 2016
New Revision: 273903
URL: http://llvm.org/viewvc/llvm-project?rev=273903&view=rev
Log:
Use isPositionIndependent(). NFC.
Modified:
llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=273903&r1=273902&r2=273903&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Mon Jun 27 13:37:44 2016
@@ -183,7 +183,7 @@ void SparcAsmPrinter::LowerGETPCXAndEmit
MCOperand MCRegOP = MCOperand::createReg(MO.getReg());
- if (TM.getRelocationModel() != Reloc::PIC_) {
+ if (!isPositionIndependent()) {
// Just load the address of GOT to MCRegOP.
switch(TM.getCodeModel()) {
default:
Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=273903&r1=273902&r2=273903&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Mon Jun 27 13:37:44 2016
@@ -953,8 +953,7 @@ SparcTargetLowering::LowerCall_32(Target
// If the callee is a GlobalAddress node (quite common, every direct call is)
// turn it into a TargetGlobalAddress node so that legalize doesn't hack it.
// Likewise ExternalSymbol -> TargetExternalSymbol.
- unsigned TF = ((getTargetMachine().getRelocationModel() == Reloc::PIC_)
- ? SparcMCExpr::VK_Sparc_WPLT30 : 0);
+ unsigned TF = isPositionIndependent() ? SparcMCExpr::VK_Sparc_WPLT30 : 0;
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
Callee = DAG.getTargetGlobalAddress(G->getGlobal(), dl, MVT::i32, 0, TF);
else if (ExternalSymbolSDNode *E = dyn_cast<ExternalSymbolSDNode>(Callee))
@@ -1307,8 +1306,7 @@ SparcTargetLowering::LowerCall_64(Target
// Likewise ExternalSymbol -> TargetExternalSymbol.
SDValue Callee = CLI.Callee;
bool hasReturnsTwice = hasReturnsTwiceAttr(DAG, Callee, CLI.CS);
- unsigned TF = ((getTargetMachine().getRelocationModel() == Reloc::PIC_)
- ? SparcMCExpr::VK_Sparc_WPLT30 : 0);
+ unsigned TF = isPositionIndependent() ? SparcMCExpr::VK_Sparc_WPLT30 : 0;
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
Callee = DAG.getTargetGlobalAddress(G->getGlobal(), DL, PtrVT, 0, TF);
else if (ExternalSymbolSDNode *E = dyn_cast<ExternalSymbolSDNode>(Callee))
More information about the llvm-commits
mailing list