[llvm] r193289 - (this is a corrected patch)
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Oct 24 00:09:48 PDT 2013
testcase?
On 23 October 2013 19:37, Yaron Keren <yaron.keren at gmail.com> wrote:
> Author: yrnkrn
> Date: Wed Oct 23 18:37:01 2013
> New Revision: 193289
>
> URL: http://llvm.org/viewvc/llvm-project?rev=193289&view=rev
> Log:
> (this is a corrected patch)
>
> Calling _chkstk is required on ELF as well as COFF on Windows. Without
> _chkstk, functions requiring large stack crash in initialization code.
>
> Previous code tested for COFF format but not Mach-O and this patch modifies
> the code to test for Windows OS (both Windows target and MingW target)
> but not Mach-O object format: Looks like macho environment was used to
> build some EFI code.
>
> Credits to Andrew MacPherson.
>
>
> Modified:
> llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
> llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> llvm/trunk/lib/Target/X86/X86Subtarget.h
>
> Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=193289&r1=193288&r2=193289&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Wed Oct 23 18:37:01 2013
> @@ -606,7 +606,7 @@ void X86FrameLowering::emitPrologue(Mach
> // responsible for adjusting the stack pointer. Touching the stack at 4K
> // increments is necessary to ensure that the guard pages used by the OS
> // virtual memory manager are allocated in correct sequence.
> - if (NumBytes >= 4096 && STI.isTargetCOFF() && !STI.isTargetEnvMacho()) {
> + if (NumBytes >= 4096 && STI.isOSWindows() && !STI.isTargetEnvMacho()) {
> const char *StackProbeSymbol;
> bool isSPUpdateNeeded = false;
>
>
> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=193289&r1=193288&r2=193289&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Oct 23 18:37:01 2013
> @@ -631,7 +631,7 @@ void X86TargetLowering::resetOperationAc
> setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
> setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
>
> - if (Subtarget->isTargetCOFF() && !Subtarget->isTargetEnvMacho())
> + if (Subtarget->isOSWindows() && !Subtarget->isTargetEnvMacho())
> setOperationAction(ISD::DYNAMIC_STACKALLOC, Subtarget->is64Bit() ?
> MVT::i64 : MVT::i32, Custom);
> else if (TM.Options.EnableSegmentedStacks)
>
> Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=193289&r1=193288&r2=193289&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
> +++ llvm/trunk/lib/Target/X86/X86Subtarget.h Wed Oct 23 18:37:01 2013
> @@ -333,6 +333,8 @@ public:
> }
> bool isTargetEnvMacho() const { return TargetTriple.isEnvironmentMachO(); }
>
> + bool isOSWindows() const { return TargetTriple.isOSWindows(); }
> +
> bool isTargetWin64() const {
> return In64BitMode && TargetTriple.isOSWindows();
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list