Store the submodules of a module in source order, as they are stored
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147564 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp
index dd98fcf..d9a385d 100644
--- a/lib/Frontend/FrontendActions.cpp
+++ b/lib/Frontend/FrontendActions.cpp
@@ -186,11 +186,10 @@
   }
   
   // Recurse into submodules.
-  for (llvm::StringMap<clang::Module *>::iterator
-            Sub = Module->SubModules.begin(),
-         SubEnd = Module->SubModules.end();
+  for (clang::Module::submodule_iterator Sub = Module->submodule_begin(),
+                                      SubEnd = Module->submodule_end();
        Sub != SubEnd; ++Sub)
-    collectModuleHeaderIncludes(LangOpts, Sub->getValue(), Includes);
+    collectModuleHeaderIncludes(LangOpts, *Sub, Includes);
 }
 
 bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI,