зеркало из https://github.com/github/codeql.git
[CPP-386] Print QL AST classes next to elements in PrintAST trees.
This commit is contained in:
Родитель
ddb0fd90e9
Коммит
e5fc07660d
|
@ -15,6 +15,9 @@ class Class extends UserType {
|
|||
isClass(underlyingElement(this))
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Class" }
|
||||
|
||||
/** Gets a child declaration of this class. */
|
||||
override Declaration getADeclaration() { result = this.getAMember() }
|
||||
|
||||
|
@ -980,6 +983,9 @@ class VirtualBaseClass extends Class {
|
|||
exists(VirtualClassDerivation cd | cd.getBaseClass() = this)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VirtualBaseClass" }
|
||||
|
||||
/** A virtual class derivation of which this class is the base. */
|
||||
VirtualClassDerivation getAVirtualDerivation() {
|
||||
result.getBaseClass() = this
|
||||
|
@ -1004,6 +1010,9 @@ class ProxyClass extends UserType {
|
|||
usertypes(underlyingElement(this),_,9)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ProxyClass" }
|
||||
|
||||
/** Gets the location of the proxy class. */
|
||||
override Location getLocation() {
|
||||
result = getTemplateParameter().getDefinitionLocation()
|
||||
|
|
|
@ -52,8 +52,9 @@ pragma[inline]
|
|||
class ElementBase extends @element {
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { none() }
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ElementBase" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "???" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,9 +65,6 @@ class Element extends ElementBase {
|
|||
/** Gets the primary file where this element occurs. */
|
||||
File getFile() { result = this.getLocation().getFile() }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Element" }
|
||||
|
||||
/**
|
||||
* Holds if this element may be from source.
|
||||
*
|
||||
|
|
|
@ -9,6 +9,9 @@ class Enum extends UserType, IntegralOrEnumType {
|
|||
EnumConstant getAnEnumConstant() { result.getDeclaringEnum() = this }
|
||||
EnumConstant getEnumConstant(int index) { enumconstants(unresolveElement(result),underlyingElement(this),index,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Enum" }
|
||||
|
||||
/**
|
||||
* Gets a descriptive string for the enum. This method is only intended to
|
||||
* be used for debugging purposes. For more information, see the comment
|
||||
|
@ -50,6 +53,8 @@ class LocalEnum extends Enum {
|
|||
LocalEnum() {
|
||||
isLocal()
|
||||
}
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LocalEnum" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,6 +66,9 @@ class NestedEnum extends Enum {
|
|||
this.isMember()
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NestedEnum" }
|
||||
|
||||
/** Holds if this member is private. */
|
||||
predicate isPrivate() { this.hasSpecifier("private") }
|
||||
|
||||
|
@ -81,6 +89,8 @@ class ScopedEnum extends Enum {
|
|||
ScopedEnum() {
|
||||
usertypes(underlyingElement(this),_,13)
|
||||
}
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ScopedEnum" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,6 +106,9 @@ class EnumConstant extends Declaration, @enumconstant {
|
|||
*/
|
||||
Enum getDeclaringEnum() { enumconstants(underlyingElement(this),unresolveElement(result),_,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "EnumConstant" }
|
||||
|
||||
override Class getDeclaringType() {
|
||||
result = this.getDeclaringEnum().getDeclaringType()
|
||||
}
|
||||
|
|
|
@ -707,7 +707,7 @@ class TopLevelFunction extends Function {
|
|||
TopLevelFunction() {
|
||||
not this.isMember()
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TopLevelFunction" }
|
||||
}
|
||||
|
||||
|
@ -720,7 +720,7 @@ class MemberFunction extends Function {
|
|||
this.isMember()
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "MemberFunction" }
|
||||
|
||||
/**
|
||||
|
@ -774,6 +774,9 @@ class VirtualFunction extends MemberFunction {
|
|||
this.hasSpecifier("virtual") or purefunctions(underlyingElement(this))
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VirtualFunction" }
|
||||
|
||||
/** Holds if this virtual function is pure. */
|
||||
predicate isPure() { this instanceof PureVirtualFunction }
|
||||
|
||||
|
@ -791,6 +794,8 @@ class PureVirtualFunction extends VirtualFunction {
|
|||
|
||||
PureVirtualFunction() { purefunctions(underlyingElement(this)) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PureVirtualFunction" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -802,6 +807,8 @@ class ConstMemberFunction extends MemberFunction {
|
|||
|
||||
ConstMemberFunction() { this.hasSpecifier("const") }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ConstMemberFunction" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -811,6 +818,9 @@ class Constructor extends MemberFunction {
|
|||
|
||||
Constructor() { functions(underlyingElement(this),_,2) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Constructor" }
|
||||
|
||||
/**
|
||||
* Holds if this constructor serves as a default constructor.
|
||||
*
|
||||
|
@ -856,6 +866,9 @@ class ConversionConstructor extends Constructor, ImplicitConversionFunction {
|
|||
and not(this instanceof CopyConstructor)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ConversionConstructor" }
|
||||
|
||||
/** Gets the type this `ConversionConstructor` takes as input. */
|
||||
override Type getSourceType() { result = this.getParameter(0).getType() }
|
||||
|
||||
|
@ -911,6 +924,9 @@ class CopyConstructor extends Constructor {
|
|||
not exists(getATemplateArgument())
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CopyConstructor" }
|
||||
|
||||
/**
|
||||
* Holds if we cannot determine that this constructor will become a copy
|
||||
* constructor in all instantiations. Depending on template parameters of the
|
||||
|
@ -959,6 +975,9 @@ class MoveConstructor extends Constructor {
|
|||
not exists(getATemplateArgument())
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "MoveConstructor" }
|
||||
|
||||
/**
|
||||
* Holds if we cannot determine that this constructor will become a move
|
||||
* constructor in all instantiations. Depending on template parameters of the
|
||||
|
@ -991,6 +1010,9 @@ class NoArgConstructor extends Constructor {
|
|||
class Destructor extends MemberFunction {
|
||||
Destructor() { functions(underlyingElement(this),_,3) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Destructor" }
|
||||
|
||||
/**
|
||||
* Gets a compiler-generated action which destructs a base class or member
|
||||
* variable.
|
||||
|
@ -1050,6 +1072,8 @@ class CopyAssignmentOperator extends Operator {
|
|||
not exists(this.getParameter(1)) and
|
||||
not exists(getATemplateArgument())
|
||||
}
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CopyAssignmentOperator" }
|
||||
}
|
||||
|
||||
|
||||
|
@ -1069,6 +1093,8 @@ class MoveAssignmentOperator extends Operator {
|
|||
not exists(this.getParameter(1)) and
|
||||
not exists(getATemplateArgument())
|
||||
}
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "MoveAssignmentOperator" }
|
||||
}
|
||||
|
||||
|
||||
|
@ -1089,6 +1115,8 @@ class MoveAssignmentOperator extends Operator {
|
|||
class TemplateFunction extends Function {
|
||||
TemplateFunction() { is_function_template(underlyingElement(this)) and exists(getATemplateArgument()) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TemplateFunction" }
|
||||
/**
|
||||
* Gets a compiler-generated instantiation of this function template.
|
||||
*/
|
||||
|
@ -1120,6 +1148,9 @@ class FunctionTemplateInstantiation extends Function {
|
|||
tf.getAnInstantiation() = this
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionTemplateSpecialization" }
|
||||
|
||||
/**
|
||||
* Gets the function template from which this instantiation was instantiated.
|
||||
*
|
||||
|
@ -1156,6 +1187,9 @@ class FunctionTemplateSpecialization extends Function {
|
|||
this.isSpecialization()
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionTemplateSpecialization" }
|
||||
|
||||
/**
|
||||
* Gets the primary template for the specialization (the function template
|
||||
* this specializes).
|
||||
|
|
|
@ -6,7 +6,7 @@ import semmle.code.cpp.controlflow.ControlFlowGraph
|
|||
class Initializer extends ControlFlowNode, @initialiser {
|
||||
override Location getLocation() { initialisers(underlyingElement(this),_,_,result) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Initializer" }
|
||||
|
||||
/** Holds if this initializer is explicit in the source. */
|
||||
|
|
|
@ -33,7 +33,7 @@ class Parameter extends LocalScopeVariable, @parameter {
|
|||
result = "p#" + this.getIndex().toString())
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Parameter" }
|
||||
|
||||
/**
|
||||
|
|
|
@ -163,6 +163,7 @@ class PrintASTNode extends TPrintASTNode {
|
|||
* A concatenation of all the leaf QL types of `el`
|
||||
*/
|
||||
private string qlClass(ElementBase el) { result = "["+ el.getCanonicalQLClass() + "]: " }
|
||||
//private string qlClass(ElementBase el) { result = "["+ concat(el.getAQlClass(), ",") + "]: " }
|
||||
|
||||
/**
|
||||
* A node representing an AST node.
|
||||
|
|
|
@ -8,6 +8,9 @@ class Struct extends Class {
|
|||
|
||||
Struct() { usertypes(underlyingElement(this),_,1) or usertypes(underlyingElement(this),_,3) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Struct" }
|
||||
|
||||
override string explain() { result = "struct " + this.getName() }
|
||||
|
||||
override predicate isDeeplyConstBelow() { any() } // No subparts
|
||||
|
|
|
@ -331,6 +331,8 @@ class UnknownType extends BuiltInType {
|
|||
|
||||
UnknownType() { builtintypes(underlyingElement(this),_,2,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "UnknownType" }
|
||||
}
|
||||
|
||||
private predicate isArithmeticType(@builtintype type, int kind) {
|
||||
|
@ -485,7 +487,7 @@ class BoolType extends IntegralType {
|
|||
|
||||
BoolType() { builtintypes(underlyingElement(this),_,4,_,_,_) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BoolType" }
|
||||
}
|
||||
|
||||
|
@ -501,7 +503,7 @@ class PlainCharType extends CharType {
|
|||
PlainCharType() {
|
||||
builtintypes(underlyingElement(this),_,5,_,_,_)
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PlainCharType" }
|
||||
}
|
||||
|
||||
|
@ -512,7 +514,7 @@ class UnsignedCharType extends CharType {
|
|||
UnsignedCharType() {
|
||||
builtintypes(underlyingElement(this),_,6,_,_,_)
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "UnsignedCharType" }
|
||||
}
|
||||
|
||||
|
@ -523,7 +525,7 @@ class SignedCharType extends CharType {
|
|||
SignedCharType() {
|
||||
builtintypes(underlyingElement(this),_,7,_,_,_)
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SignedCharType" }
|
||||
}
|
||||
|
||||
|
@ -536,7 +538,7 @@ class ShortType extends IntegralType {
|
|||
builtintypes(underlyingElement(this),_,8,_,_,_) or builtintypes(underlyingElement(this),_,9,_,_,_) or builtintypes(underlyingElement(this),_,10,_,_,_)
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ShortType" }
|
||||
}
|
||||
|
||||
|
@ -549,7 +551,7 @@ class IntType extends IntegralType {
|
|||
builtintypes(underlyingElement(this),_,11,_,_,_) or builtintypes(underlyingElement(this),_,12,_,_,_) or builtintypes(underlyingElement(this),_,13,_,_,_)
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "IntType" }
|
||||
}
|
||||
|
||||
|
@ -562,7 +564,7 @@ class LongType extends IntegralType {
|
|||
builtintypes(underlyingElement(this),_,14,_,_,_) or builtintypes(underlyingElement(this),_,15,_,_,_) or builtintypes(underlyingElement(this),_,16,_,_,_)
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LongType" }
|
||||
}
|
||||
|
||||
|
@ -575,7 +577,7 @@ class LongLongType extends IntegralType {
|
|||
builtintypes(underlyingElement(this),_,17,_,_,_) or builtintypes(underlyingElement(this),_,18,_,_,_) or builtintypes(underlyingElement(this),_,19,_,_,_)
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LongLongType" }
|
||||
}
|
||||
|
||||
|
@ -608,7 +610,7 @@ class FloatType extends FloatingPointType {
|
|||
|
||||
FloatType() { builtintypes(underlyingElement(this),_,24,_,_,_) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FloatType" }
|
||||
}
|
||||
|
||||
|
@ -619,7 +621,7 @@ class DoubleType extends FloatingPointType {
|
|||
|
||||
DoubleType() { builtintypes(underlyingElement(this),_,25,_,_,_) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DoubleType" }
|
||||
}
|
||||
|
||||
|
@ -630,7 +632,7 @@ class LongDoubleType extends FloatingPointType {
|
|||
|
||||
LongDoubleType() { builtintypes(underlyingElement(this),_,26,_,_,_) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LongDoubleType" }
|
||||
}
|
||||
|
||||
|
@ -677,7 +679,7 @@ class VoidType extends BuiltInType {
|
|||
|
||||
VoidType() { builtintypes(underlyingElement(this),_,3,_,_,_) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VoidType" }
|
||||
}
|
||||
|
||||
|
@ -692,6 +694,8 @@ class WideCharType extends IntegralType {
|
|||
|
||||
WideCharType() { builtintypes(underlyingElement(this),_,33,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "WideCharType" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -701,6 +705,8 @@ class Char16Type extends IntegralType {
|
|||
|
||||
Char16Type() { builtintypes(underlyingElement(this),_,43,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Char16Type" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -710,6 +716,8 @@ class Char32Type extends IntegralType {
|
|||
|
||||
Char32Type() { builtintypes(underlyingElement(this),_,44,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Char32Type" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -723,6 +731,9 @@ class Char32Type extends IntegralType {
|
|||
*/
|
||||
class NullPointerType extends BuiltInType {
|
||||
NullPointerType() { builtintypes(underlyingElement(this),_,34,_,_,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NullPointerType" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -884,6 +895,9 @@ class PointerType extends DerivedType {
|
|||
|
||||
PointerType() { derivedtypes(underlyingElement(this),_,1,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerType" }
|
||||
|
||||
override int getPointerIndirectionLevel() {
|
||||
result = 1 + this.getBaseType().getPointerIndirectionLevel()
|
||||
}
|
||||
|
@ -931,6 +945,9 @@ class ReferenceType extends DerivedType {
|
|||
*/
|
||||
class LValueReferenceType extends ReferenceType {
|
||||
LValueReferenceType() { derivedtypes(underlyingElement(this),_,2,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LValueReferenceType" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -939,6 +956,9 @@ class LValueReferenceType extends ReferenceType {
|
|||
class RValueReferenceType extends ReferenceType {
|
||||
RValueReferenceType() { derivedtypes(underlyingElement(this),_,8,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "RValueReferenceType" }
|
||||
|
||||
override string explain() { result = "rvalue " + super.explain() }
|
||||
}
|
||||
|
||||
|
@ -949,6 +969,9 @@ class SpecifiedType extends DerivedType {
|
|||
|
||||
SpecifiedType() { derivedtypes(underlyingElement(this),_,3,_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SpecifiedType" }
|
||||
|
||||
override int getSize() { result = this.getBaseType().getSize() }
|
||||
|
||||
override int getAlignment() { result = this.getBaseType().getAlignment() }
|
||||
|
@ -991,7 +1014,7 @@ class ArrayType extends DerivedType {
|
|||
|
||||
ArrayType() { derivedtypes(underlyingElement(this),_,4,_) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ArrayType" }
|
||||
|
||||
predicate hasArraySize() { arraysizes(underlyingElement(this),_,_,_) }
|
||||
|
@ -1082,6 +1105,9 @@ class FunctionPointerType extends FunctionPointerIshType {
|
|||
derivedtypes(underlyingElement(this),_,6,_)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionPointerType" }
|
||||
|
||||
override int getPointerIndirectionLevel() {
|
||||
result = 1
|
||||
}
|
||||
|
@ -1097,6 +1123,9 @@ class FunctionReferenceType extends FunctionPointerIshType {
|
|||
derivedtypes(underlyingElement(this),_,7,_)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionReferenceType" }
|
||||
|
||||
override int getPointerIndirectionLevel() {
|
||||
result = getBaseType().getPointerIndirectionLevel()
|
||||
}
|
||||
|
@ -1167,6 +1196,9 @@ class PointerToMemberType extends Type, @ptrtomember {
|
|||
/** a printable representation of this named element */
|
||||
override string toString() { result = this.getName() }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerToMemberType" }
|
||||
|
||||
/** the name of this type */
|
||||
override string getName() { result = "..:: *" }
|
||||
|
||||
|
@ -1201,6 +1233,9 @@ class RoutineType extends Type, @routinetype {
|
|||
/** a printable representation of this named element */
|
||||
override string toString() { result = this.getName() }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "RoutineType" }
|
||||
|
||||
override string getName() { result = "..()(..)" }
|
||||
|
||||
Type getParameterType(int n) { routinetypeargs(underlyingElement(this),n,unresolveElement(result)) }
|
||||
|
@ -1256,6 +1291,9 @@ class TemplateParameter extends UserType
|
|||
{
|
||||
TemplateParameter() { usertypes(underlyingElement(this), _, 7) or usertypes(underlyingElement(this), _, 8) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TemplateParameter" }
|
||||
|
||||
override predicate involvesTemplateParameter() {
|
||||
any()
|
||||
}
|
||||
|
@ -1267,6 +1305,9 @@ class TemplateTemplateParameter extends TemplateParameter
|
|||
TemplateTemplateParameter() {
|
||||
usertypes(underlyingElement(this), _, 8)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TemplateTemplateParameter" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,9 @@ class TypedefType extends UserType {
|
|||
|
||||
TypedefType() { usertypes(underlyingElement(this),_,5) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TypedefType" }
|
||||
|
||||
/**
|
||||
* Gets the base type of this typedef type.
|
||||
*/
|
||||
|
|
|
@ -8,6 +8,9 @@ class Union extends Struct {
|
|||
|
||||
Union() { usertypes(underlyingElement(this),_,3) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Union" }
|
||||
|
||||
override string explain() { result = "union " + this.getName() }
|
||||
|
||||
override predicate isDeeplyConstBelow() { any() } // No subparts
|
||||
|
|
|
@ -174,7 +174,7 @@ class Variable extends Declaration, @variable {
|
|||
class VariableDeclarationEntry extends DeclarationEntry, @var_decl {
|
||||
override Variable getDeclaration() { result = getVariable() }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VariableDeclarationEntry" }
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,7 @@ class CharPointerType extends PointerType {
|
|||
|
||||
CharPointerType() { this.getBaseType() instanceof CharType }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CharPointerType" }
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ class IntPointerType extends PointerType {
|
|||
|
||||
IntPointerType() { this.getBaseType() instanceof IntType }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "IntPointerType" }
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class VoidPointerType extends PointerType {
|
|||
|
||||
VoidPointerType() { this.getBaseType() instanceof VoidType }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VoidPointerType" }
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class Size_t extends Type {
|
|||
this.getUnderlyingType() instanceof IntegralType and
|
||||
this.hasName("size_t")
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Size_t" }
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ class Ssize_t extends Type {
|
|||
this.getUnderlyingType() instanceof IntegralType and
|
||||
this.hasName("ssize_t")
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Ssize_t" }
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ class Ptrdiff_t extends Type {
|
|||
this.getUnderlyingType() instanceof IntegralType and
|
||||
this.hasName("ptrdiff_t")
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Ptrdiff_t" }
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ class Wchar_t extends Type {
|
|||
this.getUnderlyingType() instanceof IntegralType and
|
||||
this.hasName("wchar_t")
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Wchar_t" }
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class UserDefinedFormattingFunction extends FormattingFunction {
|
|||
class FormattingFunctionCall extends Expr {
|
||||
FormattingFunctionCall() { this.(Call).getTarget() instanceof FormattingFunction }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FormattingFunctionCall" }
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@ abstract class NullValue extends Expr
|
|||
class Zero extends NullValue
|
||||
{
|
||||
Zero() { this.(Literal).getValue() = "0" }
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Zero" }
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ abstract class Access extends Expr, NameQualifiableElement {
|
|||
* A C/C++ enum constant access expression.
|
||||
*/
|
||||
class EnumConstantAccess extends Access, @varaccess {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "EnumConstantAccess" }
|
||||
|
||||
EnumConstantAccess() {
|
||||
|
@ -42,7 +42,7 @@ class EnumConstantAccess extends Access, @varaccess {
|
|||
* A C/C++ variable access expression.
|
||||
*/
|
||||
class VariableAccess extends Access, @varaccess {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VariableAccess" }
|
||||
|
||||
VariableAccess() {
|
||||
|
@ -139,7 +139,7 @@ class VariableAccess extends Access, @varaccess {
|
|||
* A C/C++ field access expression.
|
||||
*/
|
||||
class FieldAccess extends VariableAccess {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FieldAccess" }
|
||||
|
||||
FieldAccess() { exists(Field f | varbind(underlyingElement(this), unresolveElement(f))) }
|
||||
|
@ -242,6 +242,9 @@ class FunctionAccess extends Access, @routineexpr {
|
|||
not iscall(underlyingElement(this),_)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionAccess" }
|
||||
|
||||
/** Gets the accessed function. */
|
||||
override Function getTarget() { funbind(underlyingElement(this), unresolveElement(result)) }
|
||||
|
||||
|
@ -289,7 +292,7 @@ class TypeName extends Expr, @type_operand {
|
|||
* For calls to operator[], which look syntactically identical, see OverloadedArrayExpr.
|
||||
*/
|
||||
class ArrayExpr extends Expr, @subscriptexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ArrayExpr" }
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,7 @@ abstract class UnaryArithmeticOperation extends UnaryOperation {
|
|||
class UnaryMinusExpr extends UnaryArithmeticOperation, @arithnegexpr {
|
||||
override string getOperator() { result = "-" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "UnaryMinusExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -24,7 +24,7 @@ class UnaryMinusExpr extends UnaryArithmeticOperation, @arithnegexpr {
|
|||
class UnaryPlusExpr extends UnaryArithmeticOperation, @unaryplusexpr {
|
||||
override string getOperator() { result = "+" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "UnaryPlusExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -96,7 +96,7 @@ abstract class PostfixCrementOperation extends CrementOperation {
|
|||
class PrefixIncrExpr extends IncrementOperation, PrefixCrementOperation, @preincrexpr {
|
||||
override string getOperator() { result = "++" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PrefixIncrExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -110,7 +110,7 @@ class PrefixIncrExpr extends IncrementOperation, PrefixCrementOperation, @preinc
|
|||
class PrefixDecrExpr extends DecrementOperation, PrefixCrementOperation, @predecrexpr {
|
||||
override string getOperator() { result = "--" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PrefixDecrExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -124,7 +124,7 @@ class PrefixDecrExpr extends DecrementOperation, PrefixCrementOperation, @predec
|
|||
class PostfixIncrExpr extends IncrementOperation, PostfixCrementOperation, @postincrexpr {
|
||||
override string getOperator() { result = "++" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PostfixIncrExpr" }
|
||||
|
||||
override int getPrecedence() { result = 16 }
|
||||
|
@ -140,7 +140,7 @@ class PostfixIncrExpr extends IncrementOperation, PostfixCrementOperation, @post
|
|||
class PostfixDecrExpr extends DecrementOperation, PostfixCrementOperation, @postdecrexpr {
|
||||
override string getOperator() { result = "--" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PostfixDecrExpr" }
|
||||
|
||||
override int getPrecedence() { result = 16 }
|
||||
|
@ -174,7 +174,7 @@ abstract class BinaryArithmeticOperation extends BinaryOperation {
|
|||
class AddExpr extends BinaryArithmeticOperation, @addexpr {
|
||||
override string getOperator() { result = "+" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AddExpr" }
|
||||
|
||||
override int getPrecedence() { result = 12 }
|
||||
|
@ -186,7 +186,7 @@ class AddExpr extends BinaryArithmeticOperation, @addexpr {
|
|||
class SubExpr extends BinaryArithmeticOperation, @subexpr {
|
||||
override string getOperator() { result = "-" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SubExpr" }
|
||||
|
||||
override int getPrecedence() { result = 12 }
|
||||
|
@ -198,7 +198,7 @@ class SubExpr extends BinaryArithmeticOperation, @subexpr {
|
|||
class MulExpr extends BinaryArithmeticOperation, @mulexpr {
|
||||
override string getOperator() { result = "*" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "MulExpr" }
|
||||
|
||||
override int getPrecedence() { result = 13 }
|
||||
|
@ -210,7 +210,7 @@ class MulExpr extends BinaryArithmeticOperation, @mulexpr {
|
|||
class DivExpr extends BinaryArithmeticOperation, @divexpr {
|
||||
override string getOperator() { result = "/" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DivExpr" }
|
||||
|
||||
override int getPrecedence() { result = 13 }
|
||||
|
@ -222,7 +222,7 @@ class DivExpr extends BinaryArithmeticOperation, @divexpr {
|
|||
class RemExpr extends BinaryArithmeticOperation, @remexpr {
|
||||
override string getOperator() { result = "%" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "RemExpr" }
|
||||
|
||||
override int getPrecedence() { result = 13 }
|
||||
|
@ -308,7 +308,7 @@ abstract class PointerArithmeticOperation extends BinaryArithmeticOperation {
|
|||
class PointerAddExpr extends PointerArithmeticOperation, @paddexpr {
|
||||
override string getOperator() { result = "+" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerAddExpr" }
|
||||
|
||||
override int getPrecedence() { result = 12 }
|
||||
|
@ -320,7 +320,7 @@ class PointerAddExpr extends PointerArithmeticOperation, @paddexpr {
|
|||
class PointerSubExpr extends PointerArithmeticOperation, @psubexpr {
|
||||
override string getOperator() { result = "-" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerSubExpr" }
|
||||
|
||||
override int getPrecedence() { result = 12 }
|
||||
|
@ -332,7 +332,7 @@ class PointerSubExpr extends PointerArithmeticOperation, @psubexpr {
|
|||
class PointerDiffExpr extends PointerArithmeticOperation, @pdiffexpr {
|
||||
override string getOperator() { result = "-" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerDiffExpr" }
|
||||
|
||||
override int getPrecedence() { result = 12 }
|
||||
|
|
|
@ -32,7 +32,7 @@ abstract class Assignment extends Operation {
|
|||
class AssignExpr extends Assignment, @assignexpr {
|
||||
override string getOperator() { result = "=" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignExpr" }
|
||||
|
||||
/** Gets a textual representation of this assignment. */
|
||||
|
@ -57,7 +57,7 @@ abstract class AssignArithmeticOperation extends AssignOperation {
|
|||
* A non-overloaded `+=` assignment expression on a non-pointer lvalue.
|
||||
*/
|
||||
class AssignAddExpr extends AssignArithmeticOperation, @assignaddexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignAddExpr" }
|
||||
|
||||
override string getOperator() { result = "+=" }
|
||||
|
@ -67,7 +67,7 @@ class AssignAddExpr extends AssignArithmeticOperation, @assignaddexpr {
|
|||
* A non-overloaded `-=` assignment expression on a non-pointer lvalue.
|
||||
*/
|
||||
class AssignSubExpr extends AssignArithmeticOperation, @assignsubexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignSubExpr" }
|
||||
|
||||
override string getOperator() { result = "-=" }
|
||||
|
@ -77,7 +77,7 @@ class AssignSubExpr extends AssignArithmeticOperation, @assignsubexpr {
|
|||
* A non-overloaded `*=` assignment expression.
|
||||
*/
|
||||
class AssignMulExpr extends AssignArithmeticOperation, @assignmulexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignMulExpr" }
|
||||
|
||||
override string getOperator() { result = "*=" }
|
||||
|
@ -87,7 +87,7 @@ class AssignMulExpr extends AssignArithmeticOperation, @assignmulexpr {
|
|||
* A non-overloaded `/=` assignment expression.
|
||||
*/
|
||||
class AssignDivExpr extends AssignArithmeticOperation, @assigndivexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignDivExpr" }
|
||||
|
||||
override string getOperator() { result = "/=" }
|
||||
|
@ -97,7 +97,7 @@ class AssignDivExpr extends AssignArithmeticOperation, @assigndivexpr {
|
|||
* A non-overloaded `%=` assignment expression.
|
||||
*/
|
||||
class AssignRemExpr extends AssignArithmeticOperation, @assignremexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignRemExpr" }
|
||||
|
||||
override string getOperator() { result = "%=" }
|
||||
|
@ -114,7 +114,7 @@ abstract class AssignBitwiseOperation extends AssignOperation {
|
|||
* A non-overloaded `&=` assignment expression.
|
||||
*/
|
||||
class AssignAndExpr extends AssignBitwiseOperation, @assignandexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignAndExpr" }
|
||||
|
||||
override string getOperator() { result = "&=" }
|
||||
|
@ -124,7 +124,7 @@ class AssignAndExpr extends AssignBitwiseOperation, @assignandexpr {
|
|||
* A non-overloaded `|=` assignment expression.
|
||||
*/
|
||||
class AssignOrExpr extends AssignBitwiseOperation, @assignorexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignOrExpr" }
|
||||
|
||||
override string getOperator() { result = "|=" }
|
||||
|
@ -134,7 +134,7 @@ class AssignOrExpr extends AssignBitwiseOperation, @assignorexpr {
|
|||
* A non-overloaded `^=` assignment expression.
|
||||
*/
|
||||
class AssignXorExpr extends AssignBitwiseOperation, @assignxorexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignXorExpr" }
|
||||
|
||||
override string getOperator() { result = "^=" }
|
||||
|
@ -144,7 +144,7 @@ class AssignXorExpr extends AssignBitwiseOperation, @assignxorexpr {
|
|||
* A non-overloaded `<<=` assignment expression.
|
||||
*/
|
||||
class AssignLShiftExpr extends AssignBitwiseOperation, @assignlshiftexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignLShiftExpr" }
|
||||
|
||||
override string getOperator() { result = "<<=" }
|
||||
|
@ -154,7 +154,7 @@ class AssignLShiftExpr extends AssignBitwiseOperation, @assignlshiftexpr {
|
|||
* A non-overloaded `>>=` assignment expression.
|
||||
*/
|
||||
class AssignRShiftExpr extends AssignBitwiseOperation, @assignrshiftexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignRShiftExpr" }
|
||||
|
||||
override string getOperator() { result = ">>=" }
|
||||
|
@ -164,7 +164,7 @@ class AssignRShiftExpr extends AssignBitwiseOperation, @assignrshiftexpr {
|
|||
* A non-overloaded `+=` pointer assignment expression.
|
||||
*/
|
||||
class AssignPointerAddExpr extends AssignOperation, @assignpaddexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignPointerAddExpr" }
|
||||
|
||||
override string getOperator() { result = "+=" }
|
||||
|
@ -174,7 +174,7 @@ class AssignPointerAddExpr extends AssignOperation, @assignpaddexpr {
|
|||
* A non-overloaded `-=` pointer assignment expression.
|
||||
*/
|
||||
class AssignPointerSubExpr extends AssignOperation, @assignpsubexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AssignPointerSubExpr" }
|
||||
|
||||
override string getOperator() { result = "-=" }
|
||||
|
@ -196,6 +196,9 @@ class ConditionDeclExpr extends Expr, @condition_decl {
|
|||
deprecated
|
||||
Expr getExpr() { result = this.getChild(0) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ConditionDeclExpr" }
|
||||
|
||||
/**
|
||||
* Gets the compiler-generated variable access that conceptually occurs after
|
||||
* the initialization of the declared variable.
|
||||
|
|
|
@ -13,6 +13,9 @@ class ComplementExpr extends UnaryBitwiseOperation, @complementexpr {
|
|||
override string getOperator() { result = "~" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ComplementExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,6 +32,9 @@ class LShiftExpr extends BinaryBitwiseOperation, @lshiftexpr {
|
|||
override string getOperator() { result = "<<" }
|
||||
|
||||
override int getPrecedence() { result = 11 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LShiftExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,6 +44,9 @@ class RShiftExpr extends BinaryBitwiseOperation, @rshiftexpr {
|
|||
override string getOperator() { result = ">>" }
|
||||
|
||||
override int getPrecedence() { result = 11 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "RShiftExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,6 +56,9 @@ class BitwiseAndExpr extends BinaryBitwiseOperation, @andexpr {
|
|||
override string getOperator() { result = "&" }
|
||||
|
||||
override int getPrecedence() { result = 8 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BitwiseAndExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,13 +68,19 @@ class BitwiseOrExpr extends BinaryBitwiseOperation, @orexpr {
|
|||
override string getOperator() { result = "|" }
|
||||
|
||||
override int getPrecedence() { result = 6 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BitwiseOrExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A C/C++ bitwise or expression.
|
||||
* A C/C++ bitwise xor expression.
|
||||
*/
|
||||
class BitwiseXorExpr extends BinaryBitwiseOperation, @xorexpr {
|
||||
override string getOperator() { result = "^" }
|
||||
|
||||
override int getPrecedence() { result = 7 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BitwiseXorExpr" }
|
||||
}
|
||||
|
|
|
@ -11,6 +11,9 @@ abstract class BuiltInOperation extends Expr {
|
|||
*/
|
||||
class BuiltInVarArgsStart extends BuiltInOperation, @vastartexpr {
|
||||
override string toString() { result = "__builtin_va_start" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BuiltInVarArgsStart" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,6 +21,9 @@ class BuiltInVarArgsStart extends BuiltInOperation, @vastartexpr {
|
|||
*/
|
||||
class BuiltInVarArgsEnd extends BuiltInOperation, @vaendexpr {
|
||||
override string toString() { result = "__builtin_va_end" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BuiltInVarArgsEnd" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -25,6 +31,9 @@ class BuiltInVarArgsEnd extends BuiltInOperation, @vaendexpr {
|
|||
*/
|
||||
class BuiltInVarArg extends BuiltInOperation, @vaargexpr {
|
||||
override string toString() { result = "__builtin_va_arg" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BuiltInVarArg" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,6 +41,9 @@ class BuiltInVarArg extends BuiltInOperation, @vaargexpr {
|
|||
*/
|
||||
class BuiltInVarArgCopy extends BuiltInOperation, @vacopyexpr {
|
||||
override string toString() { result = "__builtin_va_copy" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BuiltInVarArgCopy" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -149,7 +149,7 @@ class FunctionCall extends Call, @funbindexpr {
|
|||
iscall(underlyingElement(this),_)
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionCall" }
|
||||
|
||||
/** Gets an explicit template argument for this call. */
|
||||
|
@ -350,6 +350,9 @@ class ExprCall extends Call, @callexpr {
|
|||
*/
|
||||
Expr getExpr() { result = this.getChild(0) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ExprCall" }
|
||||
|
||||
override Expr getAnArgument() {
|
||||
exists(int i | result = this.getChild(i) and i >= 1)
|
||||
}
|
||||
|
@ -370,6 +373,9 @@ class ExprCall extends Call, @callexpr {
|
|||
class VariableCall extends ExprCall {
|
||||
VariableCall() { this.getExpr() instanceof VariableAccess }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VariableCall" }
|
||||
|
||||
/**
|
||||
* Gets the variable which yields the function pointer to call.
|
||||
*/
|
||||
|
@ -384,6 +390,9 @@ class VariableCall extends ExprCall {
|
|||
class ConstructorCall extends FunctionCall {
|
||||
ConstructorCall() { super.getTarget() instanceof Constructor }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ConstructorCall" }
|
||||
|
||||
/** Gets the constructor being called. */
|
||||
override Constructor getTarget() { result = super.getTarget() }
|
||||
}
|
||||
|
@ -398,6 +407,9 @@ class ThrowExpr extends Expr, @throw_expr {
|
|||
*/
|
||||
Expr getExpr() { result = this.getChild(0) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ThrowExpr" }
|
||||
|
||||
override string toString() { result = "throw ..." }
|
||||
|
||||
override int getPrecedence() { result = 1 }
|
||||
|
@ -409,6 +421,9 @@ class ThrowExpr extends Expr, @throw_expr {
|
|||
class ReThrowExpr extends ThrowExpr {
|
||||
ReThrowExpr() { this.getType() instanceof VoidType }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ReThrowExpr" }
|
||||
|
||||
override string toString() { result = "re-throw exception " }
|
||||
}
|
||||
|
||||
|
@ -418,6 +433,9 @@ class ReThrowExpr extends ThrowExpr {
|
|||
class DestructorCall extends FunctionCall {
|
||||
DestructorCall() { super.getTarget() instanceof Destructor }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DestructorCall" }
|
||||
|
||||
/** Gets the destructor being called. */
|
||||
override Destructor getTarget() { result = super.getTarget() }
|
||||
}
|
||||
|
@ -435,6 +453,9 @@ class VacuousDestructorCall extends Expr, @vacuous_destructor_call {
|
|||
*/
|
||||
Expr getQualifier() { result = this.getChild(0) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VacuousDestructorCall" }
|
||||
|
||||
override string toString() { result = "(vacuous destructor call)" }
|
||||
}
|
||||
|
||||
|
@ -484,6 +505,9 @@ class ConstructorFieldInit extends ConstructorInit, @ctorfieldinit {
|
|||
/** Gets the field being initialized. */
|
||||
Field getTarget() { varbind(underlyingElement(this),unresolveElement(result)) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ConstructorFieldInit" }
|
||||
|
||||
/**
|
||||
* Gets the expression to which the field is initialized.
|
||||
*
|
||||
|
@ -543,6 +567,9 @@ class DestructorFieldDestruction extends DestructorDestruction, @dtorfielddestru
|
|||
/** Gets the field being destructed. */
|
||||
Field getTarget() { varbind(underlyingElement(this),unresolveElement(result)) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DestructorFieldDestruction" }
|
||||
|
||||
/** Gets the compiler-generated call to the variable's destructor. */
|
||||
DestructorCall getExpr() { result = this.getChild(0) }
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ class IntegralConversion extends ArithmeticConversion {
|
|||
isIntegralOrEnum(getExpr().getUnspecifiedType())
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "IntegralConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
|
@ -172,6 +172,9 @@ class FloatingPointConversion extends ArithmeticConversion {
|
|||
getExpr().getUnspecifiedType() instanceof FloatingPointType
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FloatingPointConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "floating point conversion"
|
||||
}
|
||||
|
@ -186,6 +189,9 @@ class FloatingPointToIntegralConversion extends ArithmeticConversion {
|
|||
getExpr().getUnspecifiedType() instanceof FloatingPointType
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FloatingPointToIntegralConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "floating point to integral conversion"
|
||||
}
|
||||
|
@ -200,6 +206,9 @@ class IntegralToFloatingPointConversion extends ArithmeticConversion {
|
|||
isIntegralOrEnum(getExpr().getUnspecifiedType())
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "IntegralToFloatingPointConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "integral to floating point conversion"
|
||||
}
|
||||
|
@ -218,7 +227,7 @@ class PointerConversion extends Cast {
|
|||
isPointerOrNullPointer(getExpr().getUnspecifiedType())
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
|
@ -249,6 +258,9 @@ class PointerToMemberConversion extends Cast {
|
|||
)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerToMemberConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "pointer-to-member conversion"
|
||||
}
|
||||
|
@ -264,6 +276,9 @@ class PointerToIntegralConversion extends Cast {
|
|||
isPointerOrNullPointer(getExpr().getUnspecifiedType())
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerToIntegralConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "pointer to integral conversion"
|
||||
}
|
||||
|
@ -279,6 +294,9 @@ class IntegralToPointerConversion extends Cast {
|
|||
isIntegralOrEnum(getExpr().getUnspecifiedType())
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "IntegralToPointerConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "integral to pointer conversion"
|
||||
}
|
||||
|
@ -293,6 +311,9 @@ class BoolConversion extends Cast {
|
|||
conversionkinds(underlyingElement(this), 1)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BoolConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "conversion to bool"
|
||||
}
|
||||
|
@ -307,6 +328,9 @@ class VoidConversion extends Cast {
|
|||
getUnspecifiedType() instanceof VoidType
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "VoidConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "conversion to void"
|
||||
}
|
||||
|
@ -376,6 +400,9 @@ class BaseClassConversion extends InheritanceConversion {
|
|||
conversionkinds(underlyingElement(this), 2)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BaseClassConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "base class conversion"
|
||||
}
|
||||
|
@ -405,6 +432,9 @@ class DerivedClassConversion extends InheritanceConversion {
|
|||
conversionkinds(underlyingElement(this), 3)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DerivedClassConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "derived class conversion"
|
||||
}
|
||||
|
@ -427,6 +457,9 @@ class PointerToMemberBaseClassConversion extends Cast {
|
|||
conversionkinds(underlyingElement(this), 4)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerToMemberBaseClassConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "pointer-to-member base class conversion"
|
||||
}
|
||||
|
@ -441,6 +474,9 @@ class PointerToMemberDerivedClassConversion extends Cast {
|
|||
conversionkinds(underlyingElement(this), 5)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerToMemberDerivedClassConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "pointer-to-member derived class conversion"
|
||||
}
|
||||
|
@ -456,6 +492,9 @@ class GlvalueConversion extends Cast {
|
|||
conversionkinds(underlyingElement(this), 6)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "GlvalueConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "glvalue conversion"
|
||||
}
|
||||
|
@ -480,6 +519,9 @@ class PrvalueAdjustmentConversion extends Cast {
|
|||
conversionkinds(underlyingElement(this), 7)
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PrvalueAdjustmentConversion" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "prvalue adjustment conversion"
|
||||
}
|
||||
|
@ -493,6 +535,9 @@ class DynamicCast extends Cast, @dynamic_cast {
|
|||
|
||||
override int getPrecedence() { result = 16 }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DynamicCast" }
|
||||
|
||||
override string getSemanticConversionString() {
|
||||
result = "dynamic_cast"
|
||||
}
|
||||
|
@ -544,6 +589,9 @@ class TypeidOperator extends Expr, @type_id {
|
|||
*/
|
||||
deprecated Type getSpecifiedType() { result = this.getResultType() }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TypeidOperator" }
|
||||
|
||||
/**
|
||||
* Gets the contained expression, if any (if this typeid contains
|
||||
* a type rather than an expression, there is no result).
|
||||
|
@ -571,6 +619,9 @@ class TypeidOperator extends Expr, @type_id {
|
|||
class SizeofPackOperator extends Expr, @sizeof_pack {
|
||||
override string toString() { result = "sizeof...(...)" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SizeofPackOperator" }
|
||||
|
||||
override predicate mayBeImpure() {
|
||||
none()
|
||||
}
|
||||
|
@ -592,7 +643,7 @@ abstract class SizeofOperator extends Expr, @runtime_sizeof {
|
|||
class SizeofExprOperator extends SizeofOperator {
|
||||
SizeofExprOperator() { exists(Expr e | this.getChild(0) = e) }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SizeofExprOperator" }
|
||||
|
||||
/** Gets the contained expression. */
|
||||
|
@ -621,6 +672,9 @@ class SizeofExprOperator extends SizeofOperator {
|
|||
class SizeofTypeOperator extends SizeofOperator {
|
||||
SizeofTypeOperator() { sizeof_bind(underlyingElement(this),_) }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SizeofTypeOperator" }
|
||||
|
||||
/** Gets the contained type. */
|
||||
Type getTypeOperand() { sizeof_bind(underlyingElement(this),unresolveElement(result)) }
|
||||
|
||||
|
@ -691,7 +745,7 @@ class ArrayToPointerConversion extends Conversion, @array_to_pointer {
|
|||
/** Gets a textual representation of this conversion. */
|
||||
override string toString() { result = "array to pointer conversion" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ArrayToPointerConversion" }
|
||||
|
||||
override predicate mayBeImpure() {
|
||||
|
|
|
@ -17,7 +17,7 @@ abstract class EqualityOperation extends ComparisonOperation {
|
|||
* A C/C++ equal expression.
|
||||
*/
|
||||
class EQExpr extends EqualityOperation, @eqexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "EQExpr" }
|
||||
|
||||
override string getOperator() { result = "==" }
|
||||
|
@ -27,7 +27,7 @@ class EQExpr extends EqualityOperation, @eqexpr {
|
|||
* A C/C++ not equal expression.
|
||||
*/
|
||||
class NEExpr extends EqualityOperation, @neexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NEExpr" }
|
||||
|
||||
override string getOperator() { result = "!=" }
|
||||
|
@ -76,7 +76,7 @@ abstract class RelationalOperation extends ComparisonOperation {
|
|||
* A C/C++ greater than expression.
|
||||
*/
|
||||
class GTExpr extends RelationalOperation, @gtexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "GTExpr" }
|
||||
|
||||
override string getOperator() { result = ">" }
|
||||
|
@ -89,7 +89,7 @@ class GTExpr extends RelationalOperation, @gtexpr {
|
|||
* A C/C++ lesser than expression.
|
||||
*/
|
||||
class LTExpr extends RelationalOperation, @ltexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LTExpr" }
|
||||
|
||||
override string getOperator() { result = "<" }
|
||||
|
@ -102,7 +102,7 @@ class LTExpr extends RelationalOperation, @ltexpr {
|
|||
* A C/C++ greater than or equal expression.
|
||||
*/
|
||||
class GEExpr extends RelationalOperation, @geexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "GEExpr" }
|
||||
|
||||
override string getOperator() { result = ">=" }
|
||||
|
@ -115,7 +115,7 @@ class GEExpr extends RelationalOperation, @geexpr {
|
|||
* A C/C++ lesser than or equal expression.
|
||||
*/
|
||||
class LEExpr extends RelationalOperation, @leexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LEExpr" }
|
||||
|
||||
override string getOperator() { result = "<=" }
|
||||
|
|
|
@ -465,6 +465,9 @@ abstract class BinaryOperation extends Operation {
|
|||
*/
|
||||
class ParenthesizedBracedInitializerList extends Expr, @braced_init_list {
|
||||
override string toString() { result = "({...})" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ParenthesizedBracedInitializerList" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -472,6 +475,9 @@ class ParenthesizedBracedInitializerList extends Expr, @braced_init_list {
|
|||
*/
|
||||
class ParenthesisExpr extends Conversion, @parexpr {
|
||||
override string toString() { result = "(...)" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ParenthesisExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -479,6 +485,9 @@ class ParenthesisExpr extends Conversion, @parexpr {
|
|||
*/
|
||||
class ErrorExpr extends Expr, @errorexpr {
|
||||
override string toString() { result = "<error expr>" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ErrorExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -492,7 +501,7 @@ class AssumeExpr extends Expr, @assume {
|
|||
* A C/C++ comma expression.
|
||||
*/
|
||||
class CommaExpr extends Expr, @commaexpr {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CommaExpr" }
|
||||
|
||||
/**
|
||||
|
@ -524,7 +533,7 @@ class CommaExpr extends Expr, @commaexpr {
|
|||
* A C/C++ address-of expression.
|
||||
*/
|
||||
class AddressOfExpr extends UnaryOperation, @address_of {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AddressOfExpr" }
|
||||
|
||||
/** Gets the function or variable whose address is taken. */
|
||||
|
@ -556,6 +565,9 @@ class AddressOfExpr extends UnaryOperation, @address_of {
|
|||
class ReferenceToExpr extends Conversion, @reference_to {
|
||||
override string toString() { result = "(reference to)" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ReferenceToExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
}
|
||||
|
||||
|
@ -565,7 +577,7 @@ class ReferenceToExpr extends Conversion, @reference_to {
|
|||
* For user-defined types, see OverloadedPointerDereferenceExpr.
|
||||
*/
|
||||
class PointerDereferenceExpr extends UnaryOperation, @indirect {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "PointerDereferenceExpr" }
|
||||
|
||||
/**
|
||||
|
@ -600,6 +612,9 @@ class PointerDereferenceExpr extends UnaryOperation, @indirect {
|
|||
*/
|
||||
class ReferenceDereferenceExpr extends Conversion, @ref_indirect {
|
||||
override string toString() { result = "(reference dereference)" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ReferenceDereferenceExpr" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -703,7 +718,7 @@ class NewOrNewArrayExpr extends Expr, @any_new_expr {
|
|||
class NewExpr extends NewOrNewArrayExpr, @new_expr {
|
||||
override string toString() { result = "new" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NewExpr" }
|
||||
|
||||
/**
|
||||
|
@ -730,7 +745,7 @@ class NewExpr extends NewOrNewArrayExpr, @new_expr {
|
|||
class NewArrayExpr extends NewOrNewArrayExpr, @new_array_expr {
|
||||
override string toString() { result = "new[]" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NewArrayExpr" }
|
||||
|
||||
/**
|
||||
|
@ -776,7 +791,7 @@ class NewArrayExpr extends NewOrNewArrayExpr, @new_array_expr {
|
|||
class DeleteExpr extends Expr, @delete_expr {
|
||||
override string toString() { result = "delete" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DeleteExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -847,7 +862,7 @@ class DeleteExpr extends Expr, @delete_expr {
|
|||
class DeleteArrayExpr extends Expr, @delete_array_expr {
|
||||
override string toString() { result = "delete[]" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DeleteArrayExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -923,6 +938,9 @@ class StmtExpr extends Expr, @expr_stmt {
|
|||
*/
|
||||
Stmt getStmt() { result.getParent() = this }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "StmtExpr" }
|
||||
|
||||
/**
|
||||
* Gets the result expression of the enclosed statement. For example,
|
||||
* `a+b` is the result expression in this example:
|
||||
|
@ -948,7 +966,7 @@ private Expr getStmtResultExpr(Stmt stmt) {
|
|||
class ThisExpr extends Expr, @thisaccess {
|
||||
override string toString() { result = "this" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ThisExpr" }
|
||||
|
||||
override predicate mayBeImpure() {
|
||||
|
@ -986,7 +1004,7 @@ class BlockExpr extends Literal {
|
|||
class NoExceptExpr extends Expr, @noexceptexpr {
|
||||
override string toString() { result = "noexcept(...)" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NoExceptExpr" }
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,9 @@ class LambdaExpression extends Expr, @lambdaexpr {
|
|||
result = "[...](...){...}"
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LambdaExpression" }
|
||||
|
||||
/**
|
||||
* Gets an implicitly or explicitly captured value of this lambda expression.
|
||||
*/
|
||||
|
@ -75,6 +78,9 @@ class Closure extends Class {
|
|||
exists(LambdaExpression e | this = e.getType())
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Closure" }
|
||||
|
||||
/** Gets the lambda expression of which this is the type. */
|
||||
LambdaExpression getLambdaExpression() {
|
||||
result.getType() = this
|
||||
|
@ -99,6 +105,9 @@ class LambdaCapture extends @lambdacapture {
|
|||
result = getField().toString()
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LambdaCapture" }
|
||||
|
||||
/**
|
||||
* Holds if this capture was made implicitly.
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,7 @@ class Literal extends Expr, @literal {
|
|||
)
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Literal" }
|
||||
|
||||
override predicate mayBeImpure() {
|
||||
|
@ -102,6 +102,9 @@ class CharLiteral extends TextLiteral {
|
|||
this.getValueText().regexpMatch("(?s)\\s*L?'.*")
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CharLiteral" }
|
||||
|
||||
/**
|
||||
* Gets the character of this literal. For example `L'a'` has character `"a"`.
|
||||
*/
|
||||
|
@ -120,7 +123,7 @@ class StringLiteral extends TextLiteral
|
|||
// Note that `AggregateLiteral`s can also have an array type, but they derive from
|
||||
// @aggregateliteral rather than @literal.
|
||||
}
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "StringLiteral" }
|
||||
|
||||
}
|
||||
|
@ -132,6 +135,9 @@ class OctalLiteral extends Literal {
|
|||
OctalLiteral() {
|
||||
super.getValueText().regexpMatch("\\s*0[0-7]+[uUlL]*\\s*")
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "OctalLiteral" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -141,6 +147,9 @@ class HexLiteral extends Literal {
|
|||
HexLiteral() {
|
||||
super.getValueText().regexpMatch("\\s*0[xX][0-9a-fA-F]+[uUlL]*\\s*")
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "HexLiteral" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -173,6 +182,9 @@ class ClassAggregateLiteral extends AggregateLiteral {
|
|||
classType = this.getUnspecifiedType()
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ClassAggregateLiteral" }
|
||||
|
||||
/**
|
||||
* Gets the expression within the aggregate literal that is used to initialize
|
||||
* field `field`, if present.
|
||||
|
@ -232,6 +244,9 @@ class ArrayAggregateLiteral extends AggregateLiteral {
|
|||
arrayType = this.getUnspecifiedType()
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ArrayAggregateLiteral" }
|
||||
|
||||
/**
|
||||
* Gets the expression within the aggregate literal that is used to initialize
|
||||
* element `elementIndex`, if present.
|
||||
|
|
|
@ -12,7 +12,7 @@ abstract class UnaryLogicalOperation extends UnaryOperation {
|
|||
class NotExpr extends UnaryLogicalOperation, @notexpr {
|
||||
override string getOperator() { result = "!" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "NotExpr" }
|
||||
|
||||
override int getPrecedence() { result = 15 }
|
||||
|
@ -41,7 +41,7 @@ abstract class BinaryLogicalOperation extends BinaryOperation {
|
|||
class LogicalAndExpr extends BinaryLogicalOperation, @andlogicalexpr {
|
||||
override string getOperator() { result = "&&" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LogicalAndExpr" }
|
||||
|
||||
override int getPrecedence() { result = 5 }
|
||||
|
@ -59,7 +59,7 @@ class LogicalAndExpr extends BinaryLogicalOperation, @andlogicalexpr {
|
|||
class LogicalOrExpr extends BinaryLogicalOperation, @orlogicalexpr {
|
||||
override string getOperator() { result = "||" }
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LogicalOrExpr" }
|
||||
|
||||
override int getPrecedence() { result = 4 }
|
||||
|
@ -80,7 +80,7 @@ class ConditionalExpr extends Operation, @conditionalexpr {
|
|||
expr_cond_guard(underlyingElement(this), unresolveElement(result))
|
||||
}
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ConditionalExpr" }
|
||||
|
||||
/** Gets the 'then' expression of this conditional expression. */
|
||||
|
|
|
@ -11,7 +11,7 @@ import semmle.code.cpp.stmts.Stmt
|
|||
*/
|
||||
class Block extends Stmt, @stmt_block {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Block" }
|
||||
|
||||
/**
|
||||
|
|
|
@ -167,7 +167,7 @@ abstract class StmtParent extends ControlFlowNode {
|
|||
*/
|
||||
class ExprStmt extends Stmt, @stmt_expr {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ExprStmt" }
|
||||
|
||||
/**
|
||||
|
@ -222,7 +222,7 @@ abstract class ConditionalStmt extends ControlStructure {
|
|||
*/
|
||||
class IfStmt extends ConditionalStmt, @stmt_if {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "IfStmt" }
|
||||
|
||||
/**
|
||||
|
@ -318,7 +318,7 @@ abstract class Loop extends ControlStructure {
|
|||
* ```
|
||||
*/
|
||||
class WhileStmt extends Loop, @stmt_while {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "WhileStmt" }
|
||||
|
||||
override Expr getCondition() { result = this.getChild(0) }
|
||||
|
@ -387,7 +387,7 @@ class WhileStmt extends Loop, @stmt_while {
|
|||
*/
|
||||
abstract class JumpStmt extends Stmt, @jump {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "JumpStmt" }
|
||||
|
||||
/** Gets the target of this jump statement. */
|
||||
|
@ -404,7 +404,7 @@ abstract class JumpStmt extends Stmt, @jump {
|
|||
*/
|
||||
class GotoStmt extends JumpStmt, @stmt_goto {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "GotoStmt" }
|
||||
|
||||
/**
|
||||
|
@ -498,7 +498,7 @@ class ComputedGotoStmt extends Stmt, @stmt_assigned_goto {
|
|||
*/
|
||||
class ContinueStmt extends JumpStmt, @stmt_continue {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ContinueStmt" }
|
||||
|
||||
override string toString() { result = "continue;" }
|
||||
|
@ -530,7 +530,7 @@ private Stmt getEnclosingContinuable(Stmt s) {
|
|||
*/
|
||||
class BreakStmt extends JumpStmt, @stmt_break {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "BreakStmt" }
|
||||
|
||||
override string toString() { result = "break;" }
|
||||
|
@ -562,7 +562,7 @@ private Stmt getEnclosingBreakable(Stmt s) {
|
|||
*/
|
||||
class LabelStmt extends Stmt, @stmt_label {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "LabelStmt" }
|
||||
|
||||
/** Gets the name of this 'label' statement. */
|
||||
|
@ -591,7 +591,7 @@ class LabelStmt extends Stmt, @stmt_label {
|
|||
*/
|
||||
class ReturnStmt extends Stmt, @stmt_return {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ReturnStmt" }
|
||||
|
||||
/**
|
||||
|
@ -644,7 +644,7 @@ class ReturnStmt extends Stmt, @stmt_return {
|
|||
*/
|
||||
class DoStmt extends Loop, @stmt_end_test_while {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DoStmt" }
|
||||
|
||||
override Expr getCondition() { result = this.getChild(0) }
|
||||
|
@ -691,7 +691,7 @@ class DoStmt extends Loop, @stmt_end_test_while {
|
|||
* where `begin_expr` and `end_expr` depend on the type of `xs`.
|
||||
*/
|
||||
class RangeBasedForStmt extends Loop, @stmt_range_based_for {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "RangeBasedForStmt" }
|
||||
|
||||
/**
|
||||
|
@ -787,7 +787,7 @@ class RangeBasedForStmt extends Loop, @stmt_range_based_for {
|
|||
*/
|
||||
class ForStmt extends Loop, @stmt_for {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "ForStmt" }
|
||||
|
||||
/**
|
||||
|
@ -1016,7 +1016,7 @@ private predicate inForUpdate(Expr forUpdate, Expr child) {
|
|||
*/
|
||||
class SwitchCase extends Stmt, @stmt_switch_case {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SwitchCase" }
|
||||
|
||||
/**
|
||||
|
@ -1379,7 +1379,7 @@ class DefaultCase extends SwitchCase {
|
|||
* ```
|
||||
*/
|
||||
class SwitchStmt extends ConditionalStmt, @stmt_switch {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "SwitchStmt" }
|
||||
|
||||
/**
|
||||
|
@ -1592,6 +1592,9 @@ class Handler extends Stmt, @stmt_handler {
|
|||
|
||||
override string toString() { result = "<handler>" }
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "Handler" }
|
||||
|
||||
/**
|
||||
* Gets the block containing the implementation of this handler.
|
||||
*/
|
||||
|
@ -1646,7 +1649,7 @@ deprecated class FinallyEnd extends Stmt {
|
|||
*/
|
||||
class TryStmt extends Stmt, @stmt_try_block {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "TryStmt" }
|
||||
|
||||
override string toString() { result = "try { ... }" }
|
||||
|
@ -1726,13 +1729,15 @@ class FunctionTryStmt extends TryStmt {
|
|||
FunctionTryStmt() {
|
||||
not exists(this.getEnclosingBlock())
|
||||
}
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "FunctionTryStmt" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A 'catch block', from either C++'s `catch` or Objective C's `@catch`.
|
||||
*/
|
||||
class CatchBlock extends Block {
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CatchBlock" }
|
||||
|
||||
CatchBlock() { ishandler(underlyingElement(this)) }
|
||||
|
@ -1758,6 +1763,8 @@ class CatchAnyBlock extends CatchBlock {
|
|||
CatchAnyBlock() {
|
||||
not exists(this.getParameter())
|
||||
}
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "CatchAnyBlock" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1815,7 +1822,7 @@ class MicrosoftTryFinallyStmt extends MicrosoftTryStmt {
|
|||
*/
|
||||
class DeclStmt extends Stmt, @stmt_decl {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "DeclStmt" }
|
||||
|
||||
/**
|
||||
|
@ -1897,7 +1904,7 @@ class DeclStmt extends Stmt, @stmt_decl {
|
|||
*/
|
||||
class EmptyStmt extends Stmt, @stmt_empty {
|
||||
|
||||
/** Retrieves canonical QL class(es) corresponding to this element. */
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "EmptyStmt" }
|
||||
|
||||
override string toString() { result = ";" }
|
||||
|
@ -1918,6 +1925,9 @@ class AsmStmt extends Stmt, @stmt_asm {
|
|||
override string toString() {
|
||||
result = "asm statement"
|
||||
}
|
||||
|
||||
/** Canonical QL class corresponding to this element. */
|
||||
string getCanonicalQLClass() { result = "AsmStmt" }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче