[PATCH] D133662: [Clang] Change -ftime-trace storing path and support multiple compilation jobs

Mészáros Gergely via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 11 02:34:09 PDT 2022


Maetveis created this revision.
Maetveis added a reviewer: clang.
Herald added a project: All.
Maetveis requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

This is an alternative approach for [D131469 <https://reviews.llvm.org/D131469>](https://reviews.llvm.org/D131469].

The difference in behavior compared to D131469 <https://reviews.llvm.org/D131469> is that instead of looking for linking jobs, here if a "main" output is available ('-o <output>' is given) the directory of it is used for '-ftime-trace'.
Another is that time traces in offloading tool-chain (e.g. CUDA or HIP) compilation steps are also supported by saving them to the  same directory as the host trace, with naming similar to '-save-temps'.
If save temps the file type suffix is also included to keep the trace from e.g the front-end compilation overwriting the back-end trace.

The final behavior is this:

- if '-ftime-trace=path/to/trace.json' is given, then use it for the final compilation, and use the directory where it is for the rest (offloading or '-save-temps')
- if '-ftime-trace=path/to/trace/folder' is given:
  - for the main output use 'path/to/trace/folder/<output-name>,json' if '-o <output-name>.o' is given
  - if no output path is specified or for the rest of the files use 'path/to/trace/folder/<input-name>.json' similar to '-save-temps'
- if '-ftime-trace' is given and there is a main output ('-o output') use the directory of it to store the traces
- if '-ftime-trace' but no '-o <output>' use the current working directory


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133662

Files:
  clang/include/clang/Driver/Compilation.h
  clang/include/clang/Driver/Driver.h
  clang/include/clang/Driver/Options.td
  clang/include/clang/Driver/Tool.h
  clang/include/clang/Frontend/FrontendOptions.h
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Clang.h
  clang/tools/driver/cc1_main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133662.459338.patch
Type: text/x-patch
Size: 13206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220911/37697061/attachment-0001.bin>


More information about the cfe-commits mailing list