Skip to content

Commit

Permalink
[InstrProfiling] Fix warnings when building for Windows
Browse files Browse the repository at this point in the history
The Headers.CountersDelta field is an uint64_t, not a pointer,
so just cast to uint32_t to truncate it.

Differential Revision: https://reviews.llvm.org/D107619
  • Loading branch information
mstorsjo committed Aug 9, 2021
1 parent aefdce8 commit 743f78e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfilingWriter.c
Expand Up @@ -286,7 +286,7 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin,
/* On WIN64, label differences are truncated 32-bit values. Truncate
* CountersDelta to match. */
#ifdef _WIN64
Header.CountersDelta = (void *)(uint32_t)Header.CountersDelta;
Header.CountersDelta = (uint32_t)Header.CountersDelta;
#endif

/* Write the profile header. */
Expand Down

0 comments on commit 743f78e

Please sign in to comment.