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(
161
161
static std::unordered_set<std::string> collectInputFilenames (swift::CompilerInstance& compiler) {
162
162
// The frontend can be called in many different ways.
163
163
// 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)
165
165
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 ())) {
169
170
sourceFiles.insert (input.getFileName ());
170
171
}
171
172
}
Original file line number Diff line number Diff line change 6
6
| F1.swift:0:0:0:0 | F1.swift |
7
7
| F2.swift:0:0:0:0 | F2.swift |
8
8
| F3.swift:0:0:0:0 | F3.swift |
9
+ | F4.swift:0:0:0:0 | F4.swift |
9
10
| F5.swift:0:0:0:0 | F5.swift |
10
11
| G.swift:0:0:0:0 | G.swift |
11
12
| H1.swift:0:0:0:0 | H1.swift |
You can’t perform that action at this time.
0 commit comments