mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Swift: Support BuiltinFixedArrayType
This commit is contained in:
1
swift/ql/lib/codeql/swift/elements.qll
generated
1
swift/ql/lib/codeql/swift/elements.qll
generated
@@ -250,6 +250,7 @@ import codeql.swift.elements.type.BoundGenericType
|
||||
import codeql.swift.elements.type.BuiltinBridgeObjectType
|
||||
import codeql.swift.elements.type.BuiltinDefaultActorStorageType
|
||||
import codeql.swift.elements.type.BuiltinExecutorType
|
||||
import codeql.swift.elements.type.BuiltinFixedArrayType
|
||||
import codeql.swift.elements.type.BuiltinFloatType
|
||||
import codeql.swift.elements.type.BuiltinIntegerLiteralType
|
||||
import codeql.swift.elements.type.BuiltinIntegerType
|
||||
|
||||
12
swift/ql/lib/codeql/swift/elements/type/BuiltinFixedArrayType.qll
generated
Normal file
12
swift/ql/lib/codeql/swift/elements/type/BuiltinFixedArrayType.qll
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
/**
|
||||
* This module provides the public class `BuiltinFixedArrayType`.
|
||||
*/
|
||||
|
||||
private import internal.BuiltinFixedArrayTypeImpl
|
||||
import codeql.swift.elements.type.BuiltinType
|
||||
|
||||
/**
|
||||
* A builtin type representing N values stored contiguously.
|
||||
*/
|
||||
final class BuiltinFixedArrayType = Impl::BuiltinFixedArrayType;
|
||||
14
swift/ql/lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeConstructor.qll
generated
Normal file
14
swift/ql/lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeConstructor.qll
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
|
||||
/**
|
||||
* This module defines the hook used internally to tweak the characteristic predicate of
|
||||
* `BuiltinFixedArrayType` synthesized instances.
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.Raw
|
||||
|
||||
/**
|
||||
* The characteristic predicate of `BuiltinFixedArrayType` synthesized instances.
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
predicate constructBuiltinFixedArrayType(Raw::BuiltinFixedArrayType id) { any() }
|
||||
19
swift/ql/lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeImpl.qll
generated
Normal file
19
swift/ql/lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeImpl.qll
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
|
||||
/**
|
||||
* This module provides a hand-modifiable wrapper around the generated class `BuiltinFixedArrayType`.
|
||||
*
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.type.BuiltinFixedArrayType
|
||||
|
||||
/**
|
||||
* INTERNAL: This module contains the customizable definition of `BuiltinFixedArrayType` and should not
|
||||
* be referenced directly.
|
||||
*/
|
||||
module Impl {
|
||||
/**
|
||||
* A builtin type representing N values stored contiguously.
|
||||
*/
|
||||
class BuiltinFixedArrayType extends Generated::BuiltinFixedArrayType { }
|
||||
}
|
||||
18
swift/ql/lib/codeql/swift/generated/ParentChild.qll
generated
18
swift/ql/lib/codeql/swift/generated/ParentChild.qll
generated
@@ -4564,6 +4564,22 @@ private module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBuiltinFixedArrayType(
|
||||
BuiltinFixedArrayType e, int index, string partialPredicateCall
|
||||
) {
|
||||
exists(int b, int bBuiltinType, int n |
|
||||
b = 0 and
|
||||
bBuiltinType =
|
||||
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfBuiltinType(e, i, _)) | i) and
|
||||
n = bBuiltinType and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfBuiltinType(e, index - b, partialPredicateCall)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfBuiltinFloatType(
|
||||
BuiltinFloatType e, int index, string partialPredicateCall
|
||||
) {
|
||||
@@ -5679,6 +5695,8 @@ private module Impl {
|
||||
or
|
||||
result = getImmediateChildOfBuiltinExecutorType(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfBuiltinFixedArrayType(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfBuiltinFloatType(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfBuiltinJobType(e, index, partialAccessor)
|
||||
|
||||
8
swift/ql/lib/codeql/swift/generated/Raw.qll
generated
8
swift/ql/lib/codeql/swift/generated/Raw.qll
generated
@@ -3546,6 +3546,14 @@ module Raw {
|
||||
override string toString() { result = "BuiltinExecutorType" }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* A builtin type representing N values stored contiguously.
|
||||
*/
|
||||
class BuiltinFixedArrayType extends @builtin_fixed_array_type, BuiltinType {
|
||||
override string toString() { result = "BuiltinFixedArrayType" }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
28
swift/ql/lib/codeql/swift/generated/Synth.qll
generated
28
swift/ql/lib/codeql/swift/generated/Synth.qll
generated
@@ -900,6 +900,10 @@ module Synth {
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TBuiltinExecutorType(Raw::BuiltinExecutorType id) { constructBuiltinExecutorType(id) } or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TBuiltinFixedArrayType(Raw::BuiltinFixedArrayType id) { constructBuiltinFixedArrayType(id) } or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
@@ -1389,8 +1393,8 @@ module Synth {
|
||||
*/
|
||||
class TBuiltinType =
|
||||
TAnyBuiltinIntegerType or TBuiltinBridgeObjectType or TBuiltinDefaultActorStorageType or
|
||||
TBuiltinExecutorType or TBuiltinFloatType or TBuiltinJobType or TBuiltinNativeObjectType or
|
||||
TBuiltinRawPointerType or TBuiltinRawUnsafeContinuationType or
|
||||
TBuiltinExecutorType or TBuiltinFixedArrayType or TBuiltinFloatType or TBuiltinJobType or
|
||||
TBuiltinNativeObjectType or TBuiltinRawPointerType or TBuiltinRawUnsafeContinuationType or
|
||||
TBuiltinUnsafeValueBufferType or TBuiltinVectorType;
|
||||
|
||||
/**
|
||||
@@ -2861,6 +2865,14 @@ module Synth {
|
||||
result = TBuiltinExecutorType(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TBuiltinFixedArrayType`, if possible.
|
||||
*/
|
||||
TBuiltinFixedArrayType convertBuiltinFixedArrayTypeFromRaw(Raw::Element e) {
|
||||
result = TBuiltinFixedArrayType(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TBuiltinFloatType`, if possible.
|
||||
@@ -4022,6 +4034,8 @@ module Synth {
|
||||
or
|
||||
result = convertBuiltinExecutorTypeFromRaw(e)
|
||||
or
|
||||
result = convertBuiltinFixedArrayTypeFromRaw(e)
|
||||
or
|
||||
result = convertBuiltinFloatTypeFromRaw(e)
|
||||
or
|
||||
result = convertBuiltinJobTypeFromRaw(e)
|
||||
@@ -5593,6 +5607,14 @@ module Synth {
|
||||
e = TBuiltinExecutorType(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TBuiltinFixedArrayType` to a raw DB element, if possible.
|
||||
*/
|
||||
Raw::Element convertBuiltinFixedArrayTypeToRaw(TBuiltinFixedArrayType e) {
|
||||
e = TBuiltinFixedArrayType(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TBuiltinFloatType` to a raw DB element, if possible.
|
||||
@@ -6754,6 +6776,8 @@ module Synth {
|
||||
or
|
||||
result = convertBuiltinExecutorTypeToRaw(e)
|
||||
or
|
||||
result = convertBuiltinFixedArrayTypeToRaw(e)
|
||||
or
|
||||
result = convertBuiltinFloatTypeToRaw(e)
|
||||
or
|
||||
result = convertBuiltinJobTypeToRaw(e)
|
||||
|
||||
@@ -207,6 +207,7 @@ import codeql.swift.elements.type.internal.BoundGenericStructTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinBridgeObjectTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinDefaultActorStorageTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinExecutorTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinFixedArrayTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinFloatTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinIntegerLiteralTypeConstructor
|
||||
import codeql.swift.elements.type.internal.BuiltinIntegerTypeConstructor
|
||||
|
||||
24
swift/ql/lib/codeql/swift/generated/type/BuiltinFixedArrayType.qll
generated
Normal file
24
swift/ql/lib/codeql/swift/generated/type/BuiltinFixedArrayType.qll
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
/**
|
||||
* This module provides the generated definition of `BuiltinFixedArrayType`.
|
||||
* INTERNAL: Do not import directly.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.Synth
|
||||
private import codeql.swift.generated.Raw
|
||||
import codeql.swift.elements.type.internal.BuiltinTypeImpl::Impl as BuiltinTypeImpl
|
||||
|
||||
/**
|
||||
* INTERNAL: This module contains the fully generated definition of `BuiltinFixedArrayType` and should not
|
||||
* be referenced directly.
|
||||
*/
|
||||
module Generated {
|
||||
/**
|
||||
* A builtin type representing N values stored contiguously.
|
||||
* INTERNAL: Do not reference the `Generated::BuiltinFixedArrayType` class directly.
|
||||
* Use the subclass `BuiltinFixedArrayType`, where the following predicates are available.
|
||||
*/
|
||||
class BuiltinFixedArrayType extends Synth::TBuiltinFixedArrayType, BuiltinTypeImpl::BuiltinType {
|
||||
override string getAPrimaryQlClass() { result = "BuiltinFixedArrayType" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user