summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-11-22 01:39:07 +0000
committerXinliang David Li <davidxl@google.com>2015-11-22 01:39:07 +0000
commitbbf1f8aa67bf4c524f0aca9f6d64411be3f0a0ff (patch)
treeb43fa2cc8c6dcd89e66d1d59057e697504c5cf61
parentc76732396ba835649a54248c906c8ef1ee60f6d1 (diff)
downloadbcm5719-llvm-bbf1f8aa67bf4c524f0aca9f6d64411be3f0a0ff.tar.gz
bcm5719-llvm-bbf1f8aa67bf4c524f0aca9f6d64411be3f0a0ff.zip
[PGO] Move Value Profile Kind to InstrProfData.inc
ValueProfKind value affects runtime data structure and definition is shared between compiler-rt and LLVM. llvm-svn: 253806
-rw-r--r--llvm/include/llvm/ProfileData/InstrProf.h6
-rw-r--r--llvm/include/llvm/ProfileData/InstrProfData.inc18
2 files changed, 20 insertions, 4 deletions
diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h
index b93d5d0b966..571e2881dce 100644
--- a/llvm/include/llvm/ProfileData/InstrProf.h
+++ b/llvm/include/llvm/ProfileData/InstrProf.h
@@ -169,10 +169,8 @@ inline std::error_code make_error_code(instrprof_error E) {
}
enum InstrProfValueKind : uint32_t {
- IPVK_IndirectCallTarget = 0,
-
- IPVK_First = IPVK_IndirectCallTarget,
- IPVK_Last = IPVK_IndirectCallTarget
+#define VALUE_PROF_KIND(Enumerator, Value) Enumerator = Value,
+#include "llvm/ProfileData/InstrProfData.inc"
};
struct InstrProfStringTable {
diff --git a/llvm/include/llvm/ProfileData/InstrProfData.inc b/llvm/include/llvm/ProfileData/InstrProfData.inc
index c422787859a..cf7e2884ed6 100644
--- a/llvm/include/llvm/ProfileData/InstrProfData.inc
+++ b/llvm/include/llvm/ProfileData/InstrProfData.inc
@@ -107,6 +107,24 @@ VALUE_PROF_FUNC_PARAM(uint32_t, CounterIndex, Type::getInt32Ty(Ctx))
#undef INSTR_PROF_COMMA
/* VALUE_PROF_FUNC_PARAM end */
+/* VALUE_PROF_KIND start */
+#ifndef VALUE_PROF_KIND
+#define VALUE_PROF_KIND(Enumerator, Value)
+#else
+#define INSTR_PROF_DATA_DEFINED
+#endif
+VALUE_PROF_KIND(IPVK_IndirectCallTarget, 0)
+/* These two kinds must be the last to be
+ * declared. This is to make sure the string
+ * array created with the template can be
+ * indexed with the kind value.
+ */
+VALUE_PROF_KIND(IPVK_First, IPVK_IndirectCallTarget)
+VALUE_PROF_KIND(IPVK_Last, IPVK_IndirectCallTarget)
+
+#undef VALUE_PROF_KIND
+/* VALUE_PROF_KIND end */
+
/* COVMAP_FUNC_RECORD start */
/* Definition of member fields of the function record structure in coverage
* map.
OpenPOWER on IntegriCloud