mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
Swift: extract ImportDecl and ModuleDecl
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.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from
|
||||
ModuleDecl x, Type getInterfaceType, string getName, string isBuiltinModule, string isSystemModule
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() 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, "getInterfaceType:", getInterfaceType, "getName:", getName, "isBuiltinModule:",
|
||||
isBuiltinModule, "isSystemModule:", isSystemModule
|
||||
Reference in New Issue
Block a user