From 4da5de9c347b19772ac05b25b1f1e8298af96139 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Fri, 16 Oct 2015 22:21:56 +0000 Subject: Use struct type instead of raw array for raw profile header (NFC) This patch introduces a well defined header struct to represent raw profile header instead of using raw array. Previously the raw array is used in two different files and is very error prone when header structure is re-organized. This is a small cleanup with NFC. llvm-svn: 250561 --- compiler-rt/lib/profile/InstrProfiling.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'compiler-rt/lib/profile/InstrProfiling.h') diff --git a/compiler-rt/lib/profile/InstrProfiling.h b/compiler-rt/lib/profile/InstrProfiling.h index 3778a88893e..7aac3b4c29c 100644 --- a/compiler-rt/lib/profile/InstrProfiling.h +++ b/compiler-rt/lib/profile/InstrProfiling.h @@ -27,7 +27,6 @@ typedef uint32_t uintptr_t; #endif /* defined(__FreeBSD__) && defined(__i386__) */ -#define PROFILE_HEADER_SIZE 7 typedef struct __llvm_profile_data { const uint32_t NameSize; @@ -37,6 +36,17 @@ typedef struct __llvm_profile_data { uint64_t *const Counters; } __llvm_profile_data; +typedef struct __llvm_profile_header { + uint64_t Magic; + uint64_t Version; + uint64_t DataSize; + uint64_t CountersSize; + uint64_t NamesSize; + uint64_t CountersDelta; + uint64_t NamesDelta; +} __llvm_profile_header; + + /*! * \brief Get required size for profile buffer. */ -- cgit v1.2.3