If we can't write the temporary module map file when compiling a
module, at least have the decency to complain about it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146002 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td
index cd797fc..ca15fee 100644
--- a/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -183,5 +183,6 @@
 def err_no_submodule : Error<"no submodule named %0 in module '%1'">;
 def err_no_submodule_suggest : Error<
   "no submodule named %0 in module '%1'; did you mean '%2'?">;
-
+def err_module_map_temp_file : Error<
+  "unable to write temporary module map file '%0'">, DefaultFatal;
 }
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 454d7bd..7b3fe78 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -1026,7 +1026,8 @@
                                    TempModuleMapFileName,
                                    /*makeAbsolute=*/true)
           != llvm::errc::success) {
-      // FIXME: Give a sensible error message here.
+      ImportingInstance.getDiagnostics().Report(diag::err_module_map_temp_file)
+        << TempModuleMapFileName;
       return;
     }
     // Print the module map to this file.