Implement command line options for stack probe space

This code adds the -mstack-probe-size command line option and implements the /Gs
compiler switch for clang-cl.

This should fix http://llvm.org/bugs/show_bug.cgi?id=21896

Patch by Andrew H!

Differential Revision: http://reviews.llvm.org/D6685

llvm-svn: 226601
This commit is contained in:
Hans Wennborg
2015-01-20 19:45:50 +00:00
parent 6b77455f81
commit 77dc236605
7 changed files with 62 additions and 2 deletions

View File

@@ -523,6 +523,13 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.StackAlignment = StackAlignment;
}
if (Arg *A = Args.getLastArg(OPT_mstack_probe_size)) {
StringRef Val = A->getValue();
unsigned StackProbeSize = Opts.StackProbeSize;
Val.getAsInteger(0, StackProbeSize);
Opts.StackProbeSize = StackProbeSize;
}
if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
StringRef Name = A->getValue();
unsigned Method = llvm::StringSwitch<unsigned>(Name)