diff options
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index d1750736034..7d25ebb2658 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1244,7 +1244,7 @@ static std::string GetPreamblePCHPath() { return TmpFile; SmallString<128> Path; - llvm::sys::fs::unique_file("preamble-%%%%%%.pch", Path); + llvm::sys::fs::createTemporaryFile("preamble", "pch", Path); return Path.str(); } diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 61c140caacb..8d78a22c22b 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -855,13 +855,9 @@ static void compileModule(CompilerInstance &ImportingInstance, IK)); } else { // Create a temporary module map file. - TempModuleMapFileName = Module->Name; - TempModuleMapFileName += "-%%%%%%%%.map"; int FD; - if (llvm::sys::fs::unique_file(TempModuleMapFileName.str(), FD, - TempModuleMapFileName, - /*makeAbsolute=*/true) - != llvm::errc::success) { + if (llvm::sys::fs::createTemporaryFile(Module->Name, "map", FD, + TempModuleMapFileName)) { ImportingInstance.getDiagnostics().Report(diag::err_module_map_temp_file) << TempModuleMapFileName; return; |