Swift: Manual changes after running code generator

This commit is contained in:
Tom Hvitved
2024-09-13 14:32:28 +02:00
parent c785cd9d7b
commit d2f633b3b4
164 changed files with 2362 additions and 1974 deletions

View File

@@ -5,6 +5,7 @@ private import codeql.swift.elements.expr.ClosureExpr
private import codeql.swift.elements.Callable
private import codeql.swift.generated.ParentChild
module Impl {
private module Cached {
private Element getEnclosingDeclStep(Element e) {
not e instanceof Decl and
@@ -82,3 +83,4 @@ class AstNode extends Generated::AstNode {
else result = Cached::getEnclosingFunction(this)
}
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.AvailabilityInfo
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* An availability condition of an `if`, `while`, or `guard` statements.
@@ -23,3 +24,4 @@ class AvailabilityInfo extends Generated::AvailabilityInfo {
result = "#unavailable" and this.isUnavailable()
}
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.Callable
private import codeql.swift.elements.AstNode
private import codeql.swift.elements.decl.Decl
module Impl {
class Callable extends Generated::Callable {
/**
* Holds if this Callable is a function named `funcName`.
@@ -17,3 +18,4 @@ class Callable extends Generated::Callable {
this.(Decl).getModule().getFullName() = moduleName
}
}
}

View File

@@ -1,35 +1,8 @@
private import codeql.swift.generated.Comment
module Impl {
class Comment extends Generated::Comment {
/** toString */
override string toString() { result = this.getText() }
}
class SingleLineComment extends Comment {
SingleLineComment() {
this.getText().matches("//%") and
not this instanceof SingleLineDocComment
}
}
class MultiLineComment extends Comment {
MultiLineComment() {
this.getText().matches("/*%") and
not this instanceof MultiLineDocComment
}
}
class DocComment extends Comment {
DocComment() {
this instanceof SingleLineDocComment or
this instanceof MultiLineDocComment
}
}
class SingleLineDocComment extends Comment {
SingleLineDocComment() { this.getText().matches("///%") }
}
class MultiLineDocComment extends Comment {
MultiLineDocComment() { this.getText().matches("/**%") }
}

View File

@@ -0,0 +1,27 @@
import Comment
final class SingleLineComment extends Comment {
SingleLineComment() {
this.getText().matches("//%") and
not this instanceof SingleLineDocComment
}
}
final class MultiLineComment extends Comment {
MultiLineComment() {
this.getText().matches("/*%") and
not this instanceof MultiLineDocComment
}
}
abstract private class DocCommentImpl extends Comment { }
final class DocComment = DocCommentImpl;
final class SingleLineDocComment extends DocCommentImpl {
SingleLineDocComment() { this.getText().matches("///%") }
}
final class MultiLineDocComment extends DocCommentImpl {
MultiLineDocComment() { this.getText().matches("/**%") }
}

View File

@@ -0,0 +1,29 @@
import Diagnostics
/**
* A compiler error message.
*/
final class CompilerError extends Diagnostics {
CompilerError() { this.getSeverity() = "error" }
}
/**
* A compiler-generated warning.
*/
final class CompilerWarning extends Diagnostics {
CompilerWarning() { this.getSeverity() = "warning" }
}
/**
* A compiler-generated note (typically attached to an error or warning).
*/
final class CompilerNote extends Diagnostics {
CompilerNote() { this.getSeverity() = "note" }
}
/**
* A compiler-generated remark (milder than a warning, this does not indicate an issue).
*/
final class CompilerRemark extends Diagnostics {
CompilerRemark() { this.getSeverity() = "remark" }
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.Diagnostics
module Impl {
/**
* A compiler-generated error, warning, note or remark.
*/
@@ -19,31 +20,4 @@ class Diagnostics extends Generated::Diagnostics {
this.getKind() = 4 and result = "remark"
}
}
/**
* A compiler error message.
*/
class CompilerError extends Diagnostics {
CompilerError() { this.getSeverity() = "error" }
}
/**
* A compiler-generated warning.
*/
class CompilerWarning extends Diagnostics {
CompilerWarning() { this.getSeverity() = "warning" }
}
/**
* A compiler-generated note (typically attached to an error or warning).
*/
class CompilerNote extends Diagnostics {
CompilerNote() { this.getSeverity() = "note" }
}
/**
* A compiler-generated remark (milder than a warning, this does not indicate an issue).
*/
class CompilerRemark extends Diagnostics {
CompilerRemark() { this.getSeverity() = "remark" }
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.Element
module Impl {
class Element extends Generated::Element {
private predicate resolvesFrom(Element e) { e.getResolveStep() = this }
@@ -18,3 +19,4 @@ class Element extends Generated::Element {
class UnknownElement extends Element {
UnknownElement() { this.isUnknown() }
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.File
private import codeql.swift.elements.Location
private import codeql.swift.elements.UnknownLocation
module Impl {
class File extends Generated::File {
/** toString */
override string toString() { result = this.getAbsolutePath() }
@@ -81,7 +82,9 @@ class File extends Generated::File {
result =
count(int line |
exists(Location loc |
not loc instanceof UnknownLocation and loc.getFile() = this and loc.getStartLine() = line
not loc instanceof UnknownLocation and
loc.getFile() = this and
loc.getStartLine() = line
)
)
}
@@ -105,3 +108,4 @@ class File extends Generated::File {
)
}
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.KeyPathComponent
private import swift
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A component of a `KeyPathExpr`.
@@ -60,3 +61,4 @@ pragma[nomagic]
private predicate hasKeyPathExprAndIndex(KeyPathExpr e, int i, KeyPathComponent c) {
e.getComponent(i) = c
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.Locatable
private import codeql.swift.elements.File
private import codeql.swift.elements.UnknownLocation
module Impl {
class Locatable extends Generated::Locatable {
pragma[nomagic]
override Location getLocation() {
@@ -16,3 +17,4 @@ class Locatable extends Generated::Locatable {
*/
File getFile() { result = this.getLocation().getFile() }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.Location
module Impl {
/**
* A location of a program element.
*/
@@ -7,7 +8,9 @@ class Location extends Generated::Location {
/**
* Holds if this location is described by `path`, `startLine`, `startColumn`, `endLine` and `endColumn`.
*/
predicate hasLocationInfo(string path, int startLine, int startColumn, int endLine, int endColumn) {
predicate hasLocationInfo(
string path, int startLine, int startColumn, int endLine, int endColumn
) {
path = this.getFile().getFullName() and
startLine = this.getStartLine() and
startColumn = this.getStartColumn() and
@@ -26,3 +29,4 @@ class Location extends Generated::Location {
)
}
}
}

View File

@@ -4,6 +4,7 @@
private import codeql.swift.generated.MacroRole
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* The role of a macro, for example #freestanding(declaration) or @attached(member).
@@ -96,5 +97,8 @@ class MacroRole extends Generated::MacroRole {
*/
predicate isAttachedMacroSyntax() { this.getMacroSyntax() = 1 }
override string toString() { result = this.getMacroSyntaxName() + "(" + this.getKindName() + ")" }
override string toString() {
result = this.getMacroSyntaxName() + "(" + this.getKindName() + ")"
}
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.OtherAvailabilitySpec
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A wildcard availability spec `*`
@@ -7,3 +8,4 @@ private import codeql.swift.generated.OtherAvailabilitySpec
class OtherAvailabilitySpec extends Generated::OtherAvailabilitySpec {
override string toString() { result = "*" }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.PlatformVersionAvailabilitySpec
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
@@ -7,3 +8,4 @@ private import codeql.swift.generated.PlatformVersionAvailabilitySpec
class PlatformVersionAvailabilitySpec extends Generated::PlatformVersionAvailabilitySpec {
override string toString() { result = this.getPlatform() + " " + this.getVersion() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.UnknownFile
module Impl {
class UnknownFile extends Generated::UnknownFile {
override string getName() { result = "" }
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.UnknownLocation
private import codeql.swift.elements.UnknownFile
private import codeql.swift.elements.File
module Impl {
/**
* A `Location` that is given to something that is not associated with any position in the source code.
*/
@@ -18,3 +19,4 @@ class UnknownLocation extends Generated::UnknownLocation {
override string toString() { result = "UnknownLocation" }
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.UnspecifiedElement
import codeql.swift.elements.Location
import codeql.swift.elements.Locatable
module Impl {
class UnspecifiedElement extends Generated::UnspecifiedElement {
override string toString() {
exists(string source, string index |
@@ -21,3 +22,4 @@ class UnspecifiedElement extends Generated::UnspecifiedElement {
override Location getLocation() { result = this.getParent().(Locatable).getLocation() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.Accessor
private import SetObserver
module Impl {
private predicate isKnownAccessorKind(Accessor decl, string kind) {
decl.isGetter() and kind = "get"
or
@@ -30,11 +32,4 @@ class Accessor extends Generated::Accessor {
result = super.toString()
}
}
class WillSetObserver extends Accessor {
WillSetObserver() { this.isWillSet() }
}
class DidSetObserver extends Accessor {
DidSetObserver() { this.isDidSet() }
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.decl.CapturedDecl
private import codeql.swift.elements.Callable
private import codeql.swift.elements.expr.DeclRefExpr
module Impl {
/**
* A captured variable or function parameter in the scope of a closure.
*/
@@ -21,3 +22,4 @@ class CapturedDecl extends Generated::CapturedDecl {
result.getDecl() = this.getDecl()
}
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.decl.Decl
private import codeql.swift.elements.decl.NominalTypeDecl
private import codeql.swift.elements.decl.ExtensionDecl
module Impl {
class Decl extends Generated::Decl {
override string toString() { result = super.toString() }
@@ -20,3 +21,4 @@ class Decl extends Generated::Decl {
*/
Decl getDeclaringDecl() { this = result.getAMember() }
}
}

View File

@@ -1,9 +1,11 @@
private import codeql.swift.generated.decl.Deinitializer
private import codeql.swift.elements.decl.Method
module Impl {
/**
* A deinitializer of a class.
*/
class Deinitializer extends Generated::Deinitializer, Method {
class Deinitializer extends Generated::Deinitializer {
override string toString() { result = this.getSelfParam().getType() + "." + super.toString() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.EnumCaseDecl
module Impl {
class EnumCaseDecl extends Generated::EnumCaseDecl {
override string toString() { result = "case ..." }
}
}

View File

@@ -3,6 +3,7 @@ private import codeql.swift.elements.decl.EnumCaseDecl
private import codeql.swift.elements.decl.EnumElementDecl
private import codeql.swift.elements.decl.Decl
module Impl {
/**
* An enumeration declaration, for example:
* ```
@@ -34,3 +35,4 @@ class EnumDecl extends Generated::EnumDecl {
result = this.getMember(_).(EnumCaseDecl).getElement(_)
}
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.decl.EnumElementDecl
private import codeql.swift.elements.decl.EnumDecl
module Impl {
/**
* An enum element declaration, for example `enumElement` and `anotherEnumElement` in:
* ```
@@ -35,3 +36,4 @@ class EnumElementDecl extends Generated::EnumElementDecl {
this.getModule().getFullName() = moduleName
}
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.decl.ExtensionDecl
module Impl {
class ExtensionDecl extends Generated::ExtensionDecl {
override string toString() {
result =
@@ -9,3 +10,4 @@ class ExtensionDecl extends Generated::ExtensionDecl {
result = "extension"
}
}
}

View File

@@ -0,0 +1,32 @@
private import VarDecl
/**
* A field declaration. That is, a variable declaration that is a member of a
* class, struct, enum or protocol.
*/
final class FieldDecl extends VarDecl {
FieldDecl() { this = any(Decl ctx).getAMember() }
/**
* Holds if this field is called `fieldName` and is a member of a
* class, struct, extension, enum or protocol called `typeName`.
*/
cached
predicate hasQualifiedName(string typeName, string fieldName) {
this.getName() = fieldName and
exists(Decl d |
d.asNominalTypeDecl().getFullName() = typeName and
d.getAMember() = this
)
}
/**
* Holds if this field is called `fieldName` and is a member of a
* class, struct, extension, enum or protocol called `typeName` in a module
* called `moduleName`.
*/
predicate hasQualifiedName(string moduleName, string typeName, string fieldName) {
this.hasQualifiedName(typeName, fieldName) and
this.getModule().getFullName() = moduleName
}
}

View File

@@ -0,0 +1,9 @@
private import Function
private import Method
/**
* A free (non-member) function.
*/
final class FreeFunction extends Function {
FreeFunction() { not this instanceof Method }
}

View File

@@ -1,10 +1,11 @@
private import codeql.swift.generated.decl.Function
private import codeql.swift.elements.decl.Method
module Impl {
/**
* A function.
*/
class Function extends Generated::Function, Callable {
class Function extends Generated::Function {
override string toString() { result = this.getName() }
/**
@@ -24,3 +25,4 @@ class Function extends Generated::Function, Callable {
class FreeFunction extends Function {
FreeFunction() { not this instanceof Method }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.IfConfigDecl
module Impl {
class IfConfigDecl extends Generated::IfConfigDecl {
override string toString() { result = "#if ..." }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.ImportDecl
module Impl {
class ImportDecl extends Generated::ImportDecl {
override string toString() { result = "import ..." }
}
}

View File

@@ -1,12 +1,14 @@
private import codeql.swift.generated.decl.Initializer
private import codeql.swift.elements.decl.Method
private import codeql.swift.elements.decl.MethodImpl::Impl as MethodImpl
private import codeql.swift.elements.type.FunctionType
private import codeql.swift.elements.type.OptionalType
module Impl {
/**
* An initializer of a class, struct, enum or protocol.
*/
class Initializer extends Generated::Initializer, Method {
class Initializer extends Generated::Initializer, MethodImpl::Method {
override string toString() { result = this.getSelfParam().getType() + "." + super.toString() }
/** Holds if this initializer returns an optional type. Failable initializers are written as `init?`. */
@@ -15,3 +17,4 @@ class Initializer extends Generated::Initializer, Method {
OptionalType
}
}
}

View File

@@ -1,60 +1,3 @@
private import swift
private import MethodImpl
private Decl getAMember(Decl ctx) {
ctx.getAMember() = result
or
exists(VarDecl var |
ctx.getAMember() = var and
var.getAnAccessor() = result
)
}
/**
* A function that is a member of a class, struct, enum or protocol.
*/
final class Method extends Function {
Method() {
this = getAMember(any(ClassDecl c))
or
this = getAMember(any(StructDecl c))
or
this = getAMember(any(ExtensionDecl c))
or
this = getAMember(any(EnumDecl c))
or
this = getAMember(any(ProtocolDecl c))
}
/**
* Holds if this function is called `funcName` and is a member of a
* class, struct, extension, enum or protocol called `typeName`.
*/
cached
predicate hasQualifiedName(string typeName, string funcName) {
this.getName() = funcName and
exists(Decl d |
d.asNominalTypeDecl().getFullName() = typeName and
d.getAMember() = this
)
}
/**
* Holds if this function is called `funcName` and is a member of a
* class, struct, extension, enum or protocol called `typeName` in a module
* called `moduleName`.
*/
predicate hasQualifiedName(string moduleName, string typeName, string funcName) {
this.hasQualifiedName(typeName, funcName) and
this.getModule().getFullName() = moduleName
}
/**
* Holds if this function is a `static` or `class` method, as opposed to an instance method.
*/
predicate isStaticOrClassMethod() { this.getSelfParam().getType() instanceof MetatypeType }
/**
* Holds if this function is an instance method, as opposed to a `static` or `class` method.
*/
predicate isInstanceMethod() { not this.isStaticOrClassMethod() }
}
final class Method = Impl::Method;

View File

@@ -0,0 +1,63 @@
private import swift
private import codeql.swift.elements.decl.FunctionImpl::Impl as FunctionImpl
module Impl {
private Decl getAMember(Decl ctx) {
ctx.getAMember() = result
or
exists(VarDecl var |
ctx.getAMember() = var and
var.getAnAccessor() = result
)
}
/**
* A function that is a member of a class, struct, enum or protocol.
*/
class Method extends FunctionImpl::Function {
Method() {
this = getAMember(any(ClassDecl c))
or
this = getAMember(any(StructDecl c))
or
this = getAMember(any(ExtensionDecl c))
or
this = getAMember(any(EnumDecl c))
or
this = getAMember(any(ProtocolDecl c))
}
/**
* Holds if this function is called `funcName` and is a member of a
* class, struct, extension, enum or protocol called `typeName`.
*/
cached
predicate hasQualifiedName(string typeName, string funcName) {
this.getName() = funcName and
exists(Decl d |
d.asNominalTypeDecl().getFullName() = typeName and
d.getAMember() = this
)
}
/**
* Holds if this function is called `funcName` and is a member of a
* class, struct, extension, enum or protocol called `typeName` in a module
* called `moduleName`.
*/
predicate hasQualifiedName(string moduleName, string typeName, string funcName) {
this.hasQualifiedName(typeName, funcName) and
this.getModule().getFullName() = moduleName
}
/**
* Holds if this function is a `static` or `class` method, as opposed to an instance method.
*/
predicate isStaticOrClassMethod() { this.getSelfParam().getType() instanceof MetatypeType }
/**
* Holds if this function is an instance method, as opposed to a `static` or `class` method.
*/
predicate isInstanceMethod() { not this.isStaticOrClassMethod() }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.decl.MissingMemberDecl
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A placeholder for missing declarations that can arise on object deserialization.
@@ -7,3 +8,4 @@ private import codeql.swift.generated.decl.MissingMemberDecl
class MissingMemberDecl extends Generated::MissingMemberDecl {
override string toString() { result = this.getName() + " (missing)" }
}
}

View File

@@ -1,6 +1,8 @@
private import codeql.swift.generated.decl.NominalTypeDecl
module Impl {
/**
* A class, struct, enum or protocol.
*/
class NominalTypeDecl extends Generated::NominalTypeDecl { }
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.OperatorDecl
module Impl {
class OperatorDecl extends Generated::OperatorDecl {
override string toString() { result = this.getName() }
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.decl.ParamDecl
private import codeql.swift.elements.Callable
module Impl {
class ParamDecl extends Generated::ParamDecl {
/** Gets the function which declares this parameter. */
Callable getDeclaringFunction() { result.getAParam() = this }
@@ -22,3 +23,4 @@ class SelfParamDecl extends ParamDecl {
override int getIndex() { result = -1 }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.PatternBindingDecl
module Impl {
class PatternBindingDecl extends Generated::PatternBindingDecl {
override string toString() { result = "var ... = ..." }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.decl.PoundDiagnosticDecl
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A diagnostic directive, which is either `#error` or `#warning`.
@@ -15,3 +16,4 @@ class PoundDiagnosticDecl extends Generated::PoundDiagnosticDecl {
predicate isWarning() { this.getKind() = 2 }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.PrecedenceGroupDecl
module Impl {
class PrecedenceGroupDecl extends Generated::PrecedenceGroupDecl {
override string toString() { result = "precedencegroup ..." }
}
}

View File

@@ -0,0 +1,3 @@
private import ParamDeclImpl
final class SelfParamDecl = Impl::SelfParamDecl;

View File

@@ -0,0 +1,9 @@
private import Accessor
final class WillSetObserver extends Accessor {
WillSetObserver() { this.isWillSet() }
}
class DidSetObserver extends Accessor {
DidSetObserver() { this.isDidSet() }
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.SubscriptDecl
module Impl {
class SubscriptDecl extends Generated::SubscriptDecl {
override string toString() { result = "subscript ..." }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.decl.TopLevelCodeDecl
module Impl {
class TopLevelCodeDecl extends Generated::TopLevelCodeDecl {
override string toString() { result = this.getBody().toString() }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.decl.TypeAliasDecl
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A declaration of a type alias to another type. For example:
@@ -8,3 +9,4 @@ private import codeql.swift.generated.decl.TypeAliasDecl
* ```
*/
class TypeAliasDecl extends Generated::TypeAliasDecl { }
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.decl.TypeDecl
private import codeql.swift.elements.type.AnyGenericType
private import swift
module Impl {
/**
* A Swift type declaration, for example a class, struct, enum or protocol
* declaration.
@@ -25,7 +26,9 @@ class TypeDecl extends Generated::TypeDecl {
* This is the same as `getImmediateInheritedType`.
* DEPRECATED: either use `getImmediateInheritedType` or unindexed `getABaseType`.
*/
deprecated Type getImmediateBaseType(int index) { result = this.getImmediateInheritedType(index) }
deprecated Type getImmediateBaseType(int index) {
result = this.getImmediateInheritedType(index)
}
/**
* Gets the `index`th base type of this type declaration (0-based).
@@ -108,7 +111,9 @@ class TypeDecl extends Generated::TypeDecl {
result = this.getEnclosingDecl().(TypeDecl).getFullName() + "." + this.getName()
or
result =
unique(NominalTypeDecl td | td = this.getEnclosingDecl().(ExtensionDecl).getExtendedTypeDecl())
.getFullName() + "." + this.getName()
unique(NominalTypeDecl td |
td = this.getEnclosingDecl().(ExtensionDecl).getExtendedTypeDecl()
).getFullName() + "." + this.getName()
}
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.decl.ValueDecl
private import codeql.swift.elements.decl.CapturedDecl
private import codeql.swift.elements.expr.DeclRefExpr
module Impl {
/**
* A declaration that introduces a value with a type.
*/
@@ -21,3 +22,4 @@ class ValueDecl extends Generated::ValueDecl {
*/
DeclRefExpr getAnAccess() { result.getDecl() = this }
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.decl.VarDecl
private import codeql.swift.elements.decl.Decl
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A declaration of a variable such as
@@ -54,3 +55,4 @@ class FieldDecl extends VarDecl {
this.getModule().getFullName() = moduleName
}
}
}

View File

@@ -6,6 +6,7 @@ private import codeql.swift.elements.expr.DotSyntaxBaseIgnoredExpr
private import codeql.swift.elements.expr.AutoClosureExpr
private import codeql.swift.elements.decl.Method
module Impl {
class ApplyExpr extends Generated::ApplyExpr {
Callable getStaticTarget() { result = this.getFunction().(DeclRefExpr).getDecl() }
@@ -57,3 +58,4 @@ private class FullDotSyntaxBaseIgnoredApplyExpr extends ApplyExpr {
override AutoClosureExpr getStaticTarget() { result = expr.getStaticTarget().getExpr() }
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.expr.Argument
private import codeql.swift.elements.expr.ApplyExpr
module Impl {
class Argument extends Generated::Argument {
override string toString() { result = this.getLabel() + ": " + this.getExpr().toString() }
@@ -8,3 +9,4 @@ class Argument extends Generated::Argument {
ApplyExpr getApplyExpr() { result.getAnArgument() = this }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.ArrayExpr
module Impl {
class ArrayExpr extends Generated::ArrayExpr {
override string toString() { result = "[...]" }
}
}

View File

@@ -1,6 +1,8 @@
private import codeql.swift.generated.expr.AssignExpr
private import codeql.swift.elements.expr.BinaryExpr
private import codeql.swift.elements.expr.BinaryExprImpl::Impl
private import codeql.swift.elements.expr.ExprImpl::Impl as ExprImpl
module Impl {
/**
* An assignment expression. For example:
* ```
@@ -9,24 +11,14 @@ private import codeql.swift.elements.expr.BinaryExpr
* z <<= 1
* ```
*/
class Assignment extends Expr {
Assignment() {
this instanceof AssignExpr or
this instanceof AssignArithmeticOperationEx or
this instanceof AssignBitwiseOperationEx or
this instanceof AssignPointwiseOperationEx
}
abstract class Assignment extends ExprImpl::Expr {
/**
* Gets the destination of this assignment. For example `x` in:
* ```
* x = y
* ```
*/
Expr getDest() {
result = this.(AssignExpr).getDest() or
result = this.(AssignOperation).getLeftOperand()
}
abstract Expr getDest();
/**
* Gets the source of this assignment. For example `y` in:
@@ -34,10 +26,7 @@ class Assignment extends Expr {
* x = y
* ```
*/
Expr getSource() {
result = this.(AssignExpr).getSource() or
result = this.(AssignOperation).getRightOperand()
}
abstract Expr getSource();
/**
* Holds if this assignment expression uses an overflow operator, that is,
@@ -62,6 +51,12 @@ class AssignExpr extends Generated::AssignExpr {
override string toString() { result = " ... = ..." }
}
private class AssignExprAssignment extends Assignment instanceof AssignExpr {
override Expr getDest() { result = AssignExpr.super.getDest() }
override Expr getSource() { result = AssignExpr.super.getSource() }
}
/**
* An assignment expression apart from `=`. For example:
* ```
@@ -69,12 +64,10 @@ class AssignExpr extends Generated::AssignExpr {
* y &= z
* ```
*/
class AssignOperation extends Assignment, BinaryExpr {
AssignOperation() {
this instanceof AssignArithmeticOperationEx or
this instanceof AssignBitwiseOperationEx or
this instanceof AssignPointwiseOperationEx
}
abstract class AssignOperation extends Assignment, BinaryExpr {
override Expr getDest() { result = this.getLeftOperand() }
override Expr getSource() { result = this.getRightOperand() }
}
/**
@@ -84,12 +77,7 @@ class AssignOperation extends Assignment, BinaryExpr {
* y *= z
* ```
*/
class AssignArithmeticOperation extends AssignOperation instanceof AssignArithmeticOperationEx { }
/**
* Private abstract class, extended to define the scope of `AssignArithmeticOperation`.
*/
abstract private class AssignArithmeticOperationEx extends BinaryExpr { }
abstract class AssignArithmeticOperation extends AssignOperation { }
/**
* A bitwise assignment expression. For example:
@@ -98,12 +86,7 @@ abstract private class AssignArithmeticOperationEx extends BinaryExpr { }
* z <<= 1
* ```
*/
class AssignBitwiseOperation extends AssignOperation instanceof AssignBitwiseOperationEx { }
/**
* Private abstract class, extended to define the scope of `AssignBitwiseOperation`.
*/
abstract private class AssignBitwiseOperationEx extends BinaryExpr { }
abstract class AssignBitwiseOperation extends AssignOperation { }
/**
* A pointwise assignment expression. For example:
@@ -111,12 +94,7 @@ abstract private class AssignBitwiseOperationEx extends BinaryExpr { }
* x .&= y
* ```
*/
class AssignPointwiseOperation extends AssignOperation instanceof AssignPointwiseOperationEx { }
/**
* Private abstract class, extended to define the scope of `AssignPointwiseOperation`.
*/
abstract private class AssignPointwiseOperationEx extends BinaryExpr { }
abstract class AssignPointwiseOperation extends AssignOperation { }
/**
* An addition assignment expression:
@@ -125,7 +103,7 @@ abstract private class AssignPointwiseOperationEx extends BinaryExpr { }
* a &+= b
* ```
*/
class AssignAddExpr extends AssignArithmeticOperationEx {
class AssignAddExpr extends AssignArithmeticOperation {
AssignAddExpr() { this.getOperator().getName() = ["+=(_:_:)", "&+=(_:_:)"] }
}
@@ -136,7 +114,7 @@ class AssignAddExpr extends AssignArithmeticOperationEx {
* a &-= b
* ```
*/
class AssignSubExpr extends AssignArithmeticOperationEx {
class AssignSubExpr extends AssignArithmeticOperation {
AssignSubExpr() { this.getOperator().getName() = ["-=(_:_:)", "&-=(_:_:)"] }
}
@@ -147,7 +125,7 @@ class AssignSubExpr extends AssignArithmeticOperationEx {
* a &*= b
* ```
*/
class AssignMulExpr extends AssignArithmeticOperationEx {
class AssignMulExpr extends AssignArithmeticOperation {
AssignMulExpr() { this.getOperator().getName() = ["*=(_:_:)", "&*=(_:_:)"] }
}
@@ -157,7 +135,7 @@ class AssignMulExpr extends AssignArithmeticOperationEx {
* a /= b
* ```
*/
class AssignDivExpr extends AssignArithmeticOperationEx {
class AssignDivExpr extends AssignArithmeticOperation {
AssignDivExpr() { this.getOperator().getName() = "/=(_:_:)" }
}
@@ -167,7 +145,7 @@ class AssignDivExpr extends AssignArithmeticOperationEx {
* a %= b
* ```
*/
class AssignRemExpr extends AssignArithmeticOperationEx {
class AssignRemExpr extends AssignArithmeticOperation {
AssignRemExpr() { this.getOperator().getName() = "%=(_:_:)" }
}
@@ -178,7 +156,7 @@ class AssignRemExpr extends AssignArithmeticOperationEx {
* a &<<= b
* ```
*/
class AssignLShiftExpr extends AssignBitwiseOperationEx {
class AssignLShiftExpr extends AssignBitwiseOperation {
AssignLShiftExpr() { this.getOperator().getName() = ["<<=(_:_:)", "&<<=(_:_:)"] }
}
@@ -189,7 +167,7 @@ class AssignLShiftExpr extends AssignBitwiseOperationEx {
* a &>>= b
* ```
*/
class AssignRShiftExpr extends AssignBitwiseOperationEx {
class AssignRShiftExpr extends AssignBitwiseOperation {
AssignRShiftExpr() { this.getOperator().getName() = [">>=(_:_:)", "&>>=(_:_:)"] }
}
@@ -199,7 +177,7 @@ class AssignRShiftExpr extends AssignBitwiseOperationEx {
* a &= b
* ```
*/
class AssignAndExpr extends AssignBitwiseOperationEx {
class AssignAndExpr extends AssignBitwiseOperation {
AssignAndExpr() { this.getOperator().getName() = "&=(_:_:)" }
}
@@ -209,7 +187,7 @@ class AssignAndExpr extends AssignBitwiseOperationEx {
* a |= b
* ```
*/
class AssignOrExpr extends AssignBitwiseOperationEx {
class AssignOrExpr extends AssignBitwiseOperation {
AssignOrExpr() { this.getOperator().getName() = "|=(_:_:)" }
}
@@ -219,7 +197,7 @@ class AssignOrExpr extends AssignBitwiseOperationEx {
* a ^= b
* ```
*/
class AssignXorExpr extends AssignBitwiseOperationEx {
class AssignXorExpr extends AssignBitwiseOperation {
AssignXorExpr() { this.getOperator().getName() = "^=(_:_:)" }
}
@@ -229,7 +207,7 @@ class AssignXorExpr extends AssignBitwiseOperationEx {
* a .&= b
* ```
*/
class AssignPointwiseAndExpr extends AssignPointwiseOperationEx {
class AssignPointwiseAndExpr extends AssignPointwiseOperation {
AssignPointwiseAndExpr() { this.getOperator().getName() = ".&=(_:_:)" }
}
@@ -239,7 +217,7 @@ class AssignPointwiseAndExpr extends AssignPointwiseOperationEx {
* a .|= b
* ```
*/
class AssignPointwiseOrExpr extends AssignPointwiseOperationEx {
class AssignPointwiseOrExpr extends AssignPointwiseOperation {
AssignPointwiseOrExpr() { this.getOperator().getName() = ".|=(_:_:)" }
}
@@ -249,6 +227,7 @@ class AssignPointwiseOrExpr extends AssignPointwiseOperationEx {
* a .^= b
* ```
*/
class AssignPointwiseXorExpr extends AssignPointwiseOperationEx {
class AssignPointwiseXorExpr extends AssignPointwiseOperation {
AssignPointwiseXorExpr() { this.getOperator().getName() = ".^=(_:_:)" }
}
}

View File

@@ -0,0 +1,37 @@
private import AssignExprImpl
final class Assignment = Impl::Assignment;
final class AssignOperation = Impl::AssignOperation;
final class AssignArithmeticOperation = Impl::AssignArithmeticOperation;
final class AssignBitwiseOperation = Impl::AssignBitwiseOperation;
final class AssignPointwiseOperation = Impl::AssignPointwiseOperation;
final class AssignAddExpr = Impl::AssignAddExpr;
final class AssignSubExpr = Impl::AssignSubExpr;
final class AssignMulExpr = Impl::AssignMulExpr;
final class AssignDivExpr = Impl::AssignDivExpr;
final class AssignRemExpr = Impl::AssignRemExpr;
final class AssignLShiftExpr = Impl::AssignLShiftExpr;
final class AssignRShiftExpr = Impl::AssignRShiftExpr;
final class AssignAndExpr = Impl::AssignAndExpr;
final class AssignOrExpr = Impl::AssignOrExpr;
final class AssignXorExpr = Impl::AssignXorExpr;
final class AssignPointwiseAndExpr = Impl::AssignPointwiseAndExpr;
final class AssignPointwiseOrExpr = Impl::AssignPointwiseOrExpr;
final class AssignPointwiseXorExpr = Impl::AssignPointwiseXorExpr;

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.expr.AutoClosureExpr
private import codeql.swift.elements.stmt.ReturnStmt
private import codeql.swift.elements.expr.Expr
module Impl {
/**
* A Swift autoclosure expression, that is, a closure automatically generated
* around an argument when the parameter has the `@autoclosure` attribute or
@@ -28,3 +29,4 @@ class AutoClosureExpr extends Generated::AutoClosureExpr {
override string toString() { result = this.getBody().toString() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.AwaitExpr
module Impl {
class AwaitExpr extends Generated::AwaitExpr {
override string toString() { result = "await ..." }
}
}

View File

@@ -2,6 +2,7 @@ private import codeql.swift.generated.expr.BinaryExpr
private import codeql.swift.elements.expr.Expr
private import codeql.swift.elements.decl.Function
module Impl {
/**
* A Swift binary expression, that is, an expression that appears between its
* two operands. For example:
@@ -34,3 +35,4 @@ class BinaryExpr extends Generated::BinaryExpr {
override Function getStaticTarget() { result = super.getStaticTarget() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.BindOptionalExpr
module Impl {
class BindOptionalExpr extends Generated::BindOptionalExpr {
override string toString() { result = "...?" }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.BooleanLiteralExpr
module Impl {
/**
* A boolean literal. For example `true` in:
* ```
@@ -11,3 +12,4 @@ class BooleanLiteralExpr extends Generated::BooleanLiteralExpr {
override string getValueString() { result = this.getValue().toString() }
}
}

View File

@@ -4,6 +4,7 @@
private import codeql.swift.generated.expr.BuiltinLiteralExpr
module Impl {
/**
* A Swift literal of a kind that is built in to the Swift language.
*/
@@ -13,3 +14,4 @@ class BuiltinLiteralExpr extends Generated::BuiltinLiteralExpr {
*/
string getValueString() { none() }
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.expr.CaptureListExpr
private import codeql.swift.elements.pattern.NamedPattern
module Impl {
class CaptureListExpr extends Generated::CaptureListExpr {
override string toString() { result = this.getClosureBody().toString() }
@@ -9,3 +10,4 @@ class CaptureListExpr extends Generated::CaptureListExpr {
result = this.getBindingDecl(index).getPattern(0).(NamedPattern).getVarDecl()
}
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.ClosureExpr
module Impl {
class ClosureExpr extends Generated::ClosureExpr {
override string toString() { result = "{ ... }" }
}
}

View File

@@ -1,6 +1,7 @@
private import codeql.swift.generated.expr.DeclRefExpr
private import codeql.swift.elements.decl.CapturedDecl
module Impl {
/**
* An expression that references or accesses a declaration.
*/
@@ -21,3 +22,4 @@ class DeclRefExpr extends Generated::DeclRefExpr {
*/
predicate hasCapturedDecl() { exists(this.getCapturedDecl()) }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DefaultArgumentExpr
module Impl {
class DefaultArgumentExpr extends Generated::DefaultArgumentExpr {
override string toString() { result = "default " + this.getParamDecl().getName() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DictionaryExpr
module Impl {
class DictionaryExpr extends Generated::DictionaryExpr {
override string toString() { result = "[...]" }
}
}

View File

@@ -1,4 +1,6 @@
private import codeql.swift.generated.expr.DifferentiableFunctionExtractOriginalExpr
module Impl {
class DifferentiableFunctionExtractOriginalExpr extends Generated::DifferentiableFunctionExtractOriginalExpr
{ }
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DiscardAssignmentExpr
module Impl {
class DiscardAssignmentExpr extends Generated::DiscardAssignmentExpr {
override string toString() { result = "_" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DotSelfExpr
module Impl {
class DotSelfExpr extends Generated::DotSelfExpr {
override string toString() { result = ".self" }
}
}

View File

@@ -4,6 +4,7 @@ private import codeql.swift.elements.expr.CallExpr
private import codeql.swift.elements.expr.TypeExpr
private import codeql.swift.elements.decl.Method
module Impl {
/**
* An expression representing a partially applied lookup of an instance property via the receiver's type object.
*
@@ -39,3 +40,4 @@ class DotSyntaxBaseIgnoredExpr extends Generated::DotSyntaxBaseIgnoredExpr {
.getStaticTarget()
}
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DynamicMemberRefExpr
module Impl {
class DynamicMemberRefExpr extends Generated::DynamicMemberRefExpr {
override string toString() { result = "." + this.getMember().toString() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DynamicSubscriptExpr
module Impl {
class DynamicSubscriptExpr extends Generated::DynamicSubscriptExpr {
override string toString() { result = this.getMember().toString() + "[...]" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.DynamicTypeExpr
module Impl {
class DynamicTypeExpr extends Generated::DynamicTypeExpr {
override string toString() { result = "type(of: ...)" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.EnumIsCaseExpr
module Impl {
class EnumIsCaseExpr extends Generated::EnumIsCaseExpr {
override string toString() { result = "... is " + this.getElement().toString() }
}
}

View File

@@ -1,7 +1,9 @@
private import codeql.swift.generated.expr.ExplicitCastExpr
module Impl {
class ExplicitCastExpr extends Generated::ExplicitCastExpr {
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
override string toString() { result = "(" + this.getType() + ") ..." }
}
}

View File

@@ -1,8 +1,10 @@
private import codeql.swift.generated.expr.ExplicitClosureExpr
module Impl {
/**
* A Swift explicit closure expr, that is, a closure written using
* `{ ... -> ... in ... }` syntax rather than automatically generated by the
* compiler.
*/
class ExplicitClosureExpr extends Generated::ExplicitClosureExpr { }
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.Expr
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* The base class for all expressions in Swift.
@@ -25,3 +26,4 @@ class Expr extends Generated::Expr {
Expr getUnconverted() { result = this.resolve() }
}
}

View File

@@ -1,7 +1,9 @@
private import codeql.swift.generated.expr.FloatLiteralExpr
module Impl {
class FloatLiteralExpr extends Generated::FloatLiteralExpr {
override string toString() { result = this.getStringValue() }
override string getValueString() { result = this.getStringValue() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.ForceTryExpr
module Impl {
class ForceTryExpr extends Generated::ForceTryExpr {
override string toString() { result = "try! ..." }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.ForceValueExpr
module Impl {
class ForceValueExpr extends Generated::ForceValueExpr {
override string toString() { result = "...!" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.IdentityExpr
module Impl {
class IdentityExpr extends Generated::IdentityExpr {
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.IfExpr
module Impl {
class IfExpr extends Generated::IfExpr {
Expr getBranch(boolean b) {
b = true and
@@ -11,3 +12,4 @@ class IfExpr extends Generated::IfExpr {
override string toString() { result = "... ? ... : ..." }
}
}

View File

@@ -1,7 +1,9 @@
private import codeql.swift.generated.expr.ImplicitConversionExpr
module Impl {
class ImplicitConversionExpr extends Generated::ImplicitConversionExpr {
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
override string toString() { result = "(" + this.getType().toString() + ") ..." }
}
}

View File

@@ -1,7 +1,9 @@
private import codeql.swift.generated.expr.InOutExpr
module Impl {
class InOutExpr extends Generated::InOutExpr {
override string toString() { result = "&..." }
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.IntegerLiteralExpr
module Impl {
/**
* An integer literal. For example `1` in:
* ```
@@ -11,3 +12,4 @@ class IntegerLiteralExpr extends Generated::IntegerLiteralExpr {
override string getValueString() { result = this.getStringValue() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.InterpolatedStringLiteralExpr
module Impl {
class InterpolatedStringLiteralExpr extends Generated::InterpolatedStringLiteralExpr {
override string toString() { result = "\"...\"" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.IsExpr
module Impl {
class IsExpr extends Generated::IsExpr {
override string toString() { result = "... is ..." }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.KeyPathApplicationExpr
module Impl {
class KeyPathApplicationExpr extends Generated::KeyPathApplicationExpr {
override string toString() { result = "\\...[...]" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.KeyPathDotExpr
module Impl {
class KeyPathDotExpr extends Generated::KeyPathDotExpr {
override string toString() { result = "\\...." }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.KeyPathExpr
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A key-path expression.
@@ -7,3 +8,4 @@ private import codeql.swift.generated.expr.KeyPathExpr
class KeyPathExpr extends Generated::KeyPathExpr {
override string toString() { result = "#keyPath(...)" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.LazyInitializationExpr
module Impl {
class LazyInitializationExpr extends Generated::LazyInitializationExpr {
override string toString() { result = this.getSubExpr().toString() }
}
}

View File

@@ -4,9 +4,11 @@
private import codeql.swift.generated.expr.LiteralExpr
module Impl {
/**
* A Swift literal.
*
* This is the root class for all literals.
*/
class LiteralExpr extends Generated::LiteralExpr { }
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.MagicIdentifierLiteralExpr
module Impl {
/**
* An identifier literal that is expanded at compile time. For example `#file` in:
* ```
@@ -11,3 +12,4 @@ class MagicIdentifierLiteralExpr extends Generated::MagicIdentifierLiteralExpr {
override string getValueString() { none() } // TODO: value not yet extracted
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.MakeTemporarilyEscapableExpr
module Impl {
class MakeTemporarilyEscapableExpr extends Generated::MakeTemporarilyEscapableExpr {
override string toString() { result = this.getSubExpr().toString() }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.MemberRefExpr
module Impl {
class MemberRefExpr extends Generated::MemberRefExpr {
override string toString() { result = "." + this.getMember().toString() }
}
}

View File

@@ -0,0 +1,3 @@
private import ApplyExprImpl
final class MethodApplyExpr = Impl::MethodApplyExpr;

View File

@@ -1,4 +1,4 @@
private import ApplyExprExt
private import MethodApplyExpr
private import codeql.swift.elements.expr.CallExpr
private import codeql.swift.elements.expr.ApplyExpr
private import codeql.swift.elements.expr.SuperRefExpr

View File

@@ -7,6 +7,7 @@ private import codeql.swift.elements.decl.Method
private import codeql.swift.generated.Raw
private import codeql.swift.generated.Synth
module Impl {
class MethodLookupExpr extends Generated::MethodLookupExpr {
override string toString() { result = "." + this.getMember().toString() }
@@ -29,3 +30,4 @@ class MethodLookupExpr extends Generated::MethodLookupExpr {
cached
private Raw::SelfApplyExpr getUnderlying() { this = Synth::TMethodLookupExpr(result) }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.NilLiteralExpr
module Impl {
class NilLiteralExpr extends Generated::NilLiteralExpr {
override string toString() { result = "nil" }
}
}

View File

@@ -1,5 +1,7 @@
private import codeql.swift.generated.expr.ObjCSelectorExpr
module Impl {
class ObjCSelectorExpr extends Generated::ObjCSelectorExpr {
override string toString() { result = "#selector(...)" }
}
}

View File

@@ -1,5 +1,6 @@
private import codeql.swift.generated.expr.ObjectLiteralExpr
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* An instance of `#fileLiteral`, `#imageLiteral` or `#colorLiteral` expressions, which are used in playgrounds.
@@ -23,3 +24,4 @@ class ColorLiteralExpr extends ObjectLiteralExpr {
override string toString() { result = "#colorLiteral(...)" }
}
}

Some files were not shown because too many files have changed in this diff Show More