summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp8
1 files changed, 2 insertions, 6 deletions
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;
OpenPOWER on IntegriCloud