diff options
| author | Xinliang David Li <davidxl@google.com> | 2015-10-16 22:21:56 +0000 |
|---|---|---|
| committer | Xinliang David Li <davidxl@google.com> | 2015-10-16 22:21:56 +0000 |
| commit | 4da5de9c347b19772ac05b25b1f1e8298af96139 (patch) | |
| tree | 61667a42ea05b5d66e99ecc7a679519a4a4d110c /compiler-rt/lib/profile/InstrProfiling.h | |
| parent | bbd524496ccf5946c771a61d2d490675156518d0 (diff) | |
| download | bcm5719-llvm-4da5de9c347b19772ac05b25b1f1e8298af96139.tar.gz bcm5719-llvm-4da5de9c347b19772ac05b25b1f1e8298af96139.zip | |
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
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfiling.h')
| -rw-r--r-- | compiler-rt/lib/profile/InstrProfiling.h | 12 |
1 files changed, 11 insertions, 1 deletions
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. */ |

