[PATCH] D131469: [Clang] change default storing path of `-ftime-trace`
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 26 04:02:59 PDT 2022
lebedev.ri added inline comments.
================
Comment at: clang/lib/Driver/Driver.cpp:4531-4548
+ // Get linking executable file's parent path as TracePath's parent path,
+ // default is ".". Filename may be determined and added into TracePath then.
+ //
+ // e.g. executable file's path: /usr/local/a.out
+ // its parent's path: /usr/local
+ for (auto &J : C.getJobs()) {
+ if (J.getSource().getKind() == Action::LinkJobClass) {
----------------
Maetveis wrote:
> Instead of looking for linking jobs, to determine the folder to store the traces, you could use the output location from `-o <output>` (if specified).
> This is already available in `Driver::BuildJobs` as `FinalOutput` (see on line 4605), it will be `nullptr` if no `-o` option was given.
Looks like this was not addressed.
I would suspect, not doing so will break **The** most common use case
of separately compiling sources and then linking them together, does it not?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131469/new/
https://reviews.llvm.org/D131469
More information about the cfe-commits
mailing list