From 66a4a1fe878a45e50dc5ddcea7290f899b620057 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Sun, 10 Jan 2016 21:56:33 +0000 Subject: [PATCH] Move coveragemap_error enum into coverage namespace and InstrProf.h /NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257295 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/CoverageMapping.h | 20 -------------------- include/llvm/ProfileData/InstrProf.h | 18 ++++++++++++++++++ lib/ProfileData/CoverageMapping.cpp | 2 +- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/include/llvm/ProfileData/CoverageMapping.h b/include/llvm/ProfileData/CoverageMapping.h index ca44442001b..115f16addbf 100644 --- a/include/llvm/ProfileData/CoverageMapping.h +++ b/include/llvm/ProfileData/CoverageMapping.h @@ -482,26 +482,6 @@ template<> struct DenseMapInfo { } }; -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(E), coveragemap_category()); -} - } // end namespace llvm -namespace std { -template <> -struct is_error_code_enum : std::true_type {}; -} - #endif // LLVM_PROFILEDATA_COVERAGEMAPPING_H_ diff --git a/include/llvm/ProfileData/InstrProf.h b/include/llvm/ProfileData/InstrProf.h index 29976342900..b78f8041a6b 100644 --- a/include/llvm/ProfileData/InstrProf.h +++ b/include/llvm/ProfileData/InstrProf.h @@ -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(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 : std::true_type {}; +template <> +struct is_error_code_enum : std::true_type {}; } #endif // LLVM_PROFILEDATA_INSTRPROF_H_ diff --git a/lib/ProfileData/CoverageMapping.cpp b/lib/ProfileData/CoverageMapping.cpp index 55c0fb4792e..f5d477bd139 100644 --- a/lib/ProfileData/CoverageMapping.cpp +++ b/lib/ProfileData/CoverageMapping.cpp @@ -517,6 +517,6 @@ class CoverageMappingErrorCategoryType : public std::error_category { static ManagedStatic ErrorCategory; -const std::error_category &llvm::coveragemap_category() { +const std::error_category &llvm::coverage::coveragemap_category() { return *ErrorCategory; } -- 2.34.1