diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-28 00:45:10 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-28 00:45:10 +0000 |
commit | 08a2bfd230cfc8049b6015c7ca2a3cc7d2fadb2f (patch) | |
tree | 283e9aa2b4ae63f090f71cd664d7af9daa212b64 /clang/lib/Frontend/FrontendActions.cpp | |
parent | b7098a38b39758316d78c1a16f57227c5d2064ac (diff) | |
download | bcm5719-llvm-08a2bfd230cfc8049b6015c7ca2a3cc7d2fadb2f.tar.gz bcm5719-llvm-08a2bfd230cfc8049b6015c7ca2a3cc7d2fadb2f.zip |
Cut down the number of open/close system calls for output files.
For PCH files, have only one open/close for temporary + rename to be safe from race conditions.
For all other output files open/close the output file directly.
Depends on llvm r136310. rdar://9082880 & http://llvm.org/PR9374.
llvm-svn: 136315
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 44cd2dfe9bf..4eb9cda3987 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -102,8 +102,10 @@ bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI, // We use createOutputFile here because this is exposed via libclang, and we // must disable the RemoveFileOnSignal behavior. + // We use a temporary to avoid race conditions. OS = CI.createOutputFile(CI.getFrontendOpts().OutputFile, /*Binary=*/true, - /*RemoveFileOnSignal=*/false, InFile); + /*RemoveFileOnSignal=*/false, InFile, + /*Extension=*/"", /*useTemporary=*/true); if (!OS) return true; |