r350472 - CodeGen: switch iteration to range based for loop (NFC)
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 5 10:39:32 PST 2019
Author: compnerd
Date: Sat Jan 5 10:39:32 2019
New Revision: 350472
URL: http://llvm.org/viewvc/llvm-project?rev=350472&view=rev
Log:
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.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=350472&r1=350471&r2=350472&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Jan 5 10:39:32 2019
@@ -1746,16 +1746,14 @@ void CodeGenModule::EmitModuleLinkOption
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;
}
}
More information about the cfe-commits
mailing list