From 58ffcfbffac0e8f9400b64f2233fce75742e9daf Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 19 Jan 2017 23:10:14 +0000 Subject: LTO: Flush the resolution file after writing to it. Without this the file could be truncated if the linker crashes. llvm-svn: 292532 --- llvm/lib/LTO/LTO.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib') diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index e3e2f9f806c..0f22207c3fa 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -372,6 +372,7 @@ static void writeToResolutionFile(raw_ostream &OS, InputFile *Input, OS << 'x'; OS << '\n'; } + OS.flush(); assert(ResI == Res.end()); } -- cgit v1.2.3