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

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


  Branch: refs/heads/time-trace-bug
  Home:   https://github.com/llvm/llvm-project
  Commit: fa4506573a7f8ebc3baefce4cb83d50ad5df1109
      https://github.com/llvm/llvm-project/commit/fa4506573a7f8ebc3baefce4cb83d50ad5df1109
  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