InstrProf: Give coverage its own errors instead of piggy backing on instrprof
[oota-llvm.git] / include / llvm / ProfileData / CoverageMapping.h
index e9d6ea5a492dde7716df4b6d4e1327fd507d0241..94e655c3edcb62d068f9c68dad9767a58ceeaa68 100644 (file)
@@ -484,7 +484,26 @@ template<> struct DenseMapInfo<coverage::CounterExpression> {
   }
 };
 
+const std::error_category &coveragemap_category();
+
+enum class coveragemap_error {
+  success = 0,
+  eof,
+  no_data_found,
+  unsupported_version,
+  truncated,
+  malformed
+};
+
+inline std::error_code make_error_code(coveragemap_error E) {
+  return std::error_code(static_cast<int>(E), coveragemap_category());
+}
 
 } // end namespace llvm
 
+namespace std {
+template <>
+struct is_error_code_enum<llvm::coveragemap_error> : std::true_type {};
+}
+
 #endif // LLVM_PROFILEDATA_COVERAGEMAPPING_H_