[clang] [LinkerWrapper] Fix -fsave-optimization-record default file (PR #149003)

Joel E. Denny via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 17 18:49:59 PDT 2025


================
@@ -5895,6 +5895,11 @@ def o : JoinedOrSeparate<["-"], "o">,
   Visibility<[ClangOption, CC1Option, CC1AsOption, FC1Option, FlangOption]>,
   HelpText<"Write output to <file>">, MetaVarName<"<file>">,
   MarshallingInfoString<FrontendOpts<"OutputFile">>;
+def foutput_file_base : Joined<["-"], "foutput-file-base=">,
----------------
jdenny-ornl wrote:

For 2, I later discovered that unused warnings don't happen for -dumpdir in this case anyway due to another use of it.

For 1, I had misunderstood the behavior of -dumpdir: it replaces the output file name too, not just its directory.  So, I've replaced my -foutput-file-base with -dumpdir.

I ran into a potential issue: The clang driver passes -dumpdir to various clang frontend calls.  For LTO, that was previously being ignored, and now it's not.  That changes some auxiliary file names, as revealed by changes in some existing tests' expected output: `clang/test/Driver/opt-record.c` and `clang/test/Driver/lto-dwo.c`.  Are there backward compatibility concerns here?



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


More information about the cfe-commits mailing list