[PATCH] D19901: [ProfileData] (llvm) Use Error in InstrProf and Coverage

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 09:44:37 PDT 2016


davidxl added inline comments.

================
Comment at: include/llvm/ProfileData/InstrProf.h:278
@@ -282,4 +277,3 @@
 
-inline std::error_code make_error_code(instrprof_error E) {
-  return std::error_code(static_cast<int>(E), instrprof_category());
-}
+class InstrProfError : public ErrorInfo<InstrProfError> {
+public:
----------------
Should it be templatized and share the def with CoverageMapError?

================
Comment at: include/llvm/ProfileData/InstrProf.h:300
@@ +299,3 @@
+
+  static instrprof_error take(Error E) {
+    auto Err = instrprof_error::success;
----------------
Document this interface

================
Comment at: include/llvm/ProfileData/InstrProf.h:309
@@ +308,3 @@
+
+  static void merge(instrprof_error &Acc, Error E) {
+    // Prefer first error encountered as later errors may be secondary effects
----------------
Document this interface.


http://reviews.llvm.org/D19901





More information about the llvm-commits mailing list