[compiler-rt] 4e8efff - [Profile] Add missing fflush in __llvm_profile_set_file_object

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 15:42:09 PDT 2021


Author: Zequan Wu
Date: 2021-10-05T15:41:51-07:00
New Revision: 4e8efff53e24e368a5f0aa309515d22a5b356d77

URL: https://github.com/llvm/llvm-project/commit/4e8efff53e24e368a5f0aa309515d22a5b356d77
DIFF: https://github.com/llvm/llvm-project/commit/4e8efff53e24e368a5f0aa309515d22a5b356d77.diff

LOG: [Profile] Add missing fflush in __llvm_profile_set_file_object

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c
index e830d366cb5f6..efd9f06ac6ee2 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -1173,6 +1173,7 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File,
                  strerror(errno));
         return 1;
       }
+      fflush(File);
     } else {
       /* The merged profile has a non-zero length. Check that it is compatible
        * with the data in this process. */


        


More information about the llvm-commits mailing list