diff options
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 9c4c834..e5994a7 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -59,9 +59,8 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, } Module::~Module() { - for (submodule_iterator I = submodule_begin(), IEnd = submodule_end(); - I != IEnd; ++I) { - delete *I; + for (auto *Submodule : SubModules) { + delete Submodule; } } @@ -339,11 +338,9 @@ void Module::markUnavailable(bool Unimportable) { Current->IsAvailable = false; Current->IsUnimportable |= Unimportable; - for (submodule_iterator Sub = Current->submodule_begin(), - SubEnd = Current->submodule_end(); - Sub != SubEnd; ++Sub) { - if (needUpdate(*Sub)) - Stack.push_back(*Sub); + for (auto *Submodule : Current->submodules()) { + if (needUpdate(Submodule)) + Stack.push_back(Submodule); } } } @@ -550,14 +547,13 @@ void Module::print(raw_ostream &OS, unsigned Indent, bool Dump) const { OS << "export_as" << ExportAsModule << "\n"; } - for (submodule_const_iterator MI = submodule_begin(), MIEnd = submodule_end(); - MI != MIEnd; ++MI) + for (auto *Submodule : submodules()) // Print inferred subframework modules so that we don't need to re-infer // them (requires expensive directory iteration + stat calls) when we build // the module. Regular inferred submodules are OK, as we need to look at all // those header files anyway. - if (!(*MI)->IsInferred || (*MI)->IsFramework) - (*MI)->print(OS, Indent + 2, Dump); + if (!Submodule->IsInferred || Submodule->IsFramework) + Submodule->print(OS, Indent + 2, Dump); for (unsigned I = 0, N = Exports.size(); I != N; ++I) { OS.indent(Indent + 2); |