]> granicus.if.org Git - llvm/commitdiff
LTO: Flush the resolution file after writing to it.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 19 Jan 2017 23:10:14 +0000 (23:10 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 19 Jan 2017 23:10:14 +0000 (23:10 +0000)
Without this the file could be truncated if the linker crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292532 91177308-0d34-0410-b5e6-96231b3b80d8

lib/LTO/LTO.cpp

index e3e2f9f806c880e1b1b496b7bbb87f9af810ea37..0f22207c3faf4eb457934d2b2c1c9eb9c009cd28 100644 (file)
@@ -372,6 +372,7 @@ static void writeToResolutionFile(raw_ostream &OS, InputFile *Input,
       OS << 'x';
     OS << '\n';
   }
+  OS.flush();
   assert(ResI == Res.end());
 }