mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Swift: add preliminary logging to dispatcher
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "swift/extractor/infra/SwiftLocationExtractor.h"
|
||||
#include "swift/extractor/infra/SwiftBodyEmissionStrategy.h"
|
||||
#include "swift/extractor/config/SwiftExtractorState.h"
|
||||
#include "swift/extractor/infra/log/SwiftLogging.h"
|
||||
|
||||
namespace codeql {
|
||||
|
||||
@@ -151,7 +152,13 @@ class SwiftDispatcher {
|
||||
return *l;
|
||||
}
|
||||
waitingForNewLabel = e;
|
||||
// TODO: more generic and informational visiting one-line log
|
||||
if constexpr (std::is_convertible_v<E, const swift::ValueDecl*>) {
|
||||
const swift::ValueDecl* x = e;
|
||||
LOG_TRACE("{}", x->getName().getBaseIdentifier().str());
|
||||
}
|
||||
visit(e, std::forward<Args>(args)...);
|
||||
Log::flush();
|
||||
// TODO when everything is moved to structured C++ classes, this should be moved to createEntry
|
||||
if (auto l = store.get(e)) {
|
||||
if constexpr (IsLocatable<E>) {
|
||||
@@ -329,6 +336,7 @@ class SwiftDispatcher {
|
||||
SwiftBodyEmissionStrategy& bodyEmissionStrategy;
|
||||
Store::Handle waitingForNewLabel{std::monostate{}};
|
||||
std::unordered_set<swift::ModuleDecl*> encounteredModules;
|
||||
Logger logger{"dispatcher"};
|
||||
};
|
||||
|
||||
} // namespace codeql
|
||||
|
||||
Reference in New Issue
Block a user