aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/CompilerInstance.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-28 00:45:10 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-28 00:45:10 +0000
commit7e90985df09855dc309ed888a5b16a0ae684f8e3 (patch)
treec9e04d8022164aabccf48bef6b2e5263485f0b59 /include/clang/Frontend/CompilerInstance.h
parentd58a0a55e64a7c410a80e9d6dcd899e61e99cc4d (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInstance.h')
-rw-r--r--include/clang/Frontend/CompilerInstance.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index 73eeff4c4d..425f2e7241 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -570,14 +570,16 @@ public:
createOutputFile(StringRef OutputPath,
bool Binary = true, bool RemoveFileOnSignal = true,
StringRef BaseInput = "",
- StringRef Extension = "");
+ StringRef Extension = "",
+ bool UseTemporary = false);
/// Create a new output file, optionally deriving the output path name.
///
/// If \arg OutputPath is empty, then createOutputFile will derive an output
/// path location as \arg BaseInput, with any suffix removed, and \arg
- /// Extension appended. If OutputPath is not stdout createOutputFile will
- /// create a new temporary file that must be renamed to OutputPath in the end.
+ /// Extension appended. If OutputPath is not stdout and \arg UseTemporary
+ /// is true, createOutputFile will create a new temporary file that must be
+ /// renamed to OutputPath in the end.
///
/// \param OutputPath - If given, the path to the output file.
/// \param Error [out] - On failure, the error message.
@@ -588,6 +590,8 @@ public:
/// \param RemoveFileOnSignal - Whether the file should be registered with
/// llvm::sys::RemoveFileOnSignal. Note that this is not safe for
/// multithreaded use, as the underlying signal mechanism is not reentrant
+ /// \param UseTemporary - Create a new temporary file that must be renamed to
+ /// OutputPath in the end
/// \param ResultPathName [out] - If given, the result path name will be
/// stored here on success.
/// \param TempPathName [out] - If given, the temporary file path name
@@ -597,6 +601,7 @@ public:
bool Binary = true, bool RemoveFileOnSignal = true,
StringRef BaseInput = "",
StringRef Extension = "",
+ bool UseTemporary = false,
std::string *ResultPathName = 0,
std::string *TempPathName = 0);