This avoids extracting things that are unresolved within an
`IfConfigDecl` instance:
* all conditions
* all inactive code blocks
This is meant to test out the hypothesis that this should solve some
extractor issues. If going through with it we should definitely change
the schema model for this.
Also, tests have not been updated and are expected to fail.
Add module context to all declarations. As keeping the `std::variant`s
required slightly more work for this, and we intended to remove them
any way, this is done in this change.
For background, we put those in as we were not extracting all modules at
the time, so we were missing some DB ids that we put back in by adding
the "defining" traps not only in the trap file related to the defining
module but also to the one where the declaration was used. Since then
we fixed module extraction, so this should not be needed any more.
We have found out there can be separate declarations (`VarDecl` or
`AccessorDecl`) which are effectively the same (with equal mangled name)
but come from different clang modules. This is the case for example
for glibc constants like `L_SET` that appear in both `SwiftGlibc` and
`CDispatch`.
In this patch, we simply avoid full deduplication in that case by
appending the module name to the trap key for non-swift modules.
A more solid solution should be found in the future.
Deduplication of `ConcreteVarDecl` is triggered only if its
`DeclContext` is not local. This avoids a mangled name conflict.
Also added more thourough tests for `ConcreteVarDecl` and `ParamDecl`.
As `ASTMangler` crashes when called on `ModuleDecl`, we simply use
its name.
This might probably not work reliably in a scenario where multiple
modules are compiled with the same name (like `main`), but this is left
for future work. At the moment this cannot create DB inconsistencies.
Visitor code has been split between header and sources to speed up
incremental build. Moreover the code was reorganized using a new `infra`
bazel package (and `visitors` got promoted to a bazel package as well).