diff options
| author | Martin Storsjo <martin@martin.st> | 2018-01-24 06:40:11 +0000 | 
|---|---|---|
| committer | Martin Storsjo <martin@martin.st> | 2018-01-24 06:40:11 +0000 | 
| commit | 4ed94a06ac0a4677501e4ac8e06e932dbb336876 (patch) | |
| tree | 1c1486f3da25703844a6ed131f4b37b35451a7e2 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
| parent | e8248f2e106e8a9ab3ddcce637a15e811300cc7a (diff) | |
| download | bcm5719-llvm-4ed94a06ac0a4677501e4ac8e06e932dbb336876.tar.gz bcm5719-llvm-4ed94a06ac0a4677501e4ac8e06e932dbb336876.zip | |
[ARM] Call __chkstk for dynamic stack allocation in all windows environments
This matches what MSVC does for alloca() function calls on ARM.
Even if MSVC doesn't support VLAs at the language level, it does
support the alloca function.
On the clang level, both the _alloca() (when emulating MSVC, which is
what the alloca() function expands to) and __builtin_alloca() builtin
functions, and VLAs, map to the same LLVM IR "alloca" function - so
within LLVM they're not distinguishable from each other.
Differential Revision: https://reviews.llvm.org/D42292
llvm-svn: 323308
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 47c4712aad6..5db23ea5ff8 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -949,7 +949,7 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,    setOperationAction(ISD::STACKSAVE,          MVT::Other, Expand);    setOperationAction(ISD::STACKRESTORE,       MVT::Other, Expand); -  if (Subtarget->getTargetTriple().isWindowsItaniumEnvironment()) +  if (Subtarget->isTargetWindows())      setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom);    else      setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Expand); @@ -7956,7 +7956,7 @@ SDValue ARMTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {    case ISD::SDIVREM:    case ISD::UDIVREM:       return LowerDivRem(Op, DAG);    case ISD::DYNAMIC_STACKALLOC: -    if (Subtarget->getTargetTriple().isWindowsItaniumEnvironment()) +    if (Subtarget->isTargetWindows())        return LowerDYNAMIC_STACKALLOC(Op, DAG);      llvm_unreachable("Don't know how to custom lower this!");    case ISD::FP_ROUND: return LowerFP_ROUND(Op, DAG); | 

