[InstrProfiling] Fix warnings when building for Windows
authorMartin Storsjö <martin@martin.st>
Fri, 6 Aug 2021 06:19:25 +0000 (09:19 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 9 Aug 2021 08:39:11 +0000 (11:39 +0300)
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

compiler-rt/lib/profile/InstrProfilingWriter.c

index 030befc..5ed968f 100644 (file)
@@ -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. */