[compiler-rt] 6e2058e - [Compiler-RT] Remove FlushViewOfFile call when unmapping gcda files on win32.

Andi-Bogdan Postelnicu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 06:25:01 PDT 2022


Author: Andi-Bogdan Postelnicu
Date: 2022-07-05T13:24:28Z
New Revision: 6e2058e58832058f05372c93e8be50695efcc6be

URL: https://github.com/llvm/llvm-project/commit/6e2058e58832058f05372c93e8be50695efcc6be
DIFF: https://github.com/llvm/llvm-project/commit/6e2058e58832058f05372c93e8be50695efcc6be.diff

LOG: [Compiler-RT]  Remove FlushViewOfFile call when unmapping gcda files on win32.

This patch was pushed for calixte at mozilla.com

- this function (Windows only) is called when gcda are dumped on disk;
- according to its documentation, it's only useful in case of hard failures, this is highly improbable;
- it drastically decreases the time in the tests and consequently it avoids timeouts when we use slow disks.

Differential Revision: https://reviews.llvm.org/D129128

Added: 
    

Modified: 
    compiler-rt/lib/profile/GCDAProfiling.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c
index 4aa15e9e95905..4f46fd2839b90 100644
--- a/compiler-rt/lib/profile/GCDAProfiling.c
+++ b/compiler-rt/lib/profile/GCDAProfiling.c
@@ -3,9 +3,9 @@
 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 |* See https://llvm.org/LICENSE.txt for license information.
 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-|* 
+|*
 |*===----------------------------------------------------------------------===*|
-|* 
+|*
 |* This file implements the call back routines for the gcov profiling
 |* instrumentation pass. Link against this library when running code through
 |* the -insert-gcov-profiling LLVM pass.
@@ -65,7 +65,7 @@ static char *filename = NULL;
 
 /*
  * The current file we're outputting.
- */ 
+ */
 static FILE *output_file = NULL;
 
 /*
@@ -264,11 +264,6 @@ static int map_file(void) {
 
 static void unmap_file(void) {
 #if defined(_WIN32)
-  if (!FlushViewOfFile(write_buffer, file_size)) {
-    fprintf(stderr, "profiling: %s: cannot flush mapped view: %lu\n", filename,
-            GetLastError());
-  }
-
   if (!UnmapViewOfFile(write_buffer)) {
     fprintf(stderr, "profiling: %s: cannot unmap mapped view: %lu\n", filename,
             GetLastError());


        


More information about the llvm-commits mailing list