]> granicus.if.org Git - clang/commitdiff
CodeGen: switch iteration to range based for loop (NFC)
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 5 Jan 2019 18:39:32 +0000 (18:39 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 5 Jan 2019 18:39:32 +0000 (18:39 +0000)
Change a loop to range based instead while working on cleaning up some
modules autolinking issues on Linux.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350472 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index b398f980246987323f7f7eb3f19c220e73f9b9d8..b9466fe87c77e8af5d9ac06e48aa4c5cecf41f2d 100644 (file)
@@ -1746,16 +1746,14 @@ void CodeGenModule::EmitModuleLinkOptions() {
     bool AnyChildren = false;
 
     // Visit the submodules of this module.
-    for (clang::Module::submodule_iterator Sub = Mod->submodule_begin(),
-                                        SubEnd = Mod->submodule_end();
-         Sub != SubEnd; ++Sub) {
+    for (const auto &SM : Mod->submodules()) {
       // Skip explicit children; they need to be explicitly imported to be
       // linked against.
-      if ((*Sub)->IsExplicit)
+      if (SM->IsExplicit)
         continue;
 
-      if (Visited.insert(*Sub).second) {
-        Stack.push_back(*Sub);
+      if (Visited.insert(SM).second) {
+        Stack.push_back(SM);
         AnyChildren = true;
       }
     }