[clang] [lld] [llvm] [LTO] Make stack usage files work with LTO (PR #178005)

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 27 10:07:11 PST 2026


================
@@ -106,6 +106,11 @@ static cl::opt<std::string>
     LTOStatsFile("lto-stats-file",
                  cl::desc("Save statistics to the specified file"), cl::Hidden);
 
+cl::opt<std::string>
+    LTOStackUsageOutput("lto-stack-usage-output",
----------------
teresajohnson wrote:

That echoes what I was leaning towards as well. In that case the option can be made non-LTO specific and just added to AsmPrinter.cpp (perhaps overriding the field from TargetOptions when specified).

Also, regardless, I don't think there needs to be a field added to the lto::Config, as that has a different member that is the TargetOptions struct, which already contains a field for this info and could be filled in as needed.

I'd love to get to a point where compiler FE options like this could all pass info via the bitcode (e.g. module flags), but we're not there yet. But I don't know that we need dedicated LLD options for this support in the meantime.

https://github.com/llvm/llvm-project/pull/178005


More information about the cfe-commits mailing list