mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #9100 from redsun82/swift-tbd-rework
Swift: changes required for TBD node rework
This commit is contained in:
@@ -27,7 +27,7 @@ def _get_field(cls: schema.Class, p: schema.Property, trap_affix: str) -> cpp.Fi
|
||||
if not p.is_predicate:
|
||||
trap_name = inflection.pluralize(trap_name)
|
||||
args = dict(
|
||||
name=p.name + ("_" if p.name in cpp.cpp_keywords else ""),
|
||||
field_name=p.name + ("_" if p.name in cpp.cpp_keywords else ""),
|
||||
type=_get_type(p.type, trap_affix),
|
||||
is_optional=p.is_optional,
|
||||
is_repeated=p.is_repeated,
|
||||
|
||||
@@ -17,7 +17,7 @@ cpp_keywords = {"alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "
|
||||
|
||||
_field_overrides = [
|
||||
(re.compile(r"(start|end)_(line|column)|index|width|num_.*"), {"type": "unsigned"}),
|
||||
(re.compile(r"(.*)_"), lambda m: {"name": m[1]}),
|
||||
(re.compile(r"(.*)_"), lambda m: {"field_name": m[1]}),
|
||||
]
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def get_field_override(field: str):
|
||||
|
||||
@dataclass
|
||||
class Field:
|
||||
name: str
|
||||
field_name: str
|
||||
type: str
|
||||
is_optional: bool = False
|
||||
is_repeated: bool = False
|
||||
@@ -44,12 +44,8 @@ class Field:
|
||||
self.type = f"std::optional<{self.type}>"
|
||||
if self.is_repeated:
|
||||
self.type = f"std::vector<{self.type}>"
|
||||
|
||||
@property
|
||||
def cpp_name(self):
|
||||
if self.name in cpp_keywords:
|
||||
return self.name + "_"
|
||||
return self.name
|
||||
if self.field_name in cpp_keywords:
|
||||
self.field_name += "_"
|
||||
|
||||
# using @property breaks pystache internals here
|
||||
def get_streamer(self):
|
||||
@@ -65,8 +61,6 @@ class Field:
|
||||
return not (self.is_optional or self.is_repeated or self.is_predicate)
|
||||
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class Trap:
|
||||
table_name: str
|
||||
|
||||
@@ -92,7 +92,6 @@ def load(path):
|
||||
data = yaml.load(input, Loader=yaml.SafeLoader)
|
||||
grouper = _DirSelector(data.get("_directories", {}).items())
|
||||
classes = {root_class_name: Class(root_class_name)}
|
||||
assert root_class_name not in data
|
||||
classes.update((cls, Class(cls, dir=grouper.get(cls))) for cls in data if not cls.startswith("_"))
|
||||
for name, info in data.items():
|
||||
if name.startswith("_"):
|
||||
@@ -110,7 +109,7 @@ def load(path):
|
||||
classes[base].derived.add(name)
|
||||
elif k == "_dir":
|
||||
cls.dir = pathlib.Path(v)
|
||||
if not cls.bases:
|
||||
if not cls.bases and cls.name != root_class_name:
|
||||
cls.bases.add(root_class_name)
|
||||
classes[root_class_name].derived.add(name)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace {{namespace}} {
|
||||
|
||||
struct {{name}}{{#final}} : Binding<{{name}}Tag>{{#bases}}, {{ref.name}}{{/bases}}{{/final}}{{^final}}{{#has_bases}}: {{#bases}}{{^first}}, {{/first}}{{ref.name}}{{/bases}}{{/has_bases}}{{/final}} {
|
||||
{{#fields}}
|
||||
{{type}} {{name}}{};
|
||||
{{type}} {{field_name}}{};
|
||||
{{/fields}}
|
||||
{{#final}}
|
||||
|
||||
@@ -27,27 +27,27 @@ struct {{name}}{{#final}} : Binding<{{name}}Tag>{{#bases}}, {{ref.name}}{{/bases
|
||||
protected:
|
||||
void emit({{^final}}{{trap_affix}}Label<{{name}}Tag> id, {{/final}}std::ostream& out) const {
|
||||
{{#trap_name}}
|
||||
out << {{.}}{{trap_affix}}{id{{#single_fields}}, {{name}}{{/single_fields}}} << '\n';
|
||||
out << {{.}}{{trap_affix}}{id{{#single_fields}}, {{field_name}}{{/single_fields}}} << '\n';
|
||||
{{/trap_name}}
|
||||
{{#bases}}
|
||||
{{ref.name}}::emit(id, out);
|
||||
{{/bases}}
|
||||
{{#fields}}
|
||||
{{#is_predicate}}
|
||||
if ({{name}}) out << {{trap_name}}{{trap_affix}}{id} << '\n';
|
||||
if ({{field_name}}) out << {{trap_name}}{{trap_affix}}{id} << '\n';
|
||||
{{/is_predicate}}
|
||||
{{#is_optional}}
|
||||
{{^is_repeated}}
|
||||
if ({{name}}) out << {{trap_name}}{{trap_affix}}{id, *{{name}}} << '\n';
|
||||
if ({{field_name}}) out << {{trap_name}}{{trap_affix}}{id, *{{field_name}}} << '\n';
|
||||
{{/is_repeated}}
|
||||
{{/is_optional}}
|
||||
{{#is_repeated}}
|
||||
for (auto i = 0u; i < {{name}}.size(); ++i) {
|
||||
for (auto i = 0u; i < {{field_name}}.size(); ++i) {
|
||||
{{^is_optional}}
|
||||
out << {{trap_name}}{{trap_affix}}{id, i, {{name}}[i]};
|
||||
out << {{trap_name}}{{trap_affix}}{id, i, {{field_name}}[i]};
|
||||
{{/is_optional}}
|
||||
{{#is_optional}}
|
||||
if ({{name}}[i]) out << {{trap_name}}{{trap_affix}}{id, i, *{{name}}[i]};
|
||||
if ({{field_name}}[i]) out << {{trap_name}}{{trap_affix}}{id, i, *{{field_name}}[i]};
|
||||
{{/is_optional}}
|
||||
}
|
||||
{{/is_repeated}}
|
||||
|
||||
@@ -8,6 +8,10 @@ class {{name}}Base extends {{db_id}}{{#bases}}, {{.}}{{/bases}} {
|
||||
{{#root}}
|
||||
string toString() { none() } // overridden by subclasses
|
||||
|
||||
string getAPrimaryQlClass() { none() } // overridden by subclasses
|
||||
|
||||
final string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
|
||||
|
||||
{{name}}Base getResolveStep() { none() } // overridden by subclasses
|
||||
|
||||
{{name}}Base resolve() {
|
||||
@@ -17,7 +21,7 @@ class {{name}}Base extends {{db_id}}{{#bases}}, {{.}}{{/bases}} {
|
||||
}
|
||||
{{/root}}
|
||||
{{#final}}
|
||||
override string toString() { result = "{{name}}" }
|
||||
override string getAPrimaryQlClass() { result = "{{name}}" }
|
||||
{{/final}}
|
||||
{{#properties}}
|
||||
|
||||
@@ -32,6 +36,12 @@ class {{name}}Base extends {{db_id}}{{#bases}}, {{.}}{{/bases}} {
|
||||
{{tablename}}({{#tableparams}}{{^first}}, {{/first}}{{param}}{{/tableparams}})
|
||||
{{/type_is_class}}
|
||||
}
|
||||
{{#is_optional}}
|
||||
|
||||
predicate has{{singular}}({{#is_repeated}}int index{{/is_repeated}}) {
|
||||
exists({{getter}}({{#is_repeated}}index{{/is_repeated}}))
|
||||
}
|
||||
{{/is_optional}}
|
||||
{{#is_repeated}}
|
||||
|
||||
{{type}} {{indefinite_getter}}() {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "{{include_dir}}/{{trap_affix}}Label.h"
|
||||
#include "{{include_dir}}/{{trap_affix}}TagTraits.h"
|
||||
#include "./{{trap_affix}}Tags.h"
|
||||
|
||||
namespace {{namespace}} {
|
||||
@@ -15,19 +16,25 @@ namespace {{namespace}} {
|
||||
struct {{name}}{{trap_affix}} {
|
||||
static constexpr bool is_binding = {{#id}}true{{/id}}{{^id}}false{{/id}};
|
||||
{{#id}}
|
||||
{{type}} getBoundLabel() const { return {{cpp_name}}; }
|
||||
{{type}} getBoundLabel() const { return {{field_name}}; }
|
||||
{{/id}}
|
||||
|
||||
{{#fields}}
|
||||
{{type}} {{cpp_name}}{};
|
||||
{{type}} {{field_name}}{};
|
||||
{{/fields}}
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &out, const {{name}}{{trap_affix}} &e) {
|
||||
out << "{{table_name}}("{{#fields}}{{^first}} << ", "{{/first}}
|
||||
<< {{#get_streamer}}e.{{cpp_name}}{{/get_streamer}}{{/fields}} << ")";
|
||||
<< {{#get_streamer}}e.{{field_name}}{{/get_streamer}}{{/fields}} << ")";
|
||||
return out;
|
||||
}
|
||||
{{/traps}}
|
||||
{{#id}}
|
||||
|
||||
template <>
|
||||
struct TagToBindingTrapFunctor<typename {{type}}::Tag> {
|
||||
using type = {{name}}{{trap_affix}};
|
||||
};
|
||||
{{/id}}
|
||||
{{/traps}}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ from swift.codegen.lib import cpp
|
||||
|
||||
|
||||
@pytest.mark.parametrize("keyword", cpp.cpp_keywords)
|
||||
def test_field_keyword_cpp_name(keyword):
|
||||
def test_field_keyword_name(keyword):
|
||||
f = cpp.Field(keyword, "int")
|
||||
assert f.cpp_name == keyword + "_"
|
||||
assert f.field_name == keyword + "_"
|
||||
|
||||
|
||||
def test_field_cpp_name():
|
||||
def test_field_name():
|
||||
f = cpp.Field("foo", "int")
|
||||
assert f.cpp_name == "foo"
|
||||
assert f.field_name == "foo"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("type,expected", [
|
||||
|
||||
@@ -155,5 +155,17 @@ A:
|
||||
]
|
||||
|
||||
|
||||
def test_element_properties(load):
|
||||
ret = load("""
|
||||
Element:
|
||||
x: string
|
||||
""")
|
||||
assert ret.classes == [
|
||||
schema.Class(root_name, properties=[
|
||||
schema.SingleProperty('x', 'string'),
|
||||
]),
|
||||
]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(pytest.main([__file__] + sys.argv[1:]))
|
||||
|
||||
@@ -28,7 +28,7 @@ def get_cpp_type(schema_type: str, trap_affix: str):
|
||||
|
||||
def get_field(c: dbscheme.Column, trap_affix: str):
|
||||
args = {
|
||||
"name": c.schema_name,
|
||||
"field_name": c.schema_name,
|
||||
"type": c.type,
|
||||
}
|
||||
args.update(cpp.get_field_override(c.schema_name))
|
||||
|
||||
@@ -27,7 +27,7 @@ class UntypedTrapLabel {
|
||||
friend bool operator==(UntypedTrapLabel lhs, UntypedTrapLabel rhs) { return lhs.id_ == rhs.id_; }
|
||||
};
|
||||
|
||||
template <typename Tag>
|
||||
template <typename TagParam>
|
||||
class TrapLabel : public UntypedTrapLabel {
|
||||
template <typename OtherTag>
|
||||
friend class TrapLabel;
|
||||
@@ -35,6 +35,8 @@ class TrapLabel : public UntypedTrapLabel {
|
||||
using UntypedTrapLabel::UntypedTrapLabel;
|
||||
|
||||
public:
|
||||
using Tag = TagParam;
|
||||
|
||||
TrapLabel() = default;
|
||||
|
||||
template <typename OtherTag>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace codeql::trap {
|
||||
namespace codeql {
|
||||
|
||||
template <typename T>
|
||||
struct ToTagFunctor;
|
||||
@@ -12,4 +12,10 @@ struct ToTagOverride : ToTagFunctor<T> {};
|
||||
template <typename T>
|
||||
using ToTag = typename ToTagOverride<std::remove_const_t<T>>::type;
|
||||
|
||||
} // namespace codeql::trap
|
||||
template <typename T>
|
||||
struct TagToBindingTrapFunctor;
|
||||
|
||||
template <typename Tag>
|
||||
using TagToBindingTrap = typename TagToBindingTrapFunctor<Tag>::type;
|
||||
|
||||
} // namespace codeql
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
class ElementBase extends @element {
|
||||
string toString() { none() } // overridden by subclasses
|
||||
|
||||
string getAPrimaryQlClass() { none() } // overridden by subclasses
|
||||
|
||||
final string getPrimaryQlClasses() { result = concat(this.getAPrimaryQlClass(), ",") }
|
||||
|
||||
ElementBase getResolveStep() { none() } // overridden by subclasses
|
||||
|
||||
ElementBase resolve() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.Element
|
||||
|
||||
class FileBase extends @file, Element {
|
||||
override string toString() { result = "File" }
|
||||
override string getAPrimaryQlClass() { result = "File" }
|
||||
|
||||
string getName() { files(this, result) }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.Element
|
||||
import codeql.swift.elements.File
|
||||
|
||||
class LocationBase extends @location, Element {
|
||||
override string toString() { result = "Location" }
|
||||
override string getAPrimaryQlClass() { result = "Location" }
|
||||
|
||||
File getFile() {
|
||||
exists(File x |
|
||||
|
||||
@@ -6,7 +6,7 @@ import codeql.swift.elements.stmt.Stmt
|
||||
import codeql.swift.elements.typerepr.TypeRepr
|
||||
|
||||
class UnknownAstNodeBase extends @unknown_ast_node, Decl, Expr, Pattern, Stmt, TypeRepr {
|
||||
override string toString() { result = "UnknownAstNode" }
|
||||
override string getAPrimaryQlClass() { result = "UnknownAstNode" }
|
||||
|
||||
string getName() { unknown_ast_nodes(this, result) }
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ class AbstractFunctionDeclBase extends @abstract_function_decl, GenericContext,
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasBody() { exists(getBody()) }
|
||||
|
||||
ParamDecl getParam(int index) {
|
||||
exists(ParamDecl x |
|
||||
abstract_function_decl_params(this, index, x) and
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.FuncDecl
|
||||
|
||||
class AccessorDeclBase extends @accessor_decl, FuncDecl {
|
||||
override string toString() { result = "AccessorDecl" }
|
||||
override string getAPrimaryQlClass() { result = "AccessorDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.AbstractTypeParamDecl
|
||||
|
||||
class AssociatedTypeDeclBase extends @associated_type_decl, AbstractTypeParamDecl {
|
||||
override string toString() { result = "AssociatedTypeDecl" }
|
||||
override string getAPrimaryQlClass() { result = "AssociatedTypeDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.NominalTypeDecl
|
||||
|
||||
class ClassDeclBase extends @class_decl, NominalTypeDecl {
|
||||
override string toString() { result = "ClassDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ClassDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.FuncDecl
|
||||
|
||||
class ConcreteFuncDeclBase extends @concrete_func_decl, FuncDecl {
|
||||
override string toString() { result = "ConcreteFuncDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ConcreteFuncDecl" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.decl.VarDecl
|
||||
|
||||
class ConcreteVarDeclBase extends @concrete_var_decl, VarDecl {
|
||||
override string toString() { result = "ConcreteVarDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ConcreteVarDecl" }
|
||||
|
||||
int getIntroducerInt() { concrete_var_decls(this, result) }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.AbstractFunctionDecl
|
||||
|
||||
class ConstructorDeclBase extends @constructor_decl, AbstractFunctionDecl {
|
||||
override string toString() { result = "ConstructorDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ConstructorDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.AbstractFunctionDecl
|
||||
|
||||
class DestructorDeclBase extends @destructor_decl, AbstractFunctionDecl {
|
||||
override string toString() { result = "DestructorDecl" }
|
||||
override string getAPrimaryQlClass() { result = "DestructorDecl" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.decl.Decl
|
||||
import codeql.swift.elements.decl.EnumElementDecl
|
||||
|
||||
class EnumCaseDeclBase extends @enum_case_decl, Decl {
|
||||
override string toString() { result = "EnumCaseDecl" }
|
||||
override string getAPrimaryQlClass() { result = "EnumCaseDecl" }
|
||||
|
||||
EnumElementDecl getElement(int index) {
|
||||
exists(EnumElementDecl x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.NominalTypeDecl
|
||||
|
||||
class EnumDeclBase extends @enum_decl, NominalTypeDecl {
|
||||
override string toString() { result = "EnumDecl" }
|
||||
override string getAPrimaryQlClass() { result = "EnumDecl" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.decl.ParamDecl
|
||||
import codeql.swift.elements.decl.ValueDecl
|
||||
|
||||
class EnumElementDeclBase extends @enum_element_decl, ValueDecl {
|
||||
override string toString() { result = "EnumElementDecl" }
|
||||
override string getAPrimaryQlClass() { result = "EnumElementDecl" }
|
||||
|
||||
string getName() { enum_element_decls(this, result) }
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@ import codeql.swift.elements.decl.GenericContext
|
||||
import codeql.swift.elements.decl.IterableDeclContext
|
||||
|
||||
class ExtensionDeclBase extends @extension_decl, Decl, GenericContext, IterableDeclContext {
|
||||
override string toString() { result = "ExtensionDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ExtensionDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.AbstractTypeParamDecl
|
||||
|
||||
class GenericTypeParamDeclBase extends @generic_type_param_decl, AbstractTypeParamDecl {
|
||||
override string toString() { result = "GenericTypeParamDecl" }
|
||||
override string getAPrimaryQlClass() { result = "GenericTypeParamDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.Decl
|
||||
|
||||
class IfConfigDeclBase extends @if_config_decl, Decl {
|
||||
override string toString() { result = "IfConfigDecl" }
|
||||
override string getAPrimaryQlClass() { result = "IfConfigDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.Decl
|
||||
|
||||
class ImportDeclBase extends @import_decl, Decl {
|
||||
override string toString() { result = "ImportDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ImportDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.OperatorDecl
|
||||
|
||||
class InfixOperatorDeclBase extends @infix_operator_decl, OperatorDecl {
|
||||
override string toString() { result = "InfixOperatorDecl" }
|
||||
override string getAPrimaryQlClass() { result = "InfixOperatorDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.Decl
|
||||
|
||||
class MissingMemberDeclBase extends @missing_member_decl, Decl {
|
||||
override string toString() { result = "MissingMemberDecl" }
|
||||
override string getAPrimaryQlClass() { result = "MissingMemberDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.TypeDecl
|
||||
|
||||
class ModuleDeclBase extends @module_decl, TypeDecl {
|
||||
override string toString() { result = "ModuleDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ModuleDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.GenericTypeDecl
|
||||
|
||||
class OpaqueTypeDeclBase extends @opaque_type_decl, GenericTypeDecl {
|
||||
override string toString() { result = "OpaqueTypeDecl" }
|
||||
override string getAPrimaryQlClass() { result = "OpaqueTypeDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.VarDecl
|
||||
|
||||
class ParamDeclBase extends @param_decl, VarDecl {
|
||||
override string toString() { result = "ParamDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ParamDecl" }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import codeql.swift.elements.expr.Expr
|
||||
import codeql.swift.elements.pattern.Pattern
|
||||
|
||||
class PatternBindingDeclBase extends @pattern_binding_decl, Decl {
|
||||
override string toString() { result = "PatternBindingDecl" }
|
||||
override string getAPrimaryQlClass() { result = "PatternBindingDecl" }
|
||||
|
||||
Expr getInit(int index) {
|
||||
exists(Expr x |
|
||||
@@ -13,6 +13,8 @@ class PatternBindingDeclBase extends @pattern_binding_decl, Decl {
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasInit(int index) { exists(getInit(index)) }
|
||||
|
||||
Expr getAnInit() { result = getInit(_) }
|
||||
|
||||
Pattern getPattern(int index) {
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.OperatorDecl
|
||||
|
||||
class PostfixOperatorDeclBase extends @postfix_operator_decl, OperatorDecl {
|
||||
override string toString() { result = "PostfixOperatorDecl" }
|
||||
override string getAPrimaryQlClass() { result = "PostfixOperatorDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.Decl
|
||||
|
||||
class PoundDiagnosticDeclBase extends @pound_diagnostic_decl, Decl {
|
||||
override string toString() { result = "PoundDiagnosticDecl" }
|
||||
override string getAPrimaryQlClass() { result = "PoundDiagnosticDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.Decl
|
||||
|
||||
class PrecedenceGroupDeclBase extends @precedence_group_decl, Decl {
|
||||
override string toString() { result = "PrecedenceGroupDecl" }
|
||||
override string getAPrimaryQlClass() { result = "PrecedenceGroupDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.OperatorDecl
|
||||
|
||||
class PrefixOperatorDeclBase extends @prefix_operator_decl, OperatorDecl {
|
||||
override string toString() { result = "PrefixOperatorDecl" }
|
||||
override string getAPrimaryQlClass() { result = "PrefixOperatorDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.NominalTypeDecl
|
||||
|
||||
class ProtocolDeclBase extends @protocol_decl, NominalTypeDecl {
|
||||
override string toString() { result = "ProtocolDecl" }
|
||||
override string getAPrimaryQlClass() { result = "ProtocolDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.NominalTypeDecl
|
||||
|
||||
class StructDeclBase extends @struct_decl, NominalTypeDecl {
|
||||
override string toString() { result = "StructDecl" }
|
||||
override string getAPrimaryQlClass() { result = "StructDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.AbstractStorageDecl
|
||||
|
||||
class SubscriptDeclBase extends @subscript_decl, AbstractStorageDecl {
|
||||
override string toString() { result = "SubscriptDecl" }
|
||||
override string getAPrimaryQlClass() { result = "SubscriptDecl" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.stmt.BraceStmt
|
||||
import codeql.swift.elements.decl.Decl
|
||||
|
||||
class TopLevelCodeDeclBase extends @top_level_code_decl, Decl {
|
||||
override string toString() { result = "TopLevelCodeDecl" }
|
||||
override string getAPrimaryQlClass() { result = "TopLevelCodeDecl" }
|
||||
|
||||
BraceStmt getBody() {
|
||||
exists(BraceStmt x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.decl.GenericTypeDecl
|
||||
|
||||
class TypeAliasDeclBase extends @type_alias_decl, GenericTypeDecl {
|
||||
override string toString() { result = "TypeAliasDecl" }
|
||||
override string getAPrimaryQlClass() { result = "TypeAliasDecl" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class AnyHashableErasureExprBase extends @any_hashable_erasure_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "AnyHashableErasureExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AnyHashableErasureExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class AppliedPropertyWrapperExprBase extends @applied_property_wrapper_expr, Expr {
|
||||
override string toString() { result = "AppliedPropertyWrapperExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AppliedPropertyWrapperExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ArchetypeToSuperExprBase extends @archetype_to_super_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "ArchetypeToSuperExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ArchetypeToSuperExpr" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.Element
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class ArgumentBase extends @argument, Element {
|
||||
override string toString() { result = "Argument" }
|
||||
override string getAPrimaryQlClass() { result = "Argument" }
|
||||
|
||||
string getLabel() { arguments(this, result, _) }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.expr.CollectionExpr
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class ArrayExprBase extends @array_expr, CollectionExpr {
|
||||
override string toString() { result = "ArrayExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ArrayExpr" }
|
||||
|
||||
Expr getElement(int index) {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ArrayToPointerExprBase extends @array_to_pointer_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "ArrayToPointerExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ArrayToPointerExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class ArrowExprBase extends @arrow_expr, Expr {
|
||||
override string toString() { result = "ArrowExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ArrowExpr" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class AssignExprBase extends @assign_expr, Expr {
|
||||
override string toString() { result = "AssignExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AssignExpr" }
|
||||
|
||||
Expr getDest() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.expr.AbstractClosureExpr
|
||||
import codeql.swift.elements.stmt.BraceStmt
|
||||
|
||||
class AutoClosureExprBase extends @auto_closure_expr, AbstractClosureExpr {
|
||||
override string toString() { result = "AutoClosureExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AutoClosureExpr" }
|
||||
|
||||
BraceStmt getBody() {
|
||||
exists(BraceStmt x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.IdentityExpr
|
||||
|
||||
class AwaitExprBase extends @await_expr, IdentityExpr {
|
||||
override string toString() { result = "AwaitExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AwaitExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ApplyExpr
|
||||
|
||||
class BinaryExprBase extends @binary_expr, ApplyExpr {
|
||||
override string toString() { result = "BinaryExpr" }
|
||||
override string getAPrimaryQlClass() { result = "BinaryExpr" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class BindOptionalExprBase extends @bind_optional_expr, Expr {
|
||||
override string toString() { result = "BindOptionalExpr" }
|
||||
override string getAPrimaryQlClass() { result = "BindOptionalExpr" }
|
||||
|
||||
Expr getSubExpr() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.BuiltinLiteralExpr
|
||||
|
||||
class BooleanLiteralExprBase extends @boolean_literal_expr, BuiltinLiteralExpr {
|
||||
override string toString() { result = "BooleanLiteralExpr" }
|
||||
override string getAPrimaryQlClass() { result = "BooleanLiteralExpr" }
|
||||
|
||||
boolean getValue() { boolean_literal_exprs(this, result) }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class BridgeFromObjCExprBase extends @bridge_from_obj_c_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "BridgeFromObjCExpr" }
|
||||
override string getAPrimaryQlClass() { result = "BridgeFromObjCExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class BridgeToObjCExprBase extends @bridge_to_obj_c_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "BridgeToObjCExpr" }
|
||||
override string getAPrimaryQlClass() { result = "BridgeToObjCExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ApplyExpr
|
||||
|
||||
class CallExprBase extends @call_expr, ApplyExpr {
|
||||
override string toString() { result = "CallExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CallExpr" }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import codeql.swift.elements.expr.Expr
|
||||
import codeql.swift.elements.decl.PatternBindingDecl
|
||||
|
||||
class CaptureListExprBase extends @capture_list_expr, Expr {
|
||||
override string toString() { result = "CaptureListExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CaptureListExpr" }
|
||||
|
||||
PatternBindingDecl getBindingDecl(int index) {
|
||||
exists(PatternBindingDecl x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ClassMetatypeToObjectExprBase extends @class_metatype_to_object_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "ClassMetatypeToObjectExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ClassMetatypeToObjectExpr" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.expr.AbstractClosureExpr
|
||||
import codeql.swift.elements.stmt.BraceStmt
|
||||
|
||||
class ClosureExprBase extends @closure_expr, AbstractClosureExpr {
|
||||
override string toString() { result = "ClosureExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ClosureExpr" }
|
||||
|
||||
BraceStmt getBody() {
|
||||
exists(BraceStmt x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class CodeCompletionExprBase extends @code_completion_expr, Expr {
|
||||
override string toString() { result = "CodeCompletionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CodeCompletionExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ExplicitCastExpr
|
||||
|
||||
class CoerceExprBase extends @coerce_expr, ExplicitCastExpr {
|
||||
override string toString() { result = "CoerceExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CoerceExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class CollectionUpcastConversionExprBase extends @collection_upcast_conversion_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "CollectionUpcastConversionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CollectionUpcastConversionExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ConditionalBridgeFromObjCExprBase extends @conditional_bridge_from_obj_c_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "ConditionalBridgeFromObjCExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ConditionalBridgeFromObjCExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.CheckedCastExpr
|
||||
|
||||
class ConditionalCheckedCastExprBase extends @conditional_checked_cast_expr, CheckedCastExpr {
|
||||
override string toString() { result = "ConditionalCheckedCastExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ConditionalCheckedCastExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.SelfApplyExpr
|
||||
|
||||
class ConstructorRefCallExprBase extends @constructor_ref_call_expr, SelfApplyExpr {
|
||||
override string toString() { result = "ConstructorRefCallExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ConstructorRefCallExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class CovariantFunctionConversionExprBase extends @covariant_function_conversion_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "CovariantFunctionConversionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CovariantFunctionConversionExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class CovariantReturnConversionExprBase extends @covariant_return_conversion_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "CovariantReturnConversionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "CovariantReturnConversionExpr" }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import codeql.swift.elements.expr.Expr
|
||||
import codeql.swift.elements.type.Type
|
||||
|
||||
class DeclRefExprBase extends @decl_ref_expr, Expr {
|
||||
override string toString() { result = "DeclRefExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DeclRefExpr" }
|
||||
|
||||
Decl getDecl() {
|
||||
exists(Decl x |
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.expr.Expr
|
||||
import codeql.swift.elements.decl.ParamDecl
|
||||
|
||||
class DefaultArgumentExprBase extends @default_argument_expr, Expr {
|
||||
override string toString() { result = "DefaultArgumentExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DefaultArgumentExpr" }
|
||||
|
||||
ParamDecl getParamDecl() {
|
||||
exists(ParamDecl x |
|
||||
@@ -20,4 +20,6 @@ class DefaultArgumentExprBase extends @default_argument_expr, Expr {
|
||||
result = x.resolve()
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasCallerSideDefault() { exists(getCallerSideDefault()) }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class DerivedToBaseExprBase extends @derived_to_base_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "DerivedToBaseExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DerivedToBaseExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class DestructureTupleExprBase extends @destructure_tuple_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "DestructureTupleExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DestructureTupleExpr" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import codeql.swift.elements.expr.CollectionExpr
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class DictionaryExprBase extends @dictionary_expr, CollectionExpr {
|
||||
override string toString() { result = "DictionaryExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DictionaryExpr" }
|
||||
|
||||
Expr getElement(int index) {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class DifferentiableFunctionExprBase extends @differentiable_function_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "DifferentiableFunctionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DifferentiableFunctionExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class DifferentiableFunctionExtractOriginalExprBase extends @differentiable_function_extract_original_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "DifferentiableFunctionExtractOriginalExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DifferentiableFunctionExtractOriginalExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class DiscardAssignmentExprBase extends @discard_assignment_expr, Expr {
|
||||
override string toString() { result = "DiscardAssignmentExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DiscardAssignmentExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.IdentityExpr
|
||||
|
||||
class DotSelfExprBase extends @dot_self_expr, IdentityExpr {
|
||||
override string toString() { result = "DotSelfExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DotSelfExpr" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class DotSyntaxBaseIgnoredExprBase extends @dot_syntax_base_ignored_expr, Expr {
|
||||
override string toString() { result = "DotSyntaxBaseIgnoredExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DotSyntaxBaseIgnoredExpr" }
|
||||
|
||||
Expr getQualifier() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.SelfApplyExpr
|
||||
|
||||
class DotSyntaxCallExprBase extends @dot_syntax_call_expr, SelfApplyExpr {
|
||||
override string toString() { result = "DotSyntaxCallExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DotSyntaxCallExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.DynamicLookupExpr
|
||||
|
||||
class DynamicMemberRefExprBase extends @dynamic_member_ref_expr, DynamicLookupExpr {
|
||||
override string toString() { result = "DynamicMemberRefExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DynamicMemberRefExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.DynamicLookupExpr
|
||||
|
||||
class DynamicSubscriptExprBase extends @dynamic_subscript_expr, DynamicLookupExpr {
|
||||
override string toString() { result = "DynamicSubscriptExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DynamicSubscriptExpr" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class DynamicTypeExprBase extends @dynamic_type_expr, Expr {
|
||||
override string toString() { result = "DynamicTypeExpr" }
|
||||
override string getAPrimaryQlClass() { result = "DynamicTypeExpr" }
|
||||
|
||||
Expr getBaseExpr() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class EditorPlaceholderExprBase extends @editor_placeholder_expr, Expr {
|
||||
override string toString() { result = "EditorPlaceholderExpr" }
|
||||
override string getAPrimaryQlClass() { result = "EditorPlaceholderExpr" }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import codeql.swift.elements.expr.Expr
|
||||
import codeql.swift.elements.typerepr.TypeRepr
|
||||
|
||||
class EnumIsCaseExprBase extends @enum_is_case_expr, Expr {
|
||||
override string toString() { result = "EnumIsCaseExpr" }
|
||||
override string getAPrimaryQlClass() { result = "EnumIsCaseExpr" }
|
||||
|
||||
Expr getSubExpr() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ErasureExprBase extends @erasure_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "ErasureExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ErasureExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class ErrorExprBase extends @error_expr, Expr {
|
||||
override string toString() { result = "ErrorExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ErrorExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ExistentialMetatypeToObjectExprBase extends @existential_metatype_to_object_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "ExistentialMetatypeToObjectExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ExistentialMetatypeToObjectExpr" }
|
||||
}
|
||||
|
||||
@@ -9,4 +9,6 @@ class ExprBase extends @expr, AstNode {
|
||||
result = x.resolve()
|
||||
)
|
||||
}
|
||||
|
||||
predicate hasType() { exists(getType()) }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.NumberLiteralExpr
|
||||
|
||||
class FloatLiteralExprBase extends @float_literal_expr, NumberLiteralExpr {
|
||||
override string toString() { result = "FloatLiteralExpr" }
|
||||
override string getAPrimaryQlClass() { result = "FloatLiteralExpr" }
|
||||
|
||||
string getStringValue() { float_literal_exprs(this, result) }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.AnyTryExpr
|
||||
|
||||
class ForceTryExprBase extends @force_try_expr, AnyTryExpr {
|
||||
override string toString() { result = "ForceTryExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ForceTryExpr" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class ForceValueExprBase extends @force_value_expr, Expr {
|
||||
override string toString() { result = "ForceValueExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ForceValueExpr" }
|
||||
|
||||
Expr getSubExpr() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.CheckedCastExpr
|
||||
|
||||
class ForcedCheckedCastExprBase extends @forced_checked_cast_expr, CheckedCastExpr {
|
||||
override string toString() { result = "ForcedCheckedCastExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ForcedCheckedCastExpr" }
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class ForeignObjectConversionExprBase extends @foreign_object_conversion_expr,
|
||||
ImplicitConversionExpr {
|
||||
override string toString() { result = "ForeignObjectConversionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "ForeignObjectConversionExpr" }
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
import codeql.swift.elements.expr.ImplicitConversionExpr
|
||||
|
||||
class FunctionConversionExprBase extends @function_conversion_expr, ImplicitConversionExpr {
|
||||
override string toString() { result = "FunctionConversionExpr" }
|
||||
override string getAPrimaryQlClass() { result = "FunctionConversionExpr" }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class IfExprBase extends @if_expr, Expr {
|
||||
override string toString() { result = "IfExpr" }
|
||||
override string getAPrimaryQlClass() { result = "IfExpr" }
|
||||
|
||||
Expr getCondition() {
|
||||
exists(Expr x |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import codeql.swift.elements.expr.Expr
|
||||
|
||||
class InOutExprBase extends @in_out_expr, Expr {
|
||||
override string toString() { result = "InOutExpr" }
|
||||
override string getAPrimaryQlClass() { result = "InOutExpr" }
|
||||
|
||||
Expr getSubExpr() {
|
||||
exists(Expr x |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user