mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Swift: move location extraction logic into a separate class
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "swift/extractor/infra/TargetDomains.h"
|
||||
#include "swift/extractor/SwiftBuiltinSymbols.h"
|
||||
#include "swift/extractor/infra/file/Path.h"
|
||||
#include "swift/extractor/infra/SwiftLocationExtractor.h"
|
||||
|
||||
using namespace codeql;
|
||||
using namespace std::string_literals;
|
||||
@@ -139,7 +140,9 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
|
||||
}
|
||||
}
|
||||
|
||||
SwiftVisitor visitor(compiler.getSourceMgr(), *trap, module, primaryFile);
|
||||
SwiftLocationExtractor locationExtractor(*trap);
|
||||
locationExtractor.emitFile(primaryFile);
|
||||
SwiftVisitor visitor(compiler.getSourceMgr(), *trap, locationExtractor, module, primaryFile);
|
||||
auto topLevelDecls = getTopLevelDecls(module, primaryFile);
|
||||
for (auto decl : topLevelDecls) {
|
||||
visitor.extract(decl);
|
||||
|
||||
Reference in New Issue
Block a user