mirror of
https://github.com/github/codeql.git
synced 2026-04-20 06:24:03 +02:00
Swift: Cache Element.toString
This commit is contained in:
2
swift/ql/.generated.list
generated
2
swift/ql/.generated.list
generated
@@ -701,7 +701,7 @@ lib/codeql/swift/generated/Comment.qll 64625f47ebddb1ec7e1c81790dd8120087a76958c
|
||||
lib/codeql/swift/generated/DbFile.qll cc0d2b9efbee36080bde2e26e424a40efb763eaee55874fb6c4a5db36938f3df 33e215d838cfa36e3dd0e62879e896d988430d1470a87ce1bb45aad70886212b
|
||||
lib/codeql/swift/generated/DbLocation.qll e2c7cc975b53cfb0061e055da082fbe57c0aef388e5ee874f0ff22c388a81ce1 1939414bc5d574796e83ab916408c3183210ead04957b50493610529700e0427
|
||||
lib/codeql/swift/generated/Diagnostics.qll 03ea201db80d33b18f7f6c71267044c695c2572e5783ab754fa7c7ac27e16ee3 8aa78be37a8f23e4b899b910508fd5966ebc98fade6c284d59d59e246de18288
|
||||
lib/codeql/swift/generated/Element.qll 129b5fedbb36bf9157fe8fa9388e7afeb11f73c3b850b100a08b564f993b067d eebbbac92d5ea5116cd575eb9b8e26d3ff7e5e35de648f37cab586a3191b413f
|
||||
lib/codeql/swift/generated/Element.qll ee383d0b3be3ae1f58142980011476ce6f317550f96548403f9ecd352ee72cd9 ef4a8e175d327b44b147814ad9630ca54c53f21fc2bab7d8a88d1e220060c0a7
|
||||
lib/codeql/swift/generated/ErrorElement.qll b39bd7c8b4e2011f4a6889e073ebf5b628db32f36f50b067250ae730d9f26561 fd859ec969ba434049e7ba4e78271cc8cebc8b058d2e96e4d47a22064cbb5a21
|
||||
lib/codeql/swift/generated/File.qll 476ac95566ef0080e0ad8c3da144b1be1d945d2f33a24f0864d85ff7c56a09b1 3134018bb50166cbf2690f64bba551cace350e4a7e6e25bcded18f997ad1835b
|
||||
lib/codeql/swift/generated/KeyPathComponent.qll 5276acdc9a4ff0ec0cc8af615c04043391fb99613731ddcc86db4e47b37c8c5a ccc0931bbd6cc2cfae5037c2ee17bbdcbd87536f5fed90d07e73065c016c4382
|
||||
|
||||
@@ -25,11 +25,11 @@ module Impl {
|
||||
this instanceof WillSetObserver or this instanceof DidSetObserver
|
||||
}
|
||||
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
isKnownAccessorKind(this, result)
|
||||
or
|
||||
not isKnownAccessorKind(this, _) and
|
||||
result = super.toString()
|
||||
result = super.toStringImpl()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ module Impl {
|
||||
* A captured variable or function parameter in the scope of a closure.
|
||||
*/
|
||||
class CapturedDecl extends Generated::CapturedDecl {
|
||||
override string toString() { result = this.getDecl().toString() }
|
||||
override string toStringImpl() { result = this.getDecl().toStringImpl() }
|
||||
|
||||
/**
|
||||
* Gets the closure or function that captures this variable.
|
||||
|
||||
@@ -4,7 +4,8 @@ private import codeql.swift.elements.decl.ExtensionDecl
|
||||
|
||||
module Impl {
|
||||
class Decl extends Generated::Decl {
|
||||
override string toString() { result = super.toString() }
|
||||
// needed to avoid spurious non-monotonicity error
|
||||
override string toStringImpl() { result = super.toStringImpl() }
|
||||
|
||||
/**
|
||||
* Gets the `NominalTypeDecl` corresponding to this `Decl`, if any. This
|
||||
|
||||
@@ -6,6 +6,8 @@ module Impl {
|
||||
* A deinitializer of a class.
|
||||
*/
|
||||
class Deinitializer extends Generated::Deinitializer {
|
||||
override string toString() { result = this.getSelfParam().getType() + "." + super.toString() }
|
||||
override string toStringImpl() {
|
||||
result = this.getSelfParam().getType().toStringImpl() + "." + super.toStringImpl()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.EnumCaseDecl
|
||||
|
||||
module Impl {
|
||||
class EnumCaseDecl extends Generated::EnumCaseDecl {
|
||||
override string toString() { result = "case ..." }
|
||||
override string toStringImpl() { result = "case ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class EnumElementDecl extends Generated::EnumElementDecl {
|
||||
override string toString() { result = this.getName() }
|
||||
override string toStringImpl() { result = this.getName() }
|
||||
|
||||
/**
|
||||
* Holds if this enum element declaration is called `enumElementName` and is a member of an
|
||||
|
||||
@@ -2,9 +2,10 @@ private import codeql.swift.generated.decl.ExtensionDecl
|
||||
|
||||
module Impl {
|
||||
class ExtensionDecl extends Generated::ExtensionDecl {
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
result =
|
||||
"extension of " + unique(NominalTypeDecl td | td = this.getExtendedTypeDecl()).toString()
|
||||
"extension of " +
|
||||
unique(NominalTypeDecl td | td = this.getExtendedTypeDecl()).toStringImpl()
|
||||
or
|
||||
count(this.getExtendedTypeDecl()) != 1 and
|
||||
result = "extension"
|
||||
|
||||
@@ -6,7 +6,7 @@ module Impl {
|
||||
* A function.
|
||||
*/
|
||||
class Function extends Generated::Function {
|
||||
override string toString() { result = this.getName() }
|
||||
override string toStringImpl() { result = this.getName() }
|
||||
|
||||
/**
|
||||
* Gets the name of this function, without the argument list. For example
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.IfConfigDecl
|
||||
|
||||
module Impl {
|
||||
class IfConfigDecl extends Generated::IfConfigDecl {
|
||||
override string toString() { result = "#if ..." }
|
||||
override string toStringImpl() { result = "#if ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.ImportDecl
|
||||
|
||||
module Impl {
|
||||
class ImportDecl extends Generated::ImportDecl {
|
||||
override string toString() { result = "import ..." }
|
||||
override string toStringImpl() { result = "import ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ module Impl {
|
||||
* An initializer of a class, struct, enum or protocol.
|
||||
*/
|
||||
class Initializer extends Generated::Initializer, MethodImpl::Method {
|
||||
override string toString() { result = this.getSelfParam().getType() + "." + super.toString() }
|
||||
override string toStringImpl() {
|
||||
result = this.getSelfParam().getType().toStringImpl() + "." + super.toStringImpl()
|
||||
}
|
||||
|
||||
/** Holds if this initializer returns an optional type. Failable initializers are written as `init?`. */
|
||||
predicate isFailable() {
|
||||
|
||||
@@ -6,6 +6,6 @@ module Impl {
|
||||
* A placeholder for missing declarations that can arise on object deserialization.
|
||||
*/
|
||||
class MissingMemberDecl extends Generated::MissingMemberDecl {
|
||||
override string toString() { result = this.getName() + " (missing)" }
|
||||
override string toStringImpl() { result = this.getName() + " (missing)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.OperatorDecl
|
||||
|
||||
module Impl {
|
||||
class OperatorDecl extends Generated::OperatorDecl {
|
||||
override string toString() { result = this.getName() }
|
||||
override string toStringImpl() { result = this.getName() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.PatternBindingDecl
|
||||
|
||||
module Impl {
|
||||
class PatternBindingDecl extends Generated::PatternBindingDecl {
|
||||
override string toString() { result = "var ... = ..." }
|
||||
override string toStringImpl() { result = "var ... = ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ module Impl {
|
||||
* A diagnostic directive, which is either `#error` or `#warning`.
|
||||
*/
|
||||
class PoundDiagnosticDecl extends Generated::PoundDiagnosticDecl {
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
this.isError() and result = "#error(...)"
|
||||
or
|
||||
this.isWarning() and result = "#warning(...)"
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.PrecedenceGroupDecl
|
||||
|
||||
module Impl {
|
||||
class PrecedenceGroupDecl extends Generated::PrecedenceGroupDecl {
|
||||
override string toString() { result = "precedencegroup ..." }
|
||||
override string toStringImpl() { result = "precedencegroup ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.SubscriptDecl
|
||||
|
||||
module Impl {
|
||||
class SubscriptDecl extends Generated::SubscriptDecl {
|
||||
override string toString() { result = "subscript ..." }
|
||||
override string toStringImpl() { result = "subscript ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.decl.TopLevelCodeDecl
|
||||
|
||||
module Impl {
|
||||
class TopLevelCodeDecl extends Generated::TopLevelCodeDecl {
|
||||
override string toString() { result = this.getBody().toString() }
|
||||
override string toStringImpl() { result = this.getBody().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ module Impl {
|
||||
* have type declarations.
|
||||
*/
|
||||
class TypeDecl extends Generated::TypeDecl {
|
||||
override string toString() { result = this.getName() }
|
||||
override string toStringImpl() { result = this.getName() }
|
||||
|
||||
/**
|
||||
* Gets the `index`th base type of this type declaration (0-based).
|
||||
|
||||
@@ -22,7 +22,7 @@ module Impl {
|
||||
* * ...
|
||||
*/
|
||||
class VarDecl extends Generated::VarDecl {
|
||||
override string toString() { result = this.getName() }
|
||||
override string toStringImpl() { result = this.getName() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ private import codeql.swift.elements.decl.Initializer
|
||||
final private class InitializerLookupExprImpl extends Impl::MethodLookupExpr {
|
||||
InitializerLookupExprImpl() { super.getMethod() instanceof Initializer }
|
||||
|
||||
override string toString() { result = this.getMember().toString() }
|
||||
override string toStringImpl() { result = this.getMember().toString() }
|
||||
}
|
||||
|
||||
final class InitializerLookupExpr extends MethodLookupExpr, InitializerLookupExprImpl {
|
||||
|
||||
@@ -21,8 +21,8 @@ module Impl {
|
||||
result.getLabel() = label
|
||||
}
|
||||
|
||||
override string toString() {
|
||||
result = "call to " + this.getStaticTarget().toString()
|
||||
override string toStringImpl() {
|
||||
result = "call to " + this.getStaticTarget().toStringImpl()
|
||||
or
|
||||
not exists(this.getStaticTarget()) and
|
||||
result = "call to ..."
|
||||
@@ -48,7 +48,7 @@ module Impl {
|
||||
|
||||
override Expr getQualifier() { result = expr.getQualifier() }
|
||||
|
||||
override string toString() { result = "call to " + expr }
|
||||
override string toStringImpl() { result = "call to " + expr }
|
||||
}
|
||||
|
||||
private class FullDotSyntaxBaseIgnoredApplyExpr extends ApplyExpr {
|
||||
|
||||
@@ -3,7 +3,9 @@ private import codeql.swift.elements.expr.ApplyExpr
|
||||
|
||||
module Impl {
|
||||
class Argument extends Generated::Argument {
|
||||
override string toString() { result = this.getLabel() + ": " + this.getExpr().toString() }
|
||||
override string toStringImpl() {
|
||||
result = this.getLabel() + ": " + this.getExpr().toStringImpl()
|
||||
}
|
||||
|
||||
int getIndex() { any(ApplyExpr apply).getArgument(result) = this }
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.ArrayExpr
|
||||
|
||||
module Impl {
|
||||
class ArrayExpr extends Generated::ArrayExpr {
|
||||
override string toString() { result = "[...]" }
|
||||
override string toStringImpl() { result = "[...]" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class AssignExpr extends Generated::AssignExpr {
|
||||
override string toString() { result = " ... = ..." }
|
||||
override string toStringImpl() { result = " ... = ..." }
|
||||
}
|
||||
|
||||
private class AssignExprAssignment extends Assignment instanceof AssignExpr {
|
||||
|
||||
@@ -27,6 +27,6 @@ module Impl {
|
||||
*/
|
||||
Expr getExpr() { result = this.getReturn().getResult() }
|
||||
|
||||
override string toString() { result = this.getBody().toString() }
|
||||
override string toStringImpl() { result = this.getBody().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.AwaitExpr
|
||||
|
||||
module Impl {
|
||||
class AwaitExpr extends Generated::AwaitExpr {
|
||||
override string toString() { result = "await ..." }
|
||||
override string toStringImpl() { result = "await ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ module Impl {
|
||||
*/
|
||||
Expr getAnOperand() { result = [this.getLeftOperand(), this.getRightOperand()] }
|
||||
|
||||
override string toString() { result = "... " + this.getFunction().toString() + " ..." }
|
||||
override string toStringImpl() { result = "... " + this.getFunction().toStringImpl() + " ..." }
|
||||
|
||||
override Function getStaticTarget() { result = super.getStaticTarget() }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.BindOptionalExpr
|
||||
|
||||
module Impl {
|
||||
class BindOptionalExpr extends Generated::BindOptionalExpr {
|
||||
override string toString() { result = "...?" }
|
||||
override string toStringImpl() { result = "...?" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class BooleanLiteralExpr extends Generated::BooleanLiteralExpr {
|
||||
override string toString() { result = this.getValue().toString() }
|
||||
override string toStringImpl() { result = this.getValue().toString() }
|
||||
|
||||
override string getValueString() { result = this.getValue().toString() }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ private import codeql.swift.elements.pattern.NamedPattern
|
||||
|
||||
module Impl {
|
||||
class CaptureListExpr extends Generated::CaptureListExpr {
|
||||
override string toString() { result = this.getClosureBody().toString() }
|
||||
override string toStringImpl() { result = this.getClosureBody().toStringImpl() }
|
||||
|
||||
override VarDecl getVariable(int index) {
|
||||
// all capture binding declarations consist of a single named pattern
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.ClosureExpr
|
||||
|
||||
module Impl {
|
||||
class ClosureExpr extends Generated::ClosureExpr {
|
||||
override string toString() { result = "{ ... }" }
|
||||
override string toStringImpl() { result = "{ ... }" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ module Impl {
|
||||
* An expression that references or accesses a declaration.
|
||||
*/
|
||||
class DeclRefExpr extends Generated::DeclRefExpr {
|
||||
override string toString() {
|
||||
if exists(this.getDecl().toString())
|
||||
then result = this.getDecl().toString()
|
||||
override string toStringImpl() {
|
||||
if exists(this.getDecl().toStringImpl())
|
||||
then result = this.getDecl().toStringImpl()
|
||||
else result = "(unknown declaration)"
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DefaultArgumentExpr
|
||||
|
||||
module Impl {
|
||||
class DefaultArgumentExpr extends Generated::DefaultArgumentExpr {
|
||||
override string toString() { result = "default " + this.getParamDecl().getName() }
|
||||
override string toStringImpl() { result = "default " + this.getParamDecl().getName() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DictionaryExpr
|
||||
|
||||
module Impl {
|
||||
class DictionaryExpr extends Generated::DictionaryExpr {
|
||||
override string toString() { result = "[...]" }
|
||||
override string toStringImpl() { result = "[...]" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DiscardAssignmentExpr
|
||||
|
||||
module Impl {
|
||||
class DiscardAssignmentExpr extends Generated::DiscardAssignmentExpr {
|
||||
override string toString() { result = "_" }
|
||||
override string toStringImpl() { result = "_" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DotSelfExpr
|
||||
|
||||
module Impl {
|
||||
class DotSelfExpr extends Generated::DotSelfExpr {
|
||||
override string toString() { result = ".self" }
|
||||
override string toStringImpl() { result = ".self" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ module Impl {
|
||||
* which in turn can be accessed using the `getSubExpr/0` predicate.
|
||||
*/
|
||||
class DotSyntaxBaseIgnoredExpr extends Generated::DotSyntaxBaseIgnoredExpr {
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
result =
|
||||
any(string base |
|
||||
if exists(this.getQualifier().(TypeExpr).getTypeRepr().toString())
|
||||
then base = this.getQualifier().(TypeExpr).getTypeRepr().toString() + "."
|
||||
if exists(this.getQualifier().(TypeExpr).getTypeRepr().toStringImpl())
|
||||
then base = this.getQualifier().(TypeExpr).getTypeRepr().toStringImpl() + "."
|
||||
else base = "."
|
||||
) + this.getMethod()
|
||||
) + this.getMethod().toStringImpl()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DynamicMemberRefExpr
|
||||
|
||||
module Impl {
|
||||
class DynamicMemberRefExpr extends Generated::DynamicMemberRefExpr {
|
||||
override string toString() { result = "." + this.getMember().toString() }
|
||||
override string toStringImpl() { result = "." + this.getMember().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DynamicSubscriptExpr
|
||||
|
||||
module Impl {
|
||||
class DynamicSubscriptExpr extends Generated::DynamicSubscriptExpr {
|
||||
override string toString() { result = this.getMember().toString() + "[...]" }
|
||||
override string toStringImpl() { result = this.getMember().toStringImpl() + "[...]" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.DynamicTypeExpr
|
||||
|
||||
module Impl {
|
||||
class DynamicTypeExpr extends Generated::DynamicTypeExpr {
|
||||
override string toString() { result = "type(of: ...)" }
|
||||
override string toStringImpl() { result = "type(of: ...)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.EnumIsCaseExpr
|
||||
|
||||
module Impl {
|
||||
class EnumIsCaseExpr extends Generated::EnumIsCaseExpr {
|
||||
override string toString() { result = "... is " + this.getElement().toString() }
|
||||
override string toStringImpl() { result = "... is " + this.getElement().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ module Impl {
|
||||
class ExplicitCastExpr extends Generated::ExplicitCastExpr {
|
||||
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
|
||||
|
||||
override string toString() { result = "(" + this.getType() + ") ..." }
|
||||
override string toStringImpl() { result = "(" + this.getType() + ") ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ private import codeql.swift.generated.expr.FloatLiteralExpr
|
||||
|
||||
module Impl {
|
||||
class FloatLiteralExpr extends Generated::FloatLiteralExpr {
|
||||
override string toString() { result = this.getStringValue() }
|
||||
override string toStringImpl() { result = this.getStringValue() }
|
||||
|
||||
override string getValueString() { result = this.getStringValue() }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.ForceTryExpr
|
||||
|
||||
module Impl {
|
||||
class ForceTryExpr extends Generated::ForceTryExpr {
|
||||
override string toString() { result = "try! ..." }
|
||||
override string toStringImpl() { result = "try! ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.ForceValueExpr
|
||||
|
||||
module Impl {
|
||||
class ForceValueExpr extends Generated::ForceValueExpr {
|
||||
override string toString() { result = "...!" }
|
||||
override string toStringImpl() { result = "...!" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ module Impl {
|
||||
result = this.getElseExpr()
|
||||
}
|
||||
|
||||
override string toString() { result = "... ? ... : ..." }
|
||||
override string toStringImpl() { result = "... ? ... : ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ module Impl {
|
||||
class ImplicitConversionExpr extends Generated::ImplicitConversionExpr {
|
||||
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
|
||||
|
||||
override string toString() { result = "(" + this.getType().toString() + ") ..." }
|
||||
override string toStringImpl() { result = "(" + this.getType().toStringImpl() + ") ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ private import codeql.swift.generated.expr.InOutExpr
|
||||
|
||||
module Impl {
|
||||
class InOutExpr extends Generated::InOutExpr {
|
||||
override string toString() { result = "&..." }
|
||||
override string toStringImpl() { result = "&..." }
|
||||
|
||||
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class IntegerLiteralExpr extends Generated::IntegerLiteralExpr {
|
||||
override string toString() { result = this.getStringValue() }
|
||||
override string toStringImpl() { result = this.getStringValue() }
|
||||
|
||||
override string getValueString() { result = this.getStringValue() }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.InterpolatedStringLiteralExpr
|
||||
|
||||
module Impl {
|
||||
class InterpolatedStringLiteralExpr extends Generated::InterpolatedStringLiteralExpr {
|
||||
override string toString() { result = "\"...\"" }
|
||||
override string toStringImpl() { result = "\"...\"" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.IsExpr
|
||||
|
||||
module Impl {
|
||||
class IsExpr extends Generated::IsExpr {
|
||||
override string toString() { result = "... is ..." }
|
||||
override string toStringImpl() { result = "... is ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.KeyPathApplicationExpr
|
||||
|
||||
module Impl {
|
||||
class KeyPathApplicationExpr extends Generated::KeyPathApplicationExpr {
|
||||
override string toString() { result = "\\...[...]" }
|
||||
override string toStringImpl() { result = "\\...[...]" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.KeyPathDotExpr
|
||||
|
||||
module Impl {
|
||||
class KeyPathDotExpr extends Generated::KeyPathDotExpr {
|
||||
override string toString() { result = "\\...." }
|
||||
override string toStringImpl() { result = "\\...." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ module Impl {
|
||||
* A key-path expression.
|
||||
*/
|
||||
class KeyPathExpr extends Generated::KeyPathExpr {
|
||||
override string toString() { result = "#keyPath(...)" }
|
||||
override string toStringImpl() { result = "#keyPath(...)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.LazyInitializationExpr
|
||||
|
||||
module Impl {
|
||||
class LazyInitializationExpr extends Generated::LazyInitializationExpr {
|
||||
override string toString() { result = this.getSubExpr().toString() }
|
||||
override string toStringImpl() { result = this.getSubExpr().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class MagicIdentifierLiteralExpr extends Generated::MagicIdentifierLiteralExpr {
|
||||
override string toString() { result = "#..." }
|
||||
override string toStringImpl() { result = "#..." }
|
||||
|
||||
override string getValueString() { none() } // TODO: value not yet extracted
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.MakeTemporarilyEscapableExpr
|
||||
|
||||
module Impl {
|
||||
class MakeTemporarilyEscapableExpr extends Generated::MakeTemporarilyEscapableExpr {
|
||||
override string toString() { result = this.getSubExpr().toString() }
|
||||
override string toStringImpl() { result = this.getSubExpr().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.MemberRefExpr
|
||||
|
||||
module Impl {
|
||||
class MemberRefExpr extends Generated::MemberRefExpr {
|
||||
override string toString() { result = "." + this.getMember().toString() }
|
||||
override string toStringImpl() { result = "." + this.getMember().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ private import codeql.swift.generated.Synth
|
||||
|
||||
module Impl {
|
||||
class MethodLookupExpr extends Generated::MethodLookupExpr {
|
||||
override string toString() { result = "." + this.getMember().toString() }
|
||||
override string toStringImpl() { result = "." + this.getMember().toStringImpl() }
|
||||
|
||||
override Expr getImmediateBase() {
|
||||
result = Synth::convertExprFromRaw(this.getUnderlying().getBase())
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.NilLiteralExpr
|
||||
|
||||
module Impl {
|
||||
class NilLiteralExpr extends Generated::NilLiteralExpr {
|
||||
override string toString() { result = "nil" }
|
||||
override string toStringImpl() { result = "nil" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.ObjCSelectorExpr
|
||||
|
||||
module Impl {
|
||||
class ObjCSelectorExpr extends Generated::ObjCSelectorExpr {
|
||||
override string toString() { result = "#selector(...)" }
|
||||
override string toStringImpl() { result = "#selector(...)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,18 +10,18 @@ module Impl {
|
||||
class FileLiteralExpr extends ObjectLiteralExpr {
|
||||
FileLiteralExpr() { this.getKind() = 0 }
|
||||
|
||||
override string toString() { result = "#fileLiteral(...)" }
|
||||
override string toStringImpl() { result = "#fileLiteral(...)" }
|
||||
}
|
||||
|
||||
class ImageLiteralExpr extends ObjectLiteralExpr {
|
||||
ImageLiteralExpr() { this.getKind() = 1 }
|
||||
|
||||
override string toString() { result = "#imageLiteral(...)" }
|
||||
override string toStringImpl() { result = "#imageLiteral(...)" }
|
||||
}
|
||||
|
||||
class ColorLiteralExpr extends ObjectLiteralExpr {
|
||||
ColorLiteralExpr() { this.getKind() = 2 }
|
||||
|
||||
override string toString() { result = "#colorLiteral(...)" }
|
||||
override string toStringImpl() { result = "#colorLiteral(...)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ module Impl {
|
||||
class OneWayExpr extends Generated::OneWayExpr {
|
||||
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
|
||||
|
||||
override string toString() { result = this.getSubExpr().toString() }
|
||||
override string toStringImpl() { result = this.getSubExpr().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.OptionalTryExpr
|
||||
|
||||
module Impl {
|
||||
class OptionalTryExpr extends Generated::OptionalTryExpr {
|
||||
override string toString() { result = "try? ..." }
|
||||
override string toStringImpl() { result = "try? ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.OtherInitializerRefExpr
|
||||
|
||||
module Impl {
|
||||
class OtherInitializerRefExpr extends Generated::OtherInitializerRefExpr {
|
||||
override string toString() { result = this.getInitializer().toString() }
|
||||
override string toStringImpl() { result = this.getInitializer().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.ParenExpr
|
||||
|
||||
module Impl {
|
||||
class ParenExpr extends Generated::ParenExpr {
|
||||
override string toString() { result = "(...)" }
|
||||
override string toStringImpl() { result = "(...)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.RebindSelfInInitializerExpr
|
||||
|
||||
module Impl {
|
||||
class RebindSelfInInitializerExpr extends Generated::RebindSelfInInitializerExpr {
|
||||
override string toString() { result = "self = ..." }
|
||||
override string toStringImpl() { result = "self = ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ module Impl {
|
||||
* A regular expression literal which is checked at compile time, for example `/a(a|b)*b/`.
|
||||
*/
|
||||
class RegexLiteralExpr extends Generated::RegexLiteralExpr {
|
||||
override string toString() { result = this.getPattern() }
|
||||
override string toStringImpl() { result = this.getPattern() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class StringLiteralExpr extends Generated::StringLiteralExpr {
|
||||
override string toString() { result = this.getValue() }
|
||||
override string toStringImpl() { result = this.getValue() }
|
||||
|
||||
override string getValueString() { result = this.getValue() }
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
override string toString() { result = "...[...]" }
|
||||
override string toStringImpl() { result = "...[...]" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ private import codeql.swift.elements.decl.Method
|
||||
module Impl {
|
||||
/** A reference to `super`. */
|
||||
class SuperRefExpr extends Generated::SuperRefExpr {
|
||||
override string toString() { result = "super" }
|
||||
override string toStringImpl() { result = "super" }
|
||||
|
||||
Method getDeclaringMethod() { this.getSelf() = result.getSelfParam() }
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.TryExpr
|
||||
|
||||
module Impl {
|
||||
class TryExpr extends Generated::TryExpr {
|
||||
override string toString() { result = "try ..." }
|
||||
override string toStringImpl() { result = "try ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.TupleElementExpr
|
||||
|
||||
module Impl {
|
||||
class TupleElementExpr extends Generated::TupleElementExpr {
|
||||
override string toString() { result = "." + this.getIndex() }
|
||||
override string toStringImpl() { result = "." + this.getIndex() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.TupleExpr
|
||||
|
||||
module Impl {
|
||||
class TupleExpr extends Generated::TupleExpr {
|
||||
override string toString() { result = "(...)" }
|
||||
override string toStringImpl() { result = "(...)" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.TypeExpr
|
||||
|
||||
module Impl {
|
||||
class TypeExpr extends Generated::TypeExpr {
|
||||
override string toString() { result = this.getType().toString() }
|
||||
override string toStringImpl() { result = this.getType().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ private import codeql.swift.generated.expr.UnresolvedDeclRefExpr
|
||||
|
||||
module Impl {
|
||||
class UnresolvedDeclRefExpr extends Generated::UnresolvedDeclRefExpr {
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
result = this.getName() + " (unresolved)"
|
||||
or
|
||||
not this.hasName() and result = "(unresolved)"
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.UnresolvedDotExpr
|
||||
|
||||
module Impl {
|
||||
class UnresolvedDotExpr extends Generated::UnresolvedDotExpr {
|
||||
override string toString() { result = "... ." + this.getName() }
|
||||
override string toStringImpl() { result = "... ." + this.getName() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.expr.VarargExpansionExpr
|
||||
|
||||
module Impl {
|
||||
class VarargExpansionExpr extends Generated::VarargExpansionExpr {
|
||||
override string toString() { result = this.getSubExpr().toString() }
|
||||
override string toStringImpl() { result = this.getSubExpr().toStringImpl() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ module Impl {
|
||||
* ```
|
||||
*/
|
||||
class AvailabilityInfo extends Generated::AvailabilityInfo {
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
result = "#available" and not this.isUnavailable()
|
||||
or
|
||||
result = "#unavailable" and this.isUnavailable()
|
||||
|
||||
@@ -3,6 +3,6 @@ private import codeql.swift.generated.Comment
|
||||
module Impl {
|
||||
class Comment extends Generated::Comment {
|
||||
/** toString */
|
||||
override string toString() { result = this.getText() }
|
||||
override string toStringImpl() { result = this.getText() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ module Impl {
|
||||
* A compiler-generated error, warning, note or remark.
|
||||
*/
|
||||
class Diagnostics extends Generated::Diagnostics {
|
||||
override string toString() { result = this.getSeverity() + ": " + this.getText() }
|
||||
override string toStringImpl() { result = this.getSeverity() + ": " + this.getText() }
|
||||
|
||||
/**
|
||||
* Gets a string representing the severity of this compiler diagnostic.
|
||||
|
||||
@@ -4,7 +4,7 @@ module Impl {
|
||||
class Element extends Generated::Element {
|
||||
private predicate resolvesFrom(Element e) { e.getResolveStep() = this }
|
||||
|
||||
override string toString() { result = this.getPrimaryQlClasses() }
|
||||
override string toStringImpl() { result = this.getPrimaryQlClasses() }
|
||||
|
||||
Element getFullyUnresolved() {
|
||||
not this.resolvesFrom(_) and result = this
|
||||
|
||||
@@ -5,7 +5,7 @@ private import codeql.swift.elements.UnknownLocation
|
||||
module Impl {
|
||||
class File extends Generated::File {
|
||||
/** toString */
|
||||
override string toString() { result = this.getAbsolutePath() }
|
||||
override string toStringImpl() { result = this.getAbsolutePath() }
|
||||
|
||||
/** Gets the absolute path of this file. */
|
||||
string getAbsolutePath() { result = this.getName() }
|
||||
|
||||
@@ -21,7 +21,7 @@ module Impl {
|
||||
/**
|
||||
* Gets a textual representation of this location.
|
||||
*/
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
exists(string filePath, int startLine, int startColumn, int endLine, int endColumn |
|
||||
this.hasLocationInfo(filePath, startLine, startColumn, endLine, endColumn)
|
||||
|
|
||||
|
||||
@@ -97,7 +97,7 @@ module Impl {
|
||||
*/
|
||||
predicate isAttachedMacroSyntax() { this.getMacroSyntax() = 1 }
|
||||
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
result = this.getMacroSyntaxName() + "(" + this.getKindName() + ")"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ module Impl {
|
||||
* A wildcard availability spec `*`
|
||||
*/
|
||||
class OtherAvailabilitySpec extends Generated::OtherAvailabilitySpec {
|
||||
override string toString() { result = "*" }
|
||||
override string toStringImpl() { result = "*" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ module Impl {
|
||||
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
|
||||
*/
|
||||
class PlatformVersionAvailabilitySpec extends Generated::PlatformVersionAvailabilitySpec {
|
||||
override string toString() { result = this.getPlatform() + " " + this.getVersion() }
|
||||
override string toStringImpl() { result = this.getPlatform() + " " + this.getVersion() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ module Impl {
|
||||
|
||||
override int getEndColumn() { result = 0 }
|
||||
|
||||
override string toString() { result = "UnknownLocation" }
|
||||
override string toStringImpl() { result = "UnknownLocation" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import codeql.swift.elements.Locatable
|
||||
|
||||
module Impl {
|
||||
class UnspecifiedElement extends Generated::UnspecifiedElement {
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
exists(string source, string index |
|
||||
(
|
||||
source = " from " + this.getParent().getPrimaryQlClasses()
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.pattern.AnyPattern
|
||||
|
||||
module Impl {
|
||||
class AnyPattern extends Generated::AnyPattern {
|
||||
override string toString() { result = "_" }
|
||||
override string toStringImpl() { result = "_" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ module Impl {
|
||||
class BindingPattern extends Generated::BindingPattern {
|
||||
final override Pattern getResolveStep() { result = this.getImmediateSubPattern() }
|
||||
|
||||
override string toString() { result = "let ..." }
|
||||
override string toStringImpl() { result = "let ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.pattern.BoolPattern
|
||||
|
||||
module Impl {
|
||||
class BoolPattern extends Generated::BoolPattern {
|
||||
override string toString() { result = this.getValue().toString() }
|
||||
override string toStringImpl() { result = this.getValue().toString() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ module Impl {
|
||||
i = 0
|
||||
}
|
||||
|
||||
override string toString() {
|
||||
override string toStringImpl() {
|
||||
if this.hasSubPattern()
|
||||
then result = "." + this.getElement().toString() + "(...)"
|
||||
else result = "." + this.getElement().toString()
|
||||
then result = "." + this.getElement().toStringImpl() + "(...)"
|
||||
else result = "." + this.getElement().toStringImpl()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.pattern.ExprPattern
|
||||
|
||||
module Impl {
|
||||
class ExprPattern extends Generated::ExprPattern {
|
||||
override string toString() { result = "=~ ..." }
|
||||
override string toStringImpl() { result = "=~ ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.pattern.IsPattern
|
||||
|
||||
module Impl {
|
||||
class IsPattern extends Generated::IsPattern {
|
||||
override string toString() { result = "... is ..." }
|
||||
override string toStringImpl() { result = "... is ..." }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ module Impl {
|
||||
*/
|
||||
string getName() { result = this.getVarDecl().getName() }
|
||||
|
||||
override string toString() { result = this.getName() }
|
||||
override string toStringImpl() { result = this.getName() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ private import codeql.swift.generated.pattern.OptionalSomePattern
|
||||
|
||||
module Impl {
|
||||
class OptionalSomePattern extends Generated::OptionalSomePattern {
|
||||
override string toString() { result = "let ...?" }
|
||||
override string toStringImpl() { result = "let ...?" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ module Impl {
|
||||
class ParenPattern extends Generated::ParenPattern {
|
||||
final override Pattern getResolveStep() { result = this.getImmediateSubPattern() }
|
||||
|
||||
override string toString() { result = "(...)" }
|
||||
override string toStringImpl() { result = "(...)" }
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user