File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
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 ()) {
Original file line number Diff line number Diff line change @@ -1340,8 +1340,11 @@ static void performParallelIRGeneration(IRGenDescriptor desc) {
1340
1340
1341
1341
for (auto *File : M->getFiles ()) {
1342
1342
if (auto *SF = dyn_cast<SourceFile>(File)) {
1343
- CurrentIGMPtr IGM = irgen.getGenModule (SF);
1344
- IGM->emitSourceFile (*SF);
1343
+ {
1344
+ CurrentIGMPtr IGM = irgen.getGenModule (SF);
1345
+ IGM->emitSourceFile (*SF);
1346
+ }
1347
+
1345
1348
if (auto *synthSFU = File->getSynthesizedFile ()) {
1346
1349
CurrentIGMPtr IGM = irgen.getGenModule (synthSFU);
1347
1350
IGM->emitSynthesizedFileUnit (*synthSFU);
You can’t perform that action at this time.
0 commit comments