diff options
author | Xinliang David Li <davidxl@google.com> | 2016-05-16 20:33:30 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-05-16 20:33:30 +0000 |
commit | 9af4859d1b4867901cf0e573e3b6d4a9d6d328dd (patch) | |
tree | 7e05acd52fd7ba6522575c295addfe6ac8ac424c /lib/profile/InstrProfData.inc | |
parent | ef33572212a3dd2d2f7d1984c25448fac20b21e1 (diff) | |
download | compiler-rt-9af4859d1b4867901cf0e573e3b6d4a9d6d328dd.tar.gz |
[profile] minor code restructuring /NFC
This is one of the enabler patch to allow value profiler to
allocate counter statically.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfData.inc')
-rw-r--r-- | lib/profile/InstrProfData.inc | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/lib/profile/InstrProfData.inc b/lib/profile/InstrProfData.inc index 4b748f973..49c3266c2 100644 --- a/lib/profile/InstrProfData.inc +++ b/lib/profile/InstrProfData.inc @@ -88,6 +88,33 @@ INSTR_PROF_DATA(const uint16_t, Int16ArrayTy, NumValueSites[IPVK_Last+1], \ #undef INSTR_PROF_DATA /* INSTR_PROF_DATA end. */ + +/* This is an internal data structure used by value profiler. It + * is defined here to allow serialization code sharing by LLVM + * to be used in unit test. + * + * typedef struct ValueProfNode { + * // InstrProfValueData VData; + * uint64_t Value; + * uint64_t Count; + * struct ValueProfNode *Next; + * } ValueProfNode; + */ +/* INSTR_PROF_VALUE_NODE start. */ +#ifndef INSTR_PROF_VALUE_NODE +#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer) +#else +#define INSTR_PROF_DATA_DEFINED +#endif +INSTR_PROF_VALUE_NODE(uint64_t, llvm::Type::getInt64Ty(Ctx), Value, \ + ConstantInt::get(llvm::Type::GetInt64Ty(Ctx), 0)) +INSTR_PROF_VALUE_NODE(uint64_t, llvm::Type::getInt64Ty(Ctx), Count, \ + ConstantInt::get(llvm::Type::GetInt64Ty(Ctx), 0)) +INSTR_PROF_VALUE_NODE(PtrToNodeT, llvm::Type::getInt8PtrTy(Ctx), Next, \ + ConstantInt::get(llvm::Type::GetInt8PtrTy(Ctx), 0)) +#undef INSTR_PROF_VALUE_NODE +/* INSTR_PROF_VALUE_NODE end. */ + /* INSTR_PROF_RAW_HEADER start */ /* Definition of member fields of the raw profile header data structure. */ #ifndef INSTR_PROF_RAW_HEADER @@ -610,15 +637,6 @@ typedef struct InstrProfValueData { uint64_t Count; } InstrProfValueData; -/* This is an internal data structure used by value profiler. It - * is defined here to allow serialization code sharing by LLVM - * to be used in unit test. - */ -typedef struct ValueProfNode { - InstrProfValueData VData; - struct ValueProfNode *Next; -} ValueProfNode; - #endif /* INSTR_PROF_DATA_INC */ #else |