Move coveragemap_error enum into coverage namespace and InstrProf.h /NFC

llvm-svn: 257295
This commit is contained in:
Xinliang David Li 2016-01-10 21:56:33 +00:00
parent b2b7a3c179
commit 8a5bdb5dce
3 changed files with 19 additions and 21 deletions

View 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_

View 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_

View 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;
}