Fix clang-cl warnings in compiler-rt
The profile library was missing some includes and was erroneously using
ftruncate. WinASan was using `= {0}` to initialize structs, which
creates -Wmissing-field-initializers and -Wmissing-braces warnings with
clang. Use `= {}` instead, since this is C++.
llvm-svn: 330616
diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index 6e6b8fa..1299a6d 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -19,6 +19,7 @@
#include "WindowsMMap.h"
/* For _chsize_s */
#include <io.h>
+#include <process.h>
#else
#include <sys/file.h>
#include <sys/mman.h>
@@ -186,7 +187,7 @@
// Truncate the file in case merging of value profile did not happend to
// prevent from leaving garbage data at the end of the profile file.
- ftruncate(fileno(ProfileFile), __llvm_profile_get_size_for_buffer());
+ COMPILER_RT_FTRUNCATE(ProfileFile, __llvm_profile_get_size_for_buffer());
(void)munmap(ProfileBuffer, ProfileFileSize);
*MergeDone = 1;