[PATCH] D100509: Support GCC's -fstack-usage flag

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 11 13:14:00 PDT 2021


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5474
+  if (Args.hasArg(options::OPT_fstack_usage)) {
+    CmdArgs.push_back(Args.MakeArgString("-fstack-usage"));
+
----------------
pzheng wrote:
> MaskRay wrote:
> > CC1 needs two options? 
> > 
> > If you infer the filename in the driver, CC1 can use "whether StackUsageOutput is empty".
> Thanks for the suggestion! Addressed this in the latest update.
You can compute the .su filename here and pass `-fstack-usage=....` to CC1.

Then you can remove the boolean codegen option `Opts.StackUsage`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100509/new/

https://reviews.llvm.org/D100509



More information about the cfe-commits mailing list