File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -1168,19 +1168,13 @@ bool CompilerInstance::loadPartialModulesAndImplicitImports(
1168
1168
bool CompilerInstance::forEachFileToTypeCheck (
1169
1169
llvm::function_ref<bool (SourceFile &)> fn) {
1170
1170
if (isWholeModuleCompilation ()) {
1171
- // FIXME: Do not refactor this to use an iterator as long as
1172
- // ModuleDecl::addFile is called during Sema. Synthesized files pushed
1173
- // during semantic analysis will cause iterator invalidation here.
1174
- // See notes in SourceFile::getOrCreateSynthesizedFile() for more.
1175
- unsigned i = 0 ;
1176
- while (i < getMainModule ()->getFiles ().size ()) {
1177
- auto *SF = dyn_cast<SourceFile>(getMainModule ()->getFiles ()[i++]);
1171
+ for (auto fileName : getMainModule ()->getFiles ()) {
1172
+ auto *SF = dyn_cast<SourceFile>(fileName);
1178
1173
if (!SF) {
1179
1174
continue ;
1180
1175
}
1181
1176
if (fn (*SF))
1182
1177
return true ;
1183
- ;
1184
1178
}
1185
1179
} else {
1186
1180
for (auto *SF : getPrimarySourceFiles ()) {
You can’t perform that action at this time.
0 commit comments