diff options
author | Reid Kleckner <rnk@google.com> | 2018-04-23 17:05:47 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-04-23 17:05:47 +0000 |
commit | fc39236ab190af3435460e028ef7d6028a15a254 (patch) | |
tree | 7a4335897037c3912834605c5b65a3d22a62394e /lib/profile/InstrProfilingFile.c | |
parent | d86761884c4e79b9bce4d2dcca3fb15925a362ea (diff) |
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++.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@330616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingFile.c')
-rw-r--r-- | lib/profile/InstrProfilingFile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c index 6e6b8fac5..1299a6d8c 100644 --- a/lib/profile/InstrProfilingFile.c +++ b/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 @@ static int doProfileMerging(FILE *ProfileFile, int *MergeDone) { // 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; |