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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 15:54:55 PST 2020


rnk added a comment.

Once the error handling is fixed up, I'm not sure this is that much better than what came before, but I could be wrong.



================
Comment at: llvm/lib/Support/TimeProfiler.cpp:296
+  if (EC)
+    report_fatal_error("Could not open " + Path + ": " + EC.message());
+
----------------
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.


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