mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Merge pull request #12700 from github/redsun82/swift-fix-wmo
Swift: extract all source files in WMO mode
This commit is contained in:
@@ -161,11 +161,12 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
|
||||
static std::unordered_set<std::string> collectInputFilenames(swift::CompilerInstance& compiler) {
|
||||
// The frontend can be called in many different ways.
|
||||
// At each invocation we only extract system and builtin modules and any input source files that
|
||||
// have an output associated with them.
|
||||
// are primary inputs, or all of them if there are no primary inputs (whole module optimization)
|
||||
std::unordered_set<std::string> sourceFiles;
|
||||
auto inputFiles = compiler.getInvocation().getFrontendOptions().InputsAndOutputs.getAllInputs();
|
||||
for (auto& input : inputFiles) {
|
||||
if (input.getType() == swift::file_types::TY_Swift && !input.outputFilename().empty()) {
|
||||
const auto& inOuts = compiler.getInvocation().getFrontendOptions().InputsAndOutputs;
|
||||
for (auto& input : inOuts.getAllInputs()) {
|
||||
if (input.getType() == swift::file_types::TY_Swift &&
|
||||
(!inOuts.hasPrimaryInputs() || input.isPrimary())) {
|
||||
sourceFiles.insert(input.getFileName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
| F1.swift:0:0:0:0 | F1.swift |
|
||||
| F2.swift:0:0:0:0 | F2.swift |
|
||||
| F3.swift:0:0:0:0 | F3.swift |
|
||||
| F4.swift:0:0:0:0 | F4.swift |
|
||||
| F5.swift:0:0:0:0 | F5.swift |
|
||||
| G.swift:0:0:0:0 | G.swift |
|
||||
| H1.swift:0:0:0:0 | H1.swift |
|
||||
|
||||
Reference in New Issue
Block a user