[llvm] r272904 - Refactor duplicated code. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 16 08:40:24 PDT 2016
Author: rafael
Date: Thu Jun 16 10:40:24 2016
New Revision: 272904
URL: http://llvm.org/viewvc/llvm-project?rev=272904&view=rev
Log:
Refactor duplicated code. NFC.
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=272904&r1=272903&r2=272904&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jun 16 10:40:24 2016
@@ -1798,9 +1798,14 @@ ARMTargetLowering::LowerCall(TargetLower
const TargetMachine &TM = getTargetMachine();
Reloc::Model RM = TM.getRelocationModel();
+ const Triple &TargetTriple = TM.getTargetTriple();
+ const Module *Mod = MF.getFunction()->getParent();
const GlobalValue *GV = nullptr;
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
GV = G->getGlobal();
+ bool isStub =
+ !shouldAssumeDSOLocal(RM, TargetTriple, *Mod, GV) &&
+ Subtarget->isTargetMachO();
bool isARMFunc = false;
bool isLocalARMFunc = false;
@@ -1846,10 +1851,6 @@ ARMTargetLowering::LowerCall(TargetLower
} else if (isa<GlobalAddressSDNode>(Callee)) {
isDirect = true;
bool isDef = GV->isStrongDefinitionForLinker();
- const Triple &TargetTriple = TM.getTargetTriple();
- bool isStub =
- !shouldAssumeDSOLocal(RM, TargetTriple, *GV->getParent(), GV) &&
- Subtarget->isTargetMachO();
isARMFunc = !Subtarget->isThumb() || (isStub && !Subtarget->isMClass());
// ARM call to a local ARM function is predicable.
@@ -1887,8 +1888,6 @@ ARMTargetLowering::LowerCall(TargetLower
}
} else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) {
isDirect = true;
- bool isStub = Subtarget->isTargetMachO() &&
- getTargetMachine().getRelocationModel() != Reloc::Static;
isARMFunc = !Subtarget->isThumb() || (isStub && !Subtarget->isMClass());
// tBX takes a register source operand.
const char *Sym = S->getSymbol();
More information about the llvm-commits
mailing list