summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingBuffer.c
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-05-01 18:52:14 +0000
committerReid Kleckner <reid@kleckner.net>2014-05-01 18:52:14 +0000
commite80ef5315da420c4d566ccdaa265257815354c06 (patch)
tree3f0e4c7155bccaaf12de381da00a54349a79534a /lib/profile/InstrProfilingBuffer.c
parent08399dbaa7c98df730e3b93bd20f73a39ae339bf (diff)
profile: Fix the build with gcc 4.9
GCC -pedantic warns that the initialization of Header is not constant: InstrProfilingFile.c:31:5: error: initializer element is not computable at load time [-Werror] LLVM defaults to enabling -pedantic. If this warning is unhelpful, we can consider revisiting that decision. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingBuffer.c')
-rw-r--r--lib/profile/InstrProfilingBuffer.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/profile/InstrProfilingBuffer.c b/lib/profile/InstrProfilingBuffer.c
index 8fc0117e9..8c6d43e7b 100644
--- a/lib/profile/InstrProfilingBuffer.c
+++ b/lib/profile/InstrProfilingBuffer.c
@@ -35,15 +35,14 @@ int __llvm_profile_write_buffer(char *Buffer) {
const uint64_t NamesSize = NamesEnd - NamesBegin;
/* Create the header. */
- uint64_t Header[PROFILE_HEADER_SIZE] = {
- __llvm_profile_get_magic(),
- __llvm_profile_get_version(),
- DataSize,
- CountersSize,
- NamesSize,
- (uintptr_t)CountersBegin,
- (uintptr_t)NamesBegin
- };
+ uint64_t Header[PROFILE_HEADER_SIZE];
+ Header[0] = __llvm_profile_get_magic();
+ Header[1] = __llvm_profile_get_version();
+ Header[2] = DataSize;
+ Header[3] = CountersSize;
+ Header[4] = NamesSize;
+ Header[5] = (uintptr_t)CountersBegin;
+ Header[6] = (uintptr_t)NamesBegin;
/* Write the data. */
#define UPDATE_memcpy(Data, Size) \