#pragma once #include #include #include #include "swift/extractor/trap/generated/TrapEntries.h" #include "swift/extractor/infra/file/PathHash.h" namespace codeql { class TrapDomain; class SwiftLocationExtractor { public: explicit SwiftLocationExtractor(TrapDomain& trap) : trap(trap) {} void attachLocation(const swift::SourceManager& sourceManager, swift::SourceLoc start, swift::SourceLoc end, TrapLabel locatableLabel); void emitFile(llvm::StringRef path); private: TrapLabel fetchFileLabel(const std::filesystem::path& file); TrapDomain& trap; std::unordered_map> store; }; } // namespace codeql