summaryrefslogtreecommitdiff
path: root/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-01-19 23:10:14 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-01-19 23:10:14 +0000
commitdc38a32106cb2df38bc4f777b3e650f941a6fa8f (patch)
tree1f9120b94f3cd0afe28abe3af08c00708e05dc71 /lib/LTO/LTO.cpp
parent2037eb7f158f6a7b745b1c8d7be2f7015d8bca38 (diff)
LTO: Flush the resolution file after writing to it.
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
Diffstat (limited to 'lib/LTO/LTO.cpp')
-rw-r--r--lib/LTO/LTO.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index e3e2f9f806c..0f22207c3fa 100644
--- a/lib/LTO/LTO.cpp
+++ b/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());
}