diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-16 15:22:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-16 15:22:01 +0000 |
commit | 3888bdb0220a95f87802285112cffd2c949e6266 (patch) | |
tree | 7c4dafc9a5d875a6ea5313bfb304c7c2b8664638 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 49516179808549288e6426b7f2f7e1db343062b4 (diff) | |
download | bcm5719-llvm-3888bdb0220a95f87802285112cffd2c949e6266.tar.gz bcm5719-llvm-3888bdb0220a95f87802285112cffd2c949e6266.zip |
Refactor duplicated code. NFC.
llvm-svn: 272901
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 55de31b7488..021c870c624 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -1795,6 +1795,10 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol // node so that legalize doesn't hack it. bool isDirect = false; + + const TargetMachine &TM = getTargetMachine(); + Reloc::Model RM = TM.getRelocationModel(); + bool isARMFunc = false; bool isLocalARMFunc = false; ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); @@ -1802,7 +1806,7 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, if (Subtarget->genLongCalls()) { assert((Subtarget->isTargetWindows() || - getTargetMachine().getRelocationModel() == Reloc::Static) && + RM == Reloc::Static) && "long-calls with non-static relocation model!"); // 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 @@ -1841,8 +1845,6 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, const GlobalValue *GV = G->getGlobal(); isDirect = true; bool isDef = GV->isStrongDefinitionForLinker(); - const TargetMachine &TM = getTargetMachine(); - Reloc::Model RM = TM.getRelocationModel(); const Triple &TargetTriple = TM.getTargetTriple(); bool isStub = !shouldAssumeDSOLocal(RM, TargetTriple, *GV->getParent(), GV) && |