[compiler-rt] 743f78e - [InstrProfiling] Fix warnings when building for Windows
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 9 01:39:22 PDT 2021
Author: Martin Storsjö
Date: 2021-08-09T11:39:11+03:00
New Revision: 743f78ef7fcaaf59246a1163858da3d9581485ff
URL: https://github.com/llvm/llvm-project/commit/743f78ef7fcaaf59246a1163858da3d9581485ff
DIFF: https://github.com/llvm/llvm-project/commit/743f78ef7fcaaf59246a1163858da3d9581485ff.diff
LOG: [InstrProfiling] Fix warnings when building for Windows
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
Added:
Modified:
compiler-rt/lib/profile/InstrProfilingWriter.c
Removed:
################################################################################
diff --git a/compiler-rt/lib/profile/InstrProfilingWriter.c b/compiler-rt/lib/profile/InstrProfilingWriter.c
index 030befc14e21a..5ed968f21839a 100644
--- a/compiler-rt/lib/profile/InstrProfilingWriter.c
+++ b/compiler-rt/lib/profile/InstrProfilingWriter.c
@@ -286,7 +286,7 @@ lprofWriteDataImpl(ProfDataWriter *Writer, const __llvm_profile_data *DataBegin,
/* On WIN64, label
diff erences 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. */
More information about the llvm-commits
mailing list