[PATCH] D150282: [Driver] -ftime-trace: derive trace file names from -o and -dumpdir

Scott Linder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 11:19:52 PDT 2023


scott.linder added a comment.

Does GCC have the same `-ftime-trace=` option? It seems like it doesn't, as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92396 is still open?

If so, I am happy with unifying more of the dump/aux handling, and I imagine when/if GCC adds the option it will behave similarly.



================
Comment at: clang/include/clang/Driver/Compilation.h:279
+  void addTimeTraceFile(const char *Name, const JobAction *JA) {
+    TimeTraceFiles[JA] = Name;
+  }
----------------
If this is overriding previous paths should it be called `setTimeTraceFile`?


================
Comment at: clang/lib/Driver/Driver.cpp:5253
+        Path = DumpDir->getValue();
+        Path += llvm::sys::path::filename(BaseInput);
+      } else {
----------------
Why `+=` instead of `append`? Do we just know the value of `dumpdir` is terminated with the path separator?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150282/new/

https://reviews.llvm.org/D150282



More information about the cfe-commits mailing list