When linking a multi-file program with -save-stats=obj, clang will save internal statistics during the link-time code generation to <obj_dir>/xxx.stats where xxx is the first filename of inputs. This behavior is strange. Additionally, naming conflicts will occur when multiple binaries placed in the same directory depend on the same input (e.g., https://github.com/martinus/map_benchmark).
This patch uses the output filename as the base name instead of the first input when -save-stats=obj.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
-save-stats=obj behavior seems strange. I think we should port https://maskray.me/blog/2023-04-25-compiler-output-files to -save-stats and deprecated -save-stats=obj.
Comment Actions
I've added "fix -save-stats=obj" to my todo list for the https://maskray.me/blog/2023-04-25-compiler-output-files work I have been doing.