Move coveragemap_error enum into coverage namespace and InstrProf.h /NFC
authorXinliang David Li <davidxl@google.com>
Sun, 10 Jan 2016 21:56:33 +0000 (21:56 +0000)
committerXinliang David Li <davidxl@google.com>
Sun, 10 Jan 2016 21:56:33 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257295 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/CoverageMapping.h
include/llvm/ProfileData/InstrProf.h
lib/ProfileData/CoverageMapping.cpp

index ca44442..115f16a 100644 (file)
@@ -482,26 +482,6 @@ 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_
index 2997634..b78f804 100644 (file)
@@ -634,6 +634,22 @@ struct Header {
 
 namespace coverage {
 
+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());
+}
+
+
 // Profile coverage map has the following layout:
 // [CoverageMapFileHeader]
 // [ArrayStart]
@@ -668,6 +684,8 @@ enum CoverageMappingVersion {
 namespace std {
 template <>
 struct is_error_code_enum<llvm::instrprof_error> : std::true_type {};
+template <>
+struct is_error_code_enum<llvm::coverage::coveragemap_error> : std::true_type {};
 }
 
 #endif // LLVM_PROFILEDATA_INSTRPROF_H_
index 55c0fb4..f5d477b 100644 (file)
@@ -517,6 +517,6 @@ class CoverageMappingErrorCategoryType : public std::error_category {
 
 static ManagedStatic<CoverageMappingErrorCategoryType> ErrorCategory;
 
-const std::error_category &llvm::coveragemap_category() {
+const std::error_category &llvm::coverage::coveragemap_category() {
   return *ErrorCategory;
 }