Files
codeql/swift/ql/test/extractor-tests/generated/decl/ModuleDecl/ModuleDecl.ql
Paolo Tranquilli 2fc88d5f8e Swift: add module to Decl and remove forward traps
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.
2022-08-23 16:53:07 +02:00

18 lines
703 B
Plaintext

// generated by codegen/codegen.py
import codeql.swift.elements
import TestUtils
from
ModuleDecl x, ModuleDecl getModule, Type getInterfaceType, string getName, string isBuiltinModule,
string isSystemModule
where
toBeTested(x) and
not x.isUnknown() and
getModule = x.getModule() and
getInterfaceType = x.getInterfaceType() and
getName = x.getName() and
(if x.isBuiltinModule() then isBuiltinModule = "yes" else isBuiltinModule = "no") and
if x.isSystemModule() then isSystemModule = "yes" else isSystemModule = "no"
select x, "getModule:", getModule, "getInterfaceType:", getInterfaceType, "getName:", getName,
"isBuiltinModule:", isBuiltinModule, "isSystemModule:", isSystemModule