File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
integration-tests/posix-only/frontend-invocations Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,12 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
161161static std::unordered_set<std::string> collectInputFilenames (swift::CompilerInstance& compiler) {
162162 // The frontend can be called in many different ways.
163163 // At each invocation we only extract system and builtin modules and any input source files that
164- // have an output associated with them.
164+ // are primary inputs, or all of them if there are no primary inputs (whole module optimization)
165165 std::unordered_set<std::string> sourceFiles;
166- auto inputFiles = compiler.getInvocation ().getFrontendOptions ().InputsAndOutputs .getAllInputs ();
167- for (auto & input : inputFiles) {
168- if (input.getType () == swift::file_types::TY_Swift && !input.outputFilename ().empty ()) {
166+ const auto & inOuts = compiler.getInvocation ().getFrontendOptions ().InputsAndOutputs ;
167+ for (auto & input : inOuts.getAllInputs ()) {
168+ if (input.getType () == swift::file_types::TY_Swift &&
169+ (!inOuts.hasPrimaryInputs () || input.isPrimary ())) {
169170 sourceFiles.insert (input.getFileName ());
170171 }
171172 }
Original file line number Diff line number Diff line change 66| F1.swift:0:0:0:0 | F1.swift |
77| F2.swift:0:0:0:0 | F2.swift |
88| F3.swift:0:0:0:0 | F3.swift |
9+ | F4.swift:0:0:0:0 | F4.swift |
910| F5.swift:0:0:0:0 | F5.swift |
1011| G.swift:0:0:0:0 | G.swift |
1112| H1.swift:0:0:0:0 | H1.swift |
You can’t perform that action at this time.
0 commit comments