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 ca44442001b4aafd9923544b73d73ddbe593bf3e..115f16addbf6c64ef75e29c447d8f9e93c6133a8 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 299763429006566cf2c651c4ae121146fa915a2c..b78f8041a6b96098255b74de7bb02ac73edbac12 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 55c0fb4792ef7c1feb224d76bf6ee5bd82eb4073..f5d477bd139aa5954209be21a8b04dc69e35d66a 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;
 }