mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
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.
18 lines
703 B
Plaintext
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
|