mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Refactor duplicated code. NFC.
llvm-svn: 272903
This commit is contained in:
parent
29981d067f
commit
40d36c0703
@ -1798,6 +1798,9 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||||||
|
|
||||||
const TargetMachine &TM = getTargetMachine();
|
const TargetMachine &TM = getTargetMachine();
|
||||||
Reloc::Model RM = TM.getRelocationModel();
|
Reloc::Model RM = TM.getRelocationModel();
|
||||||
|
const GlobalValue *GV = nullptr;
|
||||||
|
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
|
||||||
|
GV = G->getGlobal();
|
||||||
|
|
||||||
bool isARMFunc = false;
|
bool isARMFunc = false;
|
||||||
bool isLocalARMFunc = false;
|
bool isLocalARMFunc = false;
|
||||||
@ -1811,8 +1814,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||||||
// Handle a global address or an external symbol. If it's not one of
|
// Handle a global address or an external symbol. If it's not one of
|
||||||
// those, the target's already in a register, so we don't need to do
|
// those, the target's already in a register, so we don't need to do
|
||||||
// anything extra.
|
// anything extra.
|
||||||
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
|
if (isa<GlobalAddressSDNode>(Callee)) {
|
||||||
const GlobalValue *GV = G->getGlobal();
|
|
||||||
// Create a constant pool entry for the callee address
|
// Create a constant pool entry for the callee address
|
||||||
unsigned ARMPCLabelIndex = AFI->createPICLabelUId();
|
unsigned ARMPCLabelIndex = AFI->createPICLabelUId();
|
||||||
ARMConstantPoolValue *CPV =
|
ARMConstantPoolValue *CPV =
|
||||||
@ -1841,8 +1843,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||||||
MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
|
MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
|
||||||
false, false, 0);
|
false, false, 0);
|
||||||
}
|
}
|
||||||
} else if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee)) {
|
} else if (isa<GlobalAddressSDNode>(Callee)) {
|
||||||
const GlobalValue *GV = G->getGlobal();
|
|
||||||
isDirect = true;
|
isDirect = true;
|
||||||
bool isDef = GV->isStrongDefinitionForLinker();
|
bool isDef = GV->isStrongDefinitionForLinker();
|
||||||
const Triple &TargetTriple = TM.getTargetTriple();
|
const Triple &TargetTriple = TM.getTargetTriple();
|
||||||
|
Loading…
Reference in New Issue
Block a user