aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorStoorx <me@stoorx.one>2023-04-18 23:49:00 +0300
committerStoorx <me@stoorx.one>2023-04-24 12:05:59 +0300
commit40136ecefc0a542da7d0f1736c51325edc5539b4 (patch)
tree252e4cff7890431ff8f77a92184549fee68cc214 /clang/lib/CodeGen/CodeGenModule.cpp
parent0a113c4c50f65a7d26d20be84bfb56562154753f (diff)
downloadllvm-40136ecefc0a542da7d0f1736c51325edc5539b4.zip
llvm-40136ecefc0a542da7d0f1736c51325edc5539b4.tar.gz
llvm-40136ecefc0a542da7d0f1736c51325edc5539b4.tar.bz2
[clang] Make access to submodules via `iterator_range`
In file `clang/lib/Basic/Module.cpp` the `Module` class had `submodule_begin()` and `submodule_end()` functions to retrieve corresponding iterators for private vector of Modules. This commit removes mentioned functions, and replaces all of theirs usages with `submodules()` function and range-based for-loops. Differential Revision: https://reviews.llvm.org/D148954
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 86a7c98..b8c45bc 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -6536,16 +6536,14 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
EmitTopLevelDecl(D);
// Visit the submodules of this module.
- for (clang::Module::submodule_iterator Sub = Mod->submodule_begin(),
- SubEnd = Mod->submodule_end();
- Sub != SubEnd; ++Sub) {
+ for (auto *Submodule : Mod->submodules()) {
// Skip explicit children; they need to be explicitly imported to emit
// the initializers.
- if ((*Sub)->IsExplicit)
+ if (Submodule->IsExplicit)
continue;
- if (Visited.insert(*Sub).second)
- Stack.push_back(*Sub);
+ if (Visited.insert(Submodule).second)
+ Stack.push_back(Submodule);
}
}
break;