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
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 921a0d2..dd1a606 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -523,6 +523,13 @@
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)