[PATCH] D74514: Refactor TimeProfiler write methods (NFC)

Andrew Monshizadeh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 18:55:37 PST 2020


amonshiz planned changes to this revision.
amonshiz marked an inline comment as done.
amonshiz added a comment.

> I'm not sure this is that much better than what came before, but I could be wrong.

The benefit of this change is that in the next diff in this stack I add additional usage of the `TimeTraceScope` to LLVM passes/pass managers. In doing so there is another need to essentially flush the trace info to a file and also validate the file name provided. It made sense to move handling whether or not a user provided a file name to a consistent place.



================
Comment at: llvm/lib/Support/TimeProfiler.cpp:296
+  if (EC)
+    report_fatal_error("Could not open " + Path + ": " + EC.message());
+
----------------
rnk wrote:
> Maybe passing the error back to the caller (as the Error type, perhaps?) would be better. LLD would hook it into its diagnostic machinery and clang to its own. Otherwise, the user can supply an unwritable path which will cause clang/lld to print a banner asking them to file a bug report, which is incorrect, it's a usage bug, not a compiler bug.
Will do! Sounds like a good improvement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74514





More information about the llvm-commits mailing list