[all-commits] [llvm/llvm-project] 38941d: [Clang] change default storing path of `-ftime-trace`

dongjunduo via All-commits all-commits at lists.llvm.org
Fri Sep 2 18:50:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 38941da066a7b785ba4771710189172e94e37824
      https://github.com/llvm/llvm-project/commit/38941da066a7b785ba4771710189172e94e37824
  Author: Junduo Dong <andj4cn at gmail.com>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/test/Driver/check-time-trace.cpp
    M clang/tools/driver/cc1_main.cpp

  Log Message:
  -----------
  [Clang] change default storing path of `-ftime-trace`

1. This implementation change the default storing behavior of -ftime-trace only.

That is, if the compiling job contains the linking action, the executable file' s directory may be seem as the main work directory.
Thus the time trace files would be stored in the same directory of linking result.

By this approach, the user can easily get the time-trace files in the main work directory. The improved demo results:

```
$ clang++ -ftime-trace -o main.out /demo/main.cpp
$ ls .
main.out   main-[random-string].json
```

2. In addition, the main codes of time-trace files' path inference have been refactored.

* The <path> of -ftime-trace=<path> is infered in clang driver
* After that, -ftime-trace=<path> can be added into clang's options

By this approach, the dirty work of path processing and judging can be implemented in driver layer, so that the clang may focus on its main work.

 #   $ clang -ftime-trace -o xxx.out xxx.cpp

Differential Revision: https://reviews.llvm.org/D131469




More information about the All-commits mailing list