From: Saleem Abdulrasool Date: Sat, 5 Jan 2019 18:39:32 +0000 (+0000) Subject: CodeGen: switch iteration to range based for loop (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=270a7924028186360e10a9e606b5978ae3f179b7;p=clang CodeGen: switch iteration to range based for loop (NFC) 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 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index b398f98024..b9466fe87c 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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; } }