[Modules] Improve diagnostics for LockFileManager errors

Uses error message now provided by LockFileManager in LLVM r271755.

rdar://problem/26529101

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271758 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit bdf3f27871b94ec92b0fd74abc4839308ee681d9)
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td
index 9d8dbc5..9d9737f 100644
--- a/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/include/clang/Basic/DiagnosticCommonKinds.td
@@ -91,7 +91,7 @@
 def err_module_shadowed : Error<
   "import of shadowed module '%0'">;
 def err_module_lock_failure : Error<
-  "could not acquire lock file for module '%0'">, DefaultFatal;
+  "could not acquire lock file for module '%0': %1">, DefaultFatal;
 def err_module_lock_timeout : Error<
   "timed out waiting to acquire lock file for module '%0'">, DefaultFatal;
 def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, 
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index f35702b..f9b6c9a 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -1073,7 +1073,7 @@
     switch (Locked) {
     case llvm::LockFileManager::LFS_Error:
       Diags.Report(ModuleNameLoc, diag::err_module_lock_failure)
-          << Module->Name;
+          << Module->Name << Locked.getErrorMessage();
       return false;
 
     case llvm::LockFileManager::LFS_Owned: