From: Rafael Espindola Date: Wed, 22 Jun 2016 21:56:34 +0000 (+0000) Subject: Extract a few variables to make 'if' smaller. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f8f7105959a8df49263aadf7aea349d22cde4e3;p=llvm Extract a few variables to make 'if' smaller. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273497 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 11e53dc0e79..68d1a679e83 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -4284,13 +4284,14 @@ PrepareCall(SelectionDAG &DAG, SDValue &Callee, SDValue &InFlag, SDValue &Chain, // A call to a TLS address is actually an indirect call to a // thread-specific pointer. unsigned OpFlags = 0; - if ((DAG.getTarget().getRelocationModel() != Reloc::Static && - (Subtarget.getTargetTriple().isMacOSX() && - Subtarget.getTargetTriple().isMacOSXVersionLT(10, 5)) && - !G->getGlobal()->isStrongDefinitionForLinker()) || - (Subtarget.isTargetELF() && !isPPC64 && - !G->getGlobal()->hasLocalLinkage() && - DAG.getTarget().getRelocationModel() == Reloc::PIC_)) { + Reloc::Model RM = DAG.getTarget().getRelocationModel(); + const Triple &TargetTriple = Subtarget.getTargetTriple(); + const GlobalValue *GV = G->getGlobal(); + if ((RM != Reloc::Static && + (TargetTriple.isMacOSX() && TargetTriple.isMacOSXVersionLT(10, 5)) && + !GV->isStrongDefinitionForLinker()) || + (Subtarget.isTargetELF() && !isPPC64 && !GV->hasLocalLinkage() && + RM == Reloc::PIC_)) { // PC-relative references to external symbols should go through $stub, // unless we're building with the leopard linker or later, which // automatically synthesizes these stubs.