[PATCH] D43108: Support for the mno-stack-arg-probe flag

Ruslan Nikolaev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 21:37:22 PST 2018


nruslan added inline comments.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:4038
+  if (Args.hasArg(options::OPT_mno_stack_arg_probe))
+    CmdArgs.push_back("-mno-stack-arg-probe");
+
----------------
hans wrote:
> I think you can just do
> 
> ```
> Args.AddLastArg(CmdArgs, options::OPT_mno_stack_arg_probe)
> ```
> 
> which avoids the if-statement and having to spell out the flag.
I added mstack_arg_probe also, and this check now contains two options. I am not sure how AddLastArg behaves in this case (especially because only one attribute needs to be defined: mno-stack-arg-probe, and a positive case is the default). I found some other examples similar to this one, and they used hasArg with two options.


https://reviews.llvm.org/D43108





More information about the cfe-commits mailing list