Skip to content

Commit 84b285a

Browse files
committed
Swift: collect source files
1 parent 33c4a82 commit 84b285a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

swift/extractor/SwiftExtractor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
114114
swift::ModuleDecl& module,
115115
swift::SourceFile* primaryFile = nullptr) {
116116
auto filename = getFilename(module, primaryFile);
117+
if (primaryFile) {
118+
state.sourceFiles.push_back(filename);
119+
}
117120

118121
// The extractor can be called several times from different processes with
119122
// the same input file(s). Using `TargetFile` the first process will win, and the following

swift/extractor/config/SwiftExtractorState.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ struct SwiftExtractorState {
1919
// All modules encountered during this extractor run, which therefore are dependencies of the
2020
// outcomes of this run
2121
std::unordered_set<const swift::ModuleDecl*> encounteredModules;
22+
23+
std::vector<std::filesystem::path> sourceFiles;
2224
};
2325

2426
} // namespace codeql

0 commit comments

Comments
 (0)