diff options
| author | Reid Kleckner <reid@kleckner.net> | 2014-05-01 18:52:14 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2014-05-01 18:52:14 +0000 |
| commit | af6b2504f84152bb55cdb39d2d1a1dcea3d541bb (patch) | |
| tree | ab9f7e570bd948093d3b014571bdd0c2a14debf9 /compiler-rt/lib/profile/InstrProfilingBuffer.c | |
| parent | a108a65df2716de0c12d39f189c300a17a7bde8b (diff) | |
| download | bcm5719-llvm-af6b2504f84152bb55cdb39d2d1a1dcea3d541bb.tar.gz bcm5719-llvm-af6b2504f84152bb55cdb39d2d1a1dcea3d541bb.zip | |
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.
llvm-svn: 207784
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfilingBuffer.c')
| -rw-r--r-- | compiler-rt/lib/profile/InstrProfilingBuffer.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingBuffer.c b/compiler-rt/lib/profile/InstrProfilingBuffer.c index 8fc0117e949..8c6d43e7b45 100644 --- a/compiler-rt/lib/profile/InstrProfilingBuffer.c +++ b/compiler-rt/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) \ |

