From: Xinliang David Li Date: Mon, 11 Jan 2016 03:54:18 +0000 (+0000) Subject: Move all decls in coverage namespace into CoverageMapping.h/NFC X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=189e8f0b8a884b2546816635f7b1c66c5d958ab9 Move all decls in coverage namespace into CoverageMapping.h/NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257311 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ProfileData/CoverageMapping.h b/include/llvm/ProfileData/CoverageMapping.h index 115f16addbf..2386442d28b 100644 --- a/include/llvm/ProfileData/CoverageMapping.h +++ b/include/llvm/ProfileData/CoverageMapping.h @@ -20,6 +20,7 @@ #include "llvm/ADT/Hashing.h" #include "llvm/ADT/Triple.h" #include "llvm/ADT/iterator.h" +#include "llvm/ProfileData/InstrProfData.inc" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/raw_ostream.h" @@ -452,6 +453,50 @@ public: CoverageData getCoverageForExpansion(const ExpansionRecord &Expansion); }; +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] +// [CovMapFunctionRecord] +// [CovMapFunctionRecord] +// ... +// [ArrayEnd] +// [Encoded Region Mapping Data] +LLVM_PACKED_START +template struct CovMapFunctionRecord { + #define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name; + #include "llvm/ProfileData/InstrProfData.inc" +}; +// Per module coverage mapping data header, i.e. CoverageMapFileHeader +// documented above. +struct CovMapHeader { +#define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name; +#include "llvm/ProfileData/InstrProfData.inc" +}; + +LLVM_PACKED_END + +enum CoverageMappingVersion { + CoverageMappingVersion1 = 0, + // The current versin is Version1 + CoverageMappingCurrentVersion = INSTR_PROF_COVMAP_VERSION +}; + } // end namespace coverage /// \brief Provide DenseMapInfo for CounterExpression @@ -484,4 +529,10 @@ template<> struct DenseMapInfo { } // 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 b78f8041a6b..c84d8d24f20 100644 --- a/include/llvm/ProfileData/InstrProf.h +++ b/include/llvm/ProfileData/InstrProf.h @@ -632,60 +632,11 @@ struct Header { } // end namespace RawInstrProf -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] -// [CovMapFunctionRecord] -// [CovMapFunctionRecord] -// ... -// [ArrayEnd] -// [Encoded Region Mapping Data] -LLVM_PACKED_START -template struct CovMapFunctionRecord { - #define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name; - #include "llvm/ProfileData/InstrProfData.inc" -}; -// Per module coverage mapping data header, i.e. CoverageMapFileHeader -// documented above. -struct CovMapHeader { -#define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name; -#include "llvm/ProfileData/InstrProfData.inc" -}; - -LLVM_PACKED_END - -enum CoverageMappingVersion { - CoverageMappingVersion1 = 0, - // The current versin is Version1 - CoverageMappingCurrentVersion = INSTR_PROF_COVMAP_VERSION -}; -} - } // end namespace llvm 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_