[llvm] r257311 - Move all decls in coverage namespace into CoverageMapping.h/NFC
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 10 19:54:19 PST 2016
Author: davidxl
Date: Sun Jan 10 21:54:18 2016
New Revision: 257311
URL: http://llvm.org/viewvc/llvm-project?rev=257311&view=rev
Log:
Move all decls in coverage namespace into CoverageMapping.h/NFC
Modified:
llvm/trunk/include/llvm/ProfileData/CoverageMapping.h
llvm/trunk/include/llvm/ProfileData/InstrProf.h
Modified: llvm/trunk/include/llvm/ProfileData/CoverageMapping.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/CoverageMapping.h?rev=257311&r1=257310&r2=257311&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/CoverageMapping.h (original)
+++ llvm/trunk/include/llvm/ProfileData/CoverageMapping.h Sun Jan 10 21:54:18 2016
@@ -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<int>(E), coveragemap_category());
+}
+
+
+// Profile coverage map has the following layout:
+// [CoverageMapFileHeader]
+// [ArrayStart]
+// [CovMapFunctionRecord]
+// [CovMapFunctionRecord]
+// ...
+// [ArrayEnd]
+// [Encoded Region Mapping Data]
+LLVM_PACKED_START
+template <class IntPtrT> 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<coverage:
} // end namespace llvm
+namespace std {
+template <>
+struct is_error_code_enum<llvm::coverage::coveragemap_error> : std::true_type {};
+}
+
+
#endif // LLVM_PROFILEDATA_COVERAGEMAPPING_H_
Modified: llvm/trunk/include/llvm/ProfileData/InstrProf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=257311&r1=257310&r2=257311&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProf.h (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProf.h Sun Jan 10 21:54:18 2016
@@ -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<int>(E), coveragemap_category());
-}
-
-
-// Profile coverage map has the following layout:
-// [CoverageMapFileHeader]
-// [ArrayStart]
-// [CovMapFunctionRecord]
-// [CovMapFunctionRecord]
-// ...
-// [ArrayEnd]
-// [Encoded Region Mapping Data]
-LLVM_PACKED_START
-template <class IntPtrT> 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<llvm::instrprof_error> : std::true_type {};
-template <>
-struct is_error_code_enum<llvm::coverage::coveragemap_error> : std::true_type {};
}
#endif // LLVM_PROFILEDATA_INSTRPROF_H_
More information about the llvm-commits
mailing list