[modules] Load .pcm files specified by -fmodule-file lazily.

llvm-svn: 220731
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 1c93842..c81c81a 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -383,16 +383,10 @@
            "doesn't support modules");
   }
 
-  // If we were asked to load any module files, do so now. Don't make any names
-  // from those modules visible.
-  for (const auto &ModuleFile : CI.getFrontendOpts().ModuleFiles) {
-    // FIXME: Use a better source location here. Perhaps inject something
-    // into the predefines buffer to represent these module files.
-    if (!CI.loadModuleFile(ModuleFile,
-                           CI.getSourceManager().getLocForStartOfFile(
-                               CI.getSourceManager().getMainFileID())))
+  // If we were asked to load any module files, do so now.
+  for (const auto &ModuleFile : CI.getFrontendOpts().ModuleFiles)
+    if (!CI.loadModuleFile(ModuleFile))
       goto failure;
-  }
 
   // If there is a layout overrides file, attach an external AST source that
   // provides the layouts from that file.