diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-06-11 01:31:48 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-06-11 01:31:48 +0000 |
commit | c35e7f52ba75fc1456c1e92bc3b17387c6a37a30 (patch) | |
tree | 390435013460a5abc040f3b708e9b749418a5aa2 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 7cbe58d3c59010af02a13448b10abfbe2cc0fc39 (diff) | |
download | bcm5719-llvm-c35e7f52ba75fc1456c1e92bc3b17387c6a37a30.tar.gz bcm5719-llvm-c35e7f52ba75fc1456c1e92bc3b17387c6a37a30.zip |
Revert "Move dllimport name mangling to IR mangler."
This reverts commit r239437.
This broke clang-cl self-hosts. We'd end up calling the __imp_ symbol
directly instead of using it to do an indirect function call.
llvm-svn: 239502
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 28069cea5c0..2cfbc39a05b 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -1751,8 +1751,11 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, } else if (Subtarget->isTargetCOFF()) { assert(Subtarget->isTargetWindows() && "Windows is the only supported COFF target"); + unsigned TargetFlags = GV->hasDLLImportStorageClass() + ? ARMII::MO_DLLIMPORT + : ARMII::MO_NO_FLAG; Callee = DAG.getTargetGlobalAddress(GV, dl, getPointerTy(), /*Offset=*/0, - ARMII::MO_NO_FLAG); + TargetFlags); if (GV->hasDLLImportStorageClass()) Callee = DAG.getLoad(getPointerTy(), dl, DAG.getEntryNode(), DAG.getNode(ARMISD::Wrapper, dl, getPointerTy(), @@ -2643,6 +2646,8 @@ SDValue ARMTargetLowering::LowerGlobalAddressWindows(SDValue Op, "Windows on ARM expects to use movw/movt"); const GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal(); + const ARMII::TOF TargetFlags = + (GV->hasDLLImportStorageClass() ? ARMII::MO_DLLIMPORT : ARMII::MO_NO_FLAG); EVT PtrVT = getPointerTy(); SDValue Result; SDLoc DL(Op); @@ -2653,7 +2658,7 @@ SDValue ARMTargetLowering::LowerGlobalAddressWindows(SDValue Op, // operands, expand this into two nodes. Result = DAG.getNode(ARMISD::Wrapper, DL, PtrVT, DAG.getTargetGlobalAddress(GV, DL, PtrVT, /*Offset=*/0, - ARMII::MO_NO_FLAG)); + TargetFlags)); if (GV->hasDLLImportStorageClass()) Result = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), Result, MachinePointerInfo::getGOT(), false, false, false, 0); |