[CPP-386] Add override keyword as needed; annotate a few more classes.

This commit is contained in:
Ziemowit Laski
2019-07-08 16:51:23 -07:00
parent e5fc07660d
commit ab82aebbd7
30 changed files with 242 additions and 203 deletions

View File

@@ -16,7 +16,7 @@ class Class extends UserType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Class" }
override string getCanonicalQLClass() { result = "Class" }
/** Gets a child declaration of this class. */
override Declaration getADeclaration() { result = this.getAMember() }
@@ -824,6 +824,8 @@ class LocalClass extends Class {
LocalClass() {
isLocal()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "LocalClass" }
override Function getEnclosingAccessHolder() {
result = this.getEnclosingFunction()
@@ -838,6 +840,9 @@ class NestedClass extends Class {
this.isMember()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "NestedClass" }
/** Holds if this member is private. */
predicate isPrivate() { this.hasSpecifier("private") }
@@ -984,7 +989,7 @@ class VirtualBaseClass extends Class {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VirtualBaseClass" }
override string getCanonicalQLClass() { result = "VirtualBaseClass" }
/** A virtual class derivation of which this class is the base. */
VirtualClassDerivation getAVirtualDerivation() {
@@ -1011,7 +1016,7 @@ class ProxyClass extends UserType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ProxyClass" }
override string getCanonicalQLClass() { result = "ProxyClass" }
/** Gets the location of the proxy class. */
override Location getLocation() {

View File

@@ -53,7 +53,11 @@ class ElementBase extends @element {
/** Gets a textual representation of this element. */
string toString() { none() }
/** Canonical QL class corresponding to this element. */
/**
* Canonical QL class corresponding to this element.
*
* ElementBase is the root class for this predicate.
*/
string getCanonicalQLClass() { result = "???" }
}

View File

@@ -10,7 +10,7 @@ class Enum extends UserType, IntegralOrEnumType {
EnumConstant getEnumConstant(int index) { enumconstants(unresolveElement(result),underlyingElement(this),index,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Enum" }
override string getCanonicalQLClass() { result = "Enum" }
/**
* Gets a descriptive string for the enum. This method is only intended to
@@ -54,7 +54,7 @@ class LocalEnum extends Enum {
isLocal()
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LocalEnum" }
override string getCanonicalQLClass() { result = "LocalEnum" }
}
/**
@@ -67,7 +67,7 @@ class NestedEnum extends Enum {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NestedEnum" }
override string getCanonicalQLClass() { result = "NestedEnum" }
/** Holds if this member is private. */
predicate isPrivate() { this.hasSpecifier("private") }
@@ -90,7 +90,7 @@ class ScopedEnum extends Enum {
usertypes(underlyingElement(this),_,13)
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ScopedEnum" }
override string getCanonicalQLClass() { result = "ScopedEnum" }
}
/**
@@ -107,7 +107,7 @@ class EnumConstant extends Declaration, @enumconstant {
Enum getDeclaringEnum() { enumconstants(underlyingElement(this),unresolveElement(result),_,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "EnumConstant" }
override string getCanonicalQLClass() { result = "EnumConstant" }
override Class getDeclaringType() {
result = this.getDeclaringEnum().getDeclaringType()

View File

@@ -708,7 +708,7 @@ class TopLevelFunction extends Function {
not this.isMember()
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "TopLevelFunction" }
override string getCanonicalQLClass() { result = "TopLevelFunction" }
}
/**
@@ -721,7 +721,7 @@ class MemberFunction extends Function {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "MemberFunction" }
override string getCanonicalQLClass() { result = "MemberFunction" }
/**
* Gets the number of parameters of this function, including any implicit
@@ -775,7 +775,7 @@ class VirtualFunction extends MemberFunction {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VirtualFunction" }
override string getCanonicalQLClass() { result = "VirtualFunction" }
/** Holds if this virtual function is pure. */
predicate isPure() { this instanceof PureVirtualFunction }
@@ -795,7 +795,7 @@ class PureVirtualFunction extends VirtualFunction {
PureVirtualFunction() { purefunctions(underlyingElement(this)) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PureVirtualFunction" }
override string getCanonicalQLClass() { result = "PureVirtualFunction" }
}
/**
@@ -808,7 +808,7 @@ class ConstMemberFunction extends MemberFunction {
ConstMemberFunction() { this.hasSpecifier("const") }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ConstMemberFunction" }
override string getCanonicalQLClass() { result = "ConstMemberFunction" }
}
/**
@@ -819,7 +819,7 @@ class Constructor extends MemberFunction {
Constructor() { functions(underlyingElement(this),_,2) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Constructor" }
override string getCanonicalQLClass() { result = "Constructor" }
/**
* Holds if this constructor serves as a default constructor.
@@ -867,7 +867,7 @@ class ConversionConstructor extends Constructor, ImplicitConversionFunction {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ConversionConstructor" }
override string getCanonicalQLClass() { result = "ConversionConstructor" }
/** Gets the type this `ConversionConstructor` takes as input. */
override Type getSourceType() { result = this.getParameter(0).getType() }
@@ -925,7 +925,7 @@ class CopyConstructor extends Constructor {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CopyConstructor" }
override string getCanonicalQLClass() { result = "CopyConstructor" }
/**
* Holds if we cannot determine that this constructor will become a copy
@@ -976,7 +976,7 @@ class MoveConstructor extends Constructor {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "MoveConstructor" }
override string getCanonicalQLClass() { result = "MoveConstructor" }
/**
* Holds if we cannot determine that this constructor will become a move
@@ -1011,7 +1011,7 @@ class Destructor extends MemberFunction {
Destructor() { functions(underlyingElement(this),_,3) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Destructor" }
override string getCanonicalQLClass() { result = "Destructor" }
/**
* Gets a compiler-generated action which destructs a base class or member
@@ -1073,7 +1073,7 @@ class CopyAssignmentOperator extends Operator {
not exists(getATemplateArgument())
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CopyAssignmentOperator" }
override string getCanonicalQLClass() { result = "CopyAssignmentOperator" }
}
@@ -1094,7 +1094,7 @@ class MoveAssignmentOperator extends Operator {
not exists(getATemplateArgument())
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "MoveAssignmentOperator" }
override string getCanonicalQLClass() { result = "MoveAssignmentOperator" }
}
@@ -1116,7 +1116,7 @@ class TemplateFunction extends Function {
TemplateFunction() { is_function_template(underlyingElement(this)) and exists(getATemplateArgument()) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "TemplateFunction" }
override string getCanonicalQLClass() { result = "TemplateFunction" }
/**
* Gets a compiler-generated instantiation of this function template.
*/
@@ -1149,7 +1149,7 @@ class FunctionTemplateInstantiation extends Function {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionTemplateSpecialization" }
override string getCanonicalQLClass() { result = "FunctionTemplateInstantiation" }
/**
* Gets the function template from which this instantiation was instantiated.
@@ -1188,7 +1188,7 @@ class FunctionTemplateSpecialization extends Function {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionTemplateSpecialization" }
override string getCanonicalQLClass() { result = "FunctionTemplateSpecialization" }
/**
* Gets the primary template for the specialization (the function template

View File

@@ -7,7 +7,7 @@ class Initializer extends ControlFlowNode, @initialiser {
override Location getLocation() { initialisers(underlyingElement(this),_,_,result) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Initializer" }
override string getCanonicalQLClass() { result = "Initializer" }
/** Holds if this initializer is explicit in the source. */
override predicate fromSource() {

View File

@@ -34,7 +34,7 @@ class Parameter extends LocalScopeVariable, @parameter {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Parameter" }
override string getCanonicalQLClass() { result = "Parameter" }
/**
* Gets the name of this parameter, including it's type.

View File

@@ -160,9 +160,11 @@ class PrintASTNode extends TPrintASTNode {
}
/**
* A concatenation of all the leaf QL types of `el`
* Retrieves the caonical QL class for entity `el`
*/
private string qlClass(ElementBase el) { result = "["+ el.getCanonicalQLClass() + "]: " }
// Do not delete this - it is useful for QL class discovery
//private string qlClass(ElementBase el) { result = "["+ concat(el.getAQlClass(), ",") + "]: " }
/**

View File

@@ -9,7 +9,7 @@ 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 getCanonicalQLClass() { result = "Struct" }
override string explain() { result = "struct " + this.getName() }
@@ -23,6 +23,8 @@ class LocalStruct extends Struct {
LocalStruct() {
isLocal()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "LocalStruct" }
}
/**
@@ -33,6 +35,9 @@ class NestedStruct extends Struct {
this.isMember()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "NestedStruct" }
/** Holds if this member is private. */
predicate isPrivate() { this.hasSpecifier("private") }

View File

@@ -332,7 +332,7 @@ class UnknownType extends BuiltInType {
UnknownType() { builtintypes(underlyingElement(this),_,2,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "UnknownType" }
override string getCanonicalQLClass() { result = "UnknownType" }
}
private predicate isArithmeticType(@builtintype type, int kind) {
@@ -488,7 +488,7 @@ class BoolType extends IntegralType {
BoolType() { builtintypes(underlyingElement(this),_,4,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BoolType" }
override string getCanonicalQLClass() { result = "BoolType" }
}
/**
@@ -504,7 +504,7 @@ class PlainCharType extends CharType {
builtintypes(underlyingElement(this),_,5,_,_,_)
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PlainCharType" }
override string getCanonicalQLClass() { result = "PlainCharType" }
}
/**
@@ -515,7 +515,7 @@ class UnsignedCharType extends CharType {
builtintypes(underlyingElement(this),_,6,_,_,_)
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "UnsignedCharType" }
override string getCanonicalQLClass() { result = "UnsignedCharType" }
}
/**
@@ -526,7 +526,7 @@ class SignedCharType extends CharType {
builtintypes(underlyingElement(this),_,7,_,_,_)
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SignedCharType" }
override string getCanonicalQLClass() { result = "SignedCharType" }
}
/**
@@ -539,7 +539,7 @@ class ShortType extends IntegralType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ShortType" }
override string getCanonicalQLClass() { result = "ShortType" }
}
/**
@@ -552,7 +552,7 @@ class IntType extends IntegralType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "IntType" }
override string getCanonicalQLClass() { result = "IntType" }
}
/**
@@ -565,7 +565,7 @@ class LongType extends IntegralType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LongType" }
override string getCanonicalQLClass() { result = "LongType" }
}
/**
@@ -578,7 +578,7 @@ class LongLongType extends IntegralType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LongLongType" }
override string getCanonicalQLClass() { result = "LongLongType" }
}
/**
@@ -611,7 +611,7 @@ class FloatType extends FloatingPointType {
FloatType() { builtintypes(underlyingElement(this),_,24,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FloatType" }
override string getCanonicalQLClass() { result = "FloatType" }
}
/**
@@ -622,7 +622,7 @@ class DoubleType extends FloatingPointType {
DoubleType() { builtintypes(underlyingElement(this),_,25,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DoubleType" }
override string getCanonicalQLClass() { result = "DoubleType" }
}
/**
@@ -633,7 +633,7 @@ class LongDoubleType extends FloatingPointType {
LongDoubleType() { builtintypes(underlyingElement(this),_,26,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LongDoubleType" }
override string getCanonicalQLClass() { result = "LongDoubleType" }
}
/**
@@ -680,7 +680,7 @@ class VoidType extends BuiltInType {
VoidType() { builtintypes(underlyingElement(this),_,3,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VoidType" }
override string getCanonicalQLClass() { result = "VoidType" }
}
/**
@@ -695,7 +695,7 @@ class WideCharType extends IntegralType {
WideCharType() { builtintypes(underlyingElement(this),_,33,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "WideCharType" }
override string getCanonicalQLClass() { result = "WideCharType" }
}
/**
@@ -706,7 +706,7 @@ class Char16Type extends IntegralType {
Char16Type() { builtintypes(underlyingElement(this),_,43,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Char16Type" }
override string getCanonicalQLClass() { result = "Char16Type" }
}
/**
@@ -717,7 +717,7 @@ class Char32Type extends IntegralType {
Char32Type() { builtintypes(underlyingElement(this),_,44,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Char32Type" }
override string getCanonicalQLClass() { result = "Char32Type" }
}
/**
@@ -733,7 +733,7 @@ class NullPointerType extends BuiltInType {
NullPointerType() { builtintypes(underlyingElement(this),_,34,_,_,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NullPointerType" }
override string getCanonicalQLClass() { result = "NullPointerType" }
}
/**
@@ -896,7 +896,7 @@ class PointerType extends DerivedType {
PointerType() { derivedtypes(underlyingElement(this),_,1,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerType" }
override string getCanonicalQLClass() { result = "PointerType" }
override int getPointerIndirectionLevel() {
result = 1 + this.getBaseType().getPointerIndirectionLevel()
@@ -947,7 +947,7 @@ class LValueReferenceType extends ReferenceType {
LValueReferenceType() { derivedtypes(underlyingElement(this),_,2,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LValueReferenceType" }
override string getCanonicalQLClass() { result = "LValueReferenceType" }
}
/**
@@ -957,7 +957,7 @@ class RValueReferenceType extends ReferenceType {
RValueReferenceType() { derivedtypes(underlyingElement(this),_,8,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "RValueReferenceType" }
override string getCanonicalQLClass() { result = "RValueReferenceType" }
override string explain() { result = "rvalue " + super.explain() }
}
@@ -970,7 +970,7 @@ class SpecifiedType extends DerivedType {
SpecifiedType() { derivedtypes(underlyingElement(this),_,3,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SpecifiedType" }
override string getCanonicalQLClass() { result = "SpecifiedType" }
override int getSize() { result = this.getBaseType().getSize() }
@@ -1015,7 +1015,7 @@ class ArrayType extends DerivedType {
ArrayType() { derivedtypes(underlyingElement(this),_,4,_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ArrayType" }
override string getCanonicalQLClass() { result = "ArrayType" }
predicate hasArraySize() { arraysizes(underlyingElement(this),_,_,_) }
@@ -1106,7 +1106,7 @@ class FunctionPointerType extends FunctionPointerIshType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionPointerType" }
override string getCanonicalQLClass() { result = "FunctionPointerType" }
override int getPointerIndirectionLevel() {
result = 1
@@ -1124,7 +1124,7 @@ class FunctionReferenceType extends FunctionPointerIshType {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionReferenceType" }
override string getCanonicalQLClass() { result = "FunctionReferenceType" }
override int getPointerIndirectionLevel() {
result = getBaseType().getPointerIndirectionLevel()
@@ -1197,7 +1197,7 @@ class PointerToMemberType extends Type, @ptrtomember {
override string toString() { result = this.getName() }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerToMemberType" }
override string getCanonicalQLClass() { result = "PointerToMemberType" }
/** the name of this type */
override string getName() { result = "..:: *" }
@@ -1234,7 +1234,7 @@ class RoutineType extends Type, @routinetype {
override string toString() { result = this.getName() }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "RoutineType" }
override string getCanonicalQLClass() { result = "RoutineType" }
override string getName() { result = "..()(..)" }
@@ -1292,7 +1292,7 @@ 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 string getCanonicalQLClass() { result = "TemplateParameter" }
override predicate involvesTemplateParameter() {
any()
@@ -1307,7 +1307,7 @@ class TemplateTemplateParameter extends TemplateParameter
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "TemplateTemplateParameter" }
override string getCanonicalQLClass() { result = "TemplateTemplateParameter" }
}
/**

View File

@@ -9,7 +9,7 @@ class TypedefType extends UserType {
TypedefType() { usertypes(underlyingElement(this),_,5) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "TypedefType" }
override string getCanonicalQLClass() { result = "TypedefType" }
/**
* Gets the base type of this typedef type.
@@ -60,6 +60,8 @@ class LocalTypedefType extends TypedefType {
LocalTypedefType() {
isLocal()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "LocalTypedefType" }
}
/**
@@ -70,6 +72,9 @@ class NestedTypedefType extends TypedefType {
this.isMember()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "NestedTypedefType" }
/**
* DEPRECATED
* Holds if this member is private.

View File

@@ -9,7 +9,7 @@ class Union extends Struct {
Union() { usertypes(underlyingElement(this),_,3) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Union" }
override string getCanonicalQLClass() { result = "Union" }
override string explain() { result = "union " + this.getName() }
@@ -24,6 +24,8 @@ class LocalUnion extends Union {
LocalUnion() {
isLocal()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "LocalUnion" }
}
/**
@@ -34,6 +36,9 @@ class NestedUnion extends Union {
this.isMember()
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "NestedUnion" }
/** Holds if this member is private. */
predicate isPrivate() { this.hasSpecifier("private") }

View File

@@ -175,7 +175,7 @@ class VariableDeclarationEntry extends DeclarationEntry, @var_decl {
override Variable getDeclaration() { result = getVariable() }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VariableDeclarationEntry" }
override string getCanonicalQLClass() { result = "VariableDeclarationEntry" }
/**
* Gets the variable which is being declared or defined.

View File

@@ -8,7 +8,7 @@ class CharPointerType extends PointerType {
CharPointerType() { this.getBaseType() instanceof CharType }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CharPointerType" }
override string getCanonicalQLClass() { result = "CharPointerType" }
}
/**
@@ -19,7 +19,7 @@ class IntPointerType extends PointerType {
IntPointerType() { this.getBaseType() instanceof IntType }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "IntPointerType" }
override string getCanonicalQLClass() { result = "IntPointerType" }
}
@@ -31,7 +31,7 @@ class VoidPointerType extends PointerType {
VoidPointerType() { this.getBaseType() instanceof VoidType }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VoidPointerType" }
override string getCanonicalQLClass() { result = "VoidPointerType" }
}
/**
@@ -43,7 +43,7 @@ class Size_t extends Type {
this.hasName("size_t")
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Size_t" }
override string getCanonicalQLClass() { result = "Size_t" }
}
/**
@@ -55,7 +55,7 @@ class Ssize_t extends Type {
this.hasName("ssize_t")
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Ssize_t" }
override string getCanonicalQLClass() { result = "Ssize_t" }
}
/**
@@ -67,7 +67,7 @@ class Ptrdiff_t extends Type {
this.hasName("ptrdiff_t")
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Ptrdiff_t" }
override string getCanonicalQLClass() { result = "Ptrdiff_t" }
}
/**
@@ -78,6 +78,8 @@ class Intmax_t extends Type {
this.getUnderlyingType() instanceof IntegralType and
this.hasName("intmax_t")
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "Intmax_t" }
}
/**
@@ -88,6 +90,8 @@ class Uintmax_t extends Type {
this.getUnderlyingType() instanceof IntegralType and
this.hasName("uintmax_t")
}
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "Uintmax_t" }
}
/**
@@ -103,7 +107,7 @@ class Wchar_t extends Type {
this.hasName("wchar_t")
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Wchar_t" }
override string getCanonicalQLClass() { result = "Wchar_t" }
}
/**

View File

@@ -10,11 +10,14 @@ import semmle.code.cpp.models.implementations.Printf
/**
* A function that can be identified as a `printf` style formatting
* function by it's use of the GNU `format` attribute.
* function by its use of the GNU `format` attribute.
*/
class AttributeFormattingFunction extends FormattingFunction {
FormatAttribute printf_attrib;
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "AttributeFormattingFunction" }
AttributeFormattingFunction() {
printf_attrib = getAnAttribute() and
(
@@ -64,6 +67,9 @@ predicate variadicFormatter(Function f, int formatParamIndex) {
* string and a variable number of arguments.
*/
class UserDefinedFormattingFunction extends FormattingFunction {
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "UserDefinedFormattingFunction" }
UserDefinedFormattingFunction() { isVarargs() and callsVariadicFormatter(this, _) }
override int getFormatParameterIndex() { callsVariadicFormatter(this, result) }
@@ -76,7 +82,7 @@ class FormattingFunctionCall extends Expr {
FormattingFunctionCall() { this.(Call).getTarget() instanceof FormattingFunction }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FormattingFunctionCall" }
override string getCanonicalQLClass() { result = "FormattingFunctionCall" }
/**
* Gets the formatting function being called.

View File

@@ -14,9 +14,9 @@ abstract class NullValue extends Expr
class Zero extends NullValue
{
Zero() { this.(Literal).getValue() = "0" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Zero" }
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "Zero" }
}
/**

View File

@@ -25,7 +25,7 @@ abstract class Access extends Expr, NameQualifiableElement {
*/
class EnumConstantAccess extends Access, @varaccess {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "EnumConstantAccess" }
override string getCanonicalQLClass() { result = "EnumConstantAccess" }
EnumConstantAccess() {
exists(EnumConstant c | varbind(underlyingElement(this), unresolveElement(c)))
@@ -43,7 +43,7 @@ class EnumConstantAccess extends Access, @varaccess {
*/
class VariableAccess extends Access, @varaccess {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VariableAccess" }
override string getCanonicalQLClass() { result = "VariableAccess" }
VariableAccess() {
not exists(EnumConstant c | varbind(underlyingElement(this), unresolveElement(c)))
@@ -140,7 +140,7 @@ class VariableAccess extends Access, @varaccess {
*/
class FieldAccess extends VariableAccess {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FieldAccess" }
override string getCanonicalQLClass() { result = "FieldAccess" }
FieldAccess() { exists(Field f | varbind(underlyingElement(this), unresolveElement(f))) }
@@ -243,7 +243,7 @@ class FunctionAccess extends Access, @routineexpr {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionAccess" }
override string getCanonicalQLClass() { result = "FunctionAccess" }
/** Gets the accessed function. */
override Function getTarget() { funbind(underlyingElement(this), unresolveElement(result)) }
@@ -293,7 +293,7 @@ class TypeName extends Expr, @type_operand {
*/
class ArrayExpr extends Expr, @subscriptexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ArrayExpr" }
override string getCanonicalQLClass() { result = "ArrayExpr" }
/**
* Gets the array or pointer expression being subscripted.

View File

@@ -13,7 +13,7 @@ class UnaryMinusExpr extends UnaryArithmeticOperation, @arithnegexpr {
override string getOperator() { result = "-" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "UnaryMinusExpr" }
override string getCanonicalQLClass() { result = "UnaryMinusExpr" }
override int getPrecedence() { result = 15 }
}
@@ -25,7 +25,7 @@ class UnaryPlusExpr extends UnaryArithmeticOperation, @unaryplusexpr {
override string getOperator() { result = "+" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "UnaryPlusExpr" }
override string getCanonicalQLClass() { result = "UnaryPlusExpr" }
override int getPrecedence() { result = 15 }
}
@@ -97,7 +97,7 @@ class PrefixIncrExpr extends IncrementOperation, PrefixCrementOperation, @preinc
override string getOperator() { result = "++" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PrefixIncrExpr" }
override string getCanonicalQLClass() { result = "PrefixIncrExpr" }
override int getPrecedence() { result = 15 }
}
@@ -111,7 +111,7 @@ class PrefixDecrExpr extends DecrementOperation, PrefixCrementOperation, @predec
override string getOperator() { result = "--" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PrefixDecrExpr" }
override string getCanonicalQLClass() { result = "PrefixDecrExpr" }
override int getPrecedence() { result = 15 }
}
@@ -125,7 +125,7 @@ class PostfixIncrExpr extends IncrementOperation, PostfixCrementOperation, @post
override string getOperator() { result = "++" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PostfixIncrExpr" }
override string getCanonicalQLClass() { result = "PostfixIncrExpr" }
override int getPrecedence() { result = 16 }
@@ -141,7 +141,7 @@ class PostfixDecrExpr extends DecrementOperation, PostfixCrementOperation, @post
override string getOperator() { result = "--" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PostfixDecrExpr" }
override string getCanonicalQLClass() { result = "PostfixDecrExpr" }
override int getPrecedence() { result = 16 }
@@ -175,7 +175,7 @@ class AddExpr extends BinaryArithmeticOperation, @addexpr {
override string getOperator() { result = "+" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AddExpr" }
override string getCanonicalQLClass() { result = "AddExpr" }
override int getPrecedence() { result = 12 }
}
@@ -187,7 +187,7 @@ class SubExpr extends BinaryArithmeticOperation, @subexpr {
override string getOperator() { result = "-" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SubExpr" }
override string getCanonicalQLClass() { result = "SubExpr" }
override int getPrecedence() { result = 12 }
}
@@ -199,7 +199,7 @@ class MulExpr extends BinaryArithmeticOperation, @mulexpr {
override string getOperator() { result = "*" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "MulExpr" }
override string getCanonicalQLClass() { result = "MulExpr" }
override int getPrecedence() { result = 13 }
}
@@ -211,7 +211,7 @@ class DivExpr extends BinaryArithmeticOperation, @divexpr {
override string getOperator() { result = "/" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DivExpr" }
override string getCanonicalQLClass() { result = "DivExpr" }
override int getPrecedence() { result = 13 }
}
@@ -223,7 +223,7 @@ class RemExpr extends BinaryArithmeticOperation, @remexpr {
override string getOperator() { result = "%" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "RemExpr" }
override string getCanonicalQLClass() { result = "RemExpr" }
override int getPrecedence() { result = 13 }
}
@@ -309,7 +309,7 @@ class PointerAddExpr extends PointerArithmeticOperation, @paddexpr {
override string getOperator() { result = "+" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerAddExpr" }
override string getCanonicalQLClass() { result = "PointerAddExpr" }
override int getPrecedence() { result = 12 }
}
@@ -321,7 +321,7 @@ class PointerSubExpr extends PointerArithmeticOperation, @psubexpr {
override string getOperator() { result = "-" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerSubExpr" }
override string getCanonicalQLClass() { result = "PointerSubExpr" }
override int getPrecedence() { result = 12 }
}
@@ -333,7 +333,7 @@ class PointerDiffExpr extends PointerArithmeticOperation, @pdiffexpr {
override string getOperator() { result = "-" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerDiffExpr" }
override string getCanonicalQLClass() { result = "PointerDiffExpr" }
override int getPrecedence() { result = 12 }
}

View File

@@ -33,7 +33,7 @@ class AssignExpr extends Assignment, @assignexpr {
override string getOperator() { result = "=" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignExpr" }
override string getCanonicalQLClass() { result = "AssignExpr" }
/** Gets a textual representation of this assignment. */
override string toString() { result = "... = ..." }
@@ -58,7 +58,7 @@ abstract class AssignArithmeticOperation extends AssignOperation {
*/
class AssignAddExpr extends AssignArithmeticOperation, @assignaddexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignAddExpr" }
override string getCanonicalQLClass() { result = "AssignAddExpr" }
override string getOperator() { result = "+=" }
}
@@ -68,7 +68,7 @@ class AssignAddExpr extends AssignArithmeticOperation, @assignaddexpr {
*/
class AssignSubExpr extends AssignArithmeticOperation, @assignsubexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignSubExpr" }
override string getCanonicalQLClass() { result = "AssignSubExpr" }
override string getOperator() { result = "-=" }
}
@@ -78,7 +78,7 @@ class AssignSubExpr extends AssignArithmeticOperation, @assignsubexpr {
*/
class AssignMulExpr extends AssignArithmeticOperation, @assignmulexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignMulExpr" }
override string getCanonicalQLClass() { result = "AssignMulExpr" }
override string getOperator() { result = "*=" }
}
@@ -88,7 +88,7 @@ class AssignMulExpr extends AssignArithmeticOperation, @assignmulexpr {
*/
class AssignDivExpr extends AssignArithmeticOperation, @assigndivexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignDivExpr" }
override string getCanonicalQLClass() { result = "AssignDivExpr" }
override string getOperator() { result = "/=" }
}
@@ -98,7 +98,7 @@ class AssignDivExpr extends AssignArithmeticOperation, @assigndivexpr {
*/
class AssignRemExpr extends AssignArithmeticOperation, @assignremexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignRemExpr" }
override string getCanonicalQLClass() { result = "AssignRemExpr" }
override string getOperator() { result = "%=" }
}
@@ -115,7 +115,7 @@ abstract class AssignBitwiseOperation extends AssignOperation {
*/
class AssignAndExpr extends AssignBitwiseOperation, @assignandexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignAndExpr" }
override string getCanonicalQLClass() { result = "AssignAndExpr" }
override string getOperator() { result = "&=" }
}
@@ -125,7 +125,7 @@ class AssignAndExpr extends AssignBitwiseOperation, @assignandexpr {
*/
class AssignOrExpr extends AssignBitwiseOperation, @assignorexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignOrExpr" }
override string getCanonicalQLClass() { result = "AssignOrExpr" }
override string getOperator() { result = "|=" }
}
@@ -135,7 +135,7 @@ class AssignOrExpr extends AssignBitwiseOperation, @assignorexpr {
*/
class AssignXorExpr extends AssignBitwiseOperation, @assignxorexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignXorExpr" }
override string getCanonicalQLClass() { result = "AssignXorExpr" }
override string getOperator() { result = "^=" }
}
@@ -145,7 +145,7 @@ class AssignXorExpr extends AssignBitwiseOperation, @assignxorexpr {
*/
class AssignLShiftExpr extends AssignBitwiseOperation, @assignlshiftexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignLShiftExpr" }
override string getCanonicalQLClass() { result = "AssignLShiftExpr" }
override string getOperator() { result = "<<=" }
}
@@ -155,7 +155,7 @@ class AssignLShiftExpr extends AssignBitwiseOperation, @assignlshiftexpr {
*/
class AssignRShiftExpr extends AssignBitwiseOperation, @assignrshiftexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignRShiftExpr" }
override string getCanonicalQLClass() { result = "AssignRShiftExpr" }
override string getOperator() { result = ">>=" }
}
@@ -165,7 +165,7 @@ class AssignRShiftExpr extends AssignBitwiseOperation, @assignrshiftexpr {
*/
class AssignPointerAddExpr extends AssignOperation, @assignpaddexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignPointerAddExpr" }
override string getCanonicalQLClass() { result = "AssignPointerAddExpr" }
override string getOperator() { result = "+=" }
}
@@ -175,7 +175,7 @@ class AssignPointerAddExpr extends AssignOperation, @assignpaddexpr {
*/
class AssignPointerSubExpr extends AssignOperation, @assignpsubexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AssignPointerSubExpr" }
override string getCanonicalQLClass() { result = "AssignPointerSubExpr" }
override string getOperator() { result = "-=" }
}
@@ -197,7 +197,7 @@ class ConditionDeclExpr extends Expr, @condition_decl {
Expr getExpr() { result = this.getChild(0) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ConditionDeclExpr" }
override string getCanonicalQLClass() { result = "ConditionDeclExpr" }
/**
* Gets the compiler-generated variable access that conceptually occurs after

View File

@@ -15,7 +15,7 @@ class ComplementExpr extends UnaryBitwiseOperation, @complementexpr {
override int getPrecedence() { result = 15 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ComplementExpr" }
override string getCanonicalQLClass() { result = "ComplementExpr" }
}
/**
@@ -34,7 +34,7 @@ class LShiftExpr extends BinaryBitwiseOperation, @lshiftexpr {
override int getPrecedence() { result = 11 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LShiftExpr" }
override string getCanonicalQLClass() { result = "LShiftExpr" }
}
/**
@@ -46,7 +46,7 @@ class RShiftExpr extends BinaryBitwiseOperation, @rshiftexpr {
override int getPrecedence() { result = 11 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "RShiftExpr" }
override string getCanonicalQLClass() { result = "RShiftExpr" }
}
/**
@@ -58,7 +58,7 @@ class BitwiseAndExpr extends BinaryBitwiseOperation, @andexpr {
override int getPrecedence() { result = 8 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BitwiseAndExpr" }
override string getCanonicalQLClass() { result = "BitwiseAndExpr" }
}
/**
@@ -70,7 +70,7 @@ class BitwiseOrExpr extends BinaryBitwiseOperation, @orexpr {
override int getPrecedence() { result = 6 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BitwiseOrExpr" }
override string getCanonicalQLClass() { result = "BitwiseOrExpr" }
}
/**
@@ -82,5 +82,5 @@ class BitwiseXorExpr extends BinaryBitwiseOperation, @xorexpr {
override int getPrecedence() { result = 7 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BitwiseXorExpr" }
override string getCanonicalQLClass() { result = "BitwiseXorExpr" }
}

View File

@@ -13,7 +13,7 @@ class BuiltInVarArgsStart extends BuiltInOperation, @vastartexpr {
override string toString() { result = "__builtin_va_start" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BuiltInVarArgsStart" }
override string getCanonicalQLClass() { result = "BuiltInVarArgsStart" }
}
/**
@@ -23,7 +23,7 @@ class BuiltInVarArgsEnd extends BuiltInOperation, @vaendexpr {
override string toString() { result = "__builtin_va_end" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BuiltInVarArgsEnd" }
override string getCanonicalQLClass() { result = "BuiltInVarArgsEnd" }
}
/**
@@ -33,7 +33,7 @@ class BuiltInVarArg extends BuiltInOperation, @vaargexpr {
override string toString() { result = "__builtin_va_arg" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BuiltInVarArg" }
override string getCanonicalQLClass() { result = "BuiltInVarArg" }
}
/**
@@ -43,7 +43,7 @@ class BuiltInVarArgCopy extends BuiltInOperation, @vacopyexpr {
override string toString() { result = "__builtin_va_copy" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BuiltInVarArgCopy" }
override string getCanonicalQLClass() { result = "BuiltInVarArgCopy" }
}
/**

View File

@@ -150,7 +150,7 @@ class FunctionCall extends Call, @funbindexpr {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionCall" }
override string getCanonicalQLClass() { result = "FunctionCall" }
/** Gets an explicit template argument for this call. */
Type getAnExplicitTemplateArgument() {
@@ -351,7 +351,7 @@ class ExprCall extends Call, @callexpr {
Expr getExpr() { result = this.getChild(0) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ExprCall" }
override string getCanonicalQLClass() { result = "ExprCall" }
override Expr getAnArgument() {
exists(int i | result = this.getChild(i) and i >= 1)
@@ -374,7 +374,7 @@ class VariableCall extends ExprCall {
VariableCall() { this.getExpr() instanceof VariableAccess }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VariableCall" }
override string getCanonicalQLClass() { result = "VariableCall" }
/**
* Gets the variable which yields the function pointer to call.
@@ -391,7 +391,7 @@ class ConstructorCall extends FunctionCall {
ConstructorCall() { super.getTarget() instanceof Constructor }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ConstructorCall" }
override string getCanonicalQLClass() { result = "ConstructorCall" }
/** Gets the constructor being called. */
override Constructor getTarget() { result = super.getTarget() }
@@ -408,7 +408,7 @@ 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 getCanonicalQLClass() { result = "ThrowExpr" }
override string toString() { result = "throw ..." }
@@ -422,7 +422,7 @@ class ReThrowExpr extends ThrowExpr {
ReThrowExpr() { this.getType() instanceof VoidType }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ReThrowExpr" }
override string getCanonicalQLClass() { result = "ReThrowExpr" }
override string toString() { result = "re-throw exception " }
}
@@ -434,7 +434,7 @@ class DestructorCall extends FunctionCall {
DestructorCall() { super.getTarget() instanceof Destructor }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DestructorCall" }
override string getCanonicalQLClass() { result = "DestructorCall" }
/** Gets the destructor being called. */
override Destructor getTarget() { result = super.getTarget() }
@@ -454,7 +454,7 @@ 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 getCanonicalQLClass() { result = "VacuousDestructorCall" }
override string toString() { result = "(vacuous destructor call)" }
}
@@ -506,7 +506,7 @@ class ConstructorFieldInit extends ConstructorInit, @ctorfieldinit {
Field getTarget() { varbind(underlyingElement(this),unresolveElement(result)) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ConstructorFieldInit" }
override string getCanonicalQLClass() { result = "ConstructorFieldInit" }
/**
* Gets the expression to which the field is initialized.
@@ -568,7 +568,7 @@ class DestructorFieldDestruction extends DestructorDestruction, @dtorfielddestru
Field getTarget() { varbind(underlyingElement(this),unresolveElement(result)) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DestructorFieldDestruction" }
override string getCanonicalQLClass() { result = "DestructorFieldDestruction" }
/** Gets the compiler-generated call to the variable's destructor. */
DestructorCall getExpr() { result = this.getChild(0) }

View File

@@ -156,7 +156,7 @@ class IntegralConversion extends ArithmeticConversion {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "IntegralConversion" }
override string getCanonicalQLClass() { result = "IntegralConversion" }
override string getSemanticConversionString() {
result = "integral conversion"
@@ -173,7 +173,7 @@ class FloatingPointConversion extends ArithmeticConversion {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FloatingPointConversion" }
override string getCanonicalQLClass() { result = "FloatingPointConversion" }
override string getSemanticConversionString() {
result = "floating point conversion"
@@ -190,7 +190,7 @@ class FloatingPointToIntegralConversion extends ArithmeticConversion {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FloatingPointToIntegralConversion" }
override string getCanonicalQLClass() { result = "FloatingPointToIntegralConversion" }
override string getSemanticConversionString() {
result = "floating point to integral conversion"
@@ -207,7 +207,7 @@ class IntegralToFloatingPointConversion extends ArithmeticConversion {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "IntegralToFloatingPointConversion" }
override string getCanonicalQLClass() { result = "IntegralToFloatingPointConversion" }
override string getSemanticConversionString() {
result = "integral to floating point conversion"
@@ -228,7 +228,7 @@ class PointerConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerConversion" }
override string getCanonicalQLClass() { result = "PointerConversion" }
override string getSemanticConversionString() {
result = "pointer conversion"
@@ -259,7 +259,7 @@ class PointerToMemberConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerToMemberConversion" }
override string getCanonicalQLClass() { result = "PointerToMemberConversion" }
override string getSemanticConversionString() {
result = "pointer-to-member conversion"
@@ -277,7 +277,7 @@ class PointerToIntegralConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerToIntegralConversion" }
override string getCanonicalQLClass() { result = "PointerToIntegralConversion" }
override string getSemanticConversionString() {
result = "pointer to integral conversion"
@@ -295,7 +295,7 @@ class IntegralToPointerConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "IntegralToPointerConversion" }
override string getCanonicalQLClass() { result = "IntegralToPointerConversion" }
override string getSemanticConversionString() {
result = "integral to pointer conversion"
@@ -312,7 +312,7 @@ class BoolConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BoolConversion" }
override string getCanonicalQLClass() { result = "BoolConversion" }
override string getSemanticConversionString() {
result = "conversion to bool"
@@ -329,7 +329,7 @@ class VoidConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "VoidConversion" }
override string getCanonicalQLClass() { result = "VoidConversion" }
override string getSemanticConversionString() {
result = "conversion to void"
@@ -401,7 +401,7 @@ class BaseClassConversion extends InheritanceConversion {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BaseClassConversion" }
override string getCanonicalQLClass() { result = "BaseClassConversion" }
override string getSemanticConversionString() {
result = "base class conversion"
@@ -433,7 +433,7 @@ class DerivedClassConversion extends InheritanceConversion {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DerivedClassConversion" }
override string getCanonicalQLClass() { result = "DerivedClassConversion" }
override string getSemanticConversionString() {
result = "derived class conversion"
@@ -458,7 +458,7 @@ class PointerToMemberBaseClassConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerToMemberBaseClassConversion" }
override string getCanonicalQLClass() { result = "PointerToMemberBaseClassConversion" }
override string getSemanticConversionString() {
result = "pointer-to-member base class conversion"
@@ -475,7 +475,7 @@ class PointerToMemberDerivedClassConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerToMemberDerivedClassConversion" }
override string getCanonicalQLClass() { result = "PointerToMemberDerivedClassConversion" }
override string getSemanticConversionString() {
result = "pointer-to-member derived class conversion"
@@ -493,7 +493,7 @@ class GlvalueConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "GlvalueConversion" }
override string getCanonicalQLClass() { result = "GlvalueConversion" }
override string getSemanticConversionString() {
result = "glvalue conversion"
@@ -520,7 +520,7 @@ class PrvalueAdjustmentConversion extends Cast {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PrvalueAdjustmentConversion" }
override string getCanonicalQLClass() { result = "PrvalueAdjustmentConversion" }
override string getSemanticConversionString() {
result = "prvalue adjustment conversion"
@@ -536,7 +536,7 @@ class DynamicCast extends Cast, @dynamic_cast {
override int getPrecedence() { result = 16 }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DynamicCast" }
override string getCanonicalQLClass() { result = "DynamicCast" }
override string getSemanticConversionString() {
result = "dynamic_cast"
@@ -590,7 +590,7 @@ class TypeidOperator extends Expr, @type_id {
deprecated Type getSpecifiedType() { result = this.getResultType() }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "TypeidOperator" }
override string getCanonicalQLClass() { result = "TypeidOperator" }
/**
* Gets the contained expression, if any (if this typeid contains
@@ -620,7 +620,7 @@ class SizeofPackOperator extends Expr, @sizeof_pack {
override string toString() { result = "sizeof...(...)" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SizeofPackOperator" }
override string getCanonicalQLClass() { result = "SizeofPackOperator" }
override predicate mayBeImpure() {
none()
@@ -644,7 +644,7 @@ class SizeofExprOperator extends SizeofOperator {
SizeofExprOperator() { exists(Expr e | this.getChild(0) = e) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SizeofExprOperator" }
override string getCanonicalQLClass() { result = "SizeofExprOperator" }
/** Gets the contained expression. */
Expr getExprOperand() { result = this.getChild(0) }
@@ -673,7 +673,7 @@ class SizeofTypeOperator extends SizeofOperator {
SizeofTypeOperator() { sizeof_bind(underlyingElement(this),_) }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SizeofTypeOperator" }
override string getCanonicalQLClass() { result = "SizeofTypeOperator" }
/** Gets the contained type. */
Type getTypeOperand() { sizeof_bind(underlyingElement(this),unresolveElement(result)) }
@@ -746,7 +746,7 @@ class ArrayToPointerConversion extends Conversion, @array_to_pointer {
override string toString() { result = "array to pointer conversion" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ArrayToPointerConversion" }
override string getCanonicalQLClass() { result = "ArrayToPointerConversion" }
override predicate mayBeImpure() {
none()

View File

@@ -18,7 +18,7 @@ abstract class EqualityOperation extends ComparisonOperation {
*/
class EQExpr extends EqualityOperation, @eqexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "EQExpr" }
override string getCanonicalQLClass() { result = "EQExpr" }
override string getOperator() { result = "==" }
}
@@ -28,7 +28,7 @@ class EQExpr extends EqualityOperation, @eqexpr {
*/
class NEExpr extends EqualityOperation, @neexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NEExpr" }
override string getCanonicalQLClass() { result = "NEExpr" }
override string getOperator() { result = "!=" }
}
@@ -77,7 +77,7 @@ abstract class RelationalOperation extends ComparisonOperation {
*/
class GTExpr extends RelationalOperation, @gtexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "GTExpr" }
override string getCanonicalQLClass() { result = "GTExpr" }
override string getOperator() { result = ">" }
@@ -90,7 +90,7 @@ class GTExpr extends RelationalOperation, @gtexpr {
*/
class LTExpr extends RelationalOperation, @ltexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LTExpr" }
override string getCanonicalQLClass() { result = "LTExpr" }
override string getOperator() { result = "<" }
@@ -103,7 +103,7 @@ class LTExpr extends RelationalOperation, @ltexpr {
*/
class GEExpr extends RelationalOperation, @geexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "GEExpr" }
override string getCanonicalQLClass() { result = "GEExpr" }
override string getOperator() { result = ">=" }
@@ -116,7 +116,7 @@ class GEExpr extends RelationalOperation, @geexpr {
*/
class LEExpr extends RelationalOperation, @leexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LEExpr" }
override string getCanonicalQLClass() { result = "LEExpr" }
override string getOperator() { result = "<=" }

View File

@@ -467,7 +467,7 @@ class ParenthesizedBracedInitializerList extends Expr, @braced_init_list {
override string toString() { result = "({...})" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ParenthesizedBracedInitializerList" }
override string getCanonicalQLClass() { result = "ParenthesizedBracedInitializerList" }
}
/**
@@ -477,7 +477,7 @@ class ParenthesisExpr extends Conversion, @parexpr {
override string toString() { result = "(...)" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ParenthesisExpr" }
override string getCanonicalQLClass() { result = "ParenthesisExpr" }
}
/**
@@ -487,7 +487,7 @@ class ErrorExpr extends Expr, @errorexpr {
override string toString() { result = "<error expr>" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ErrorExpr" }
override string getCanonicalQLClass() { result = "ErrorExpr" }
}
/**
@@ -502,7 +502,7 @@ class AssumeExpr extends Expr, @assume {
*/
class CommaExpr extends Expr, @commaexpr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CommaExpr" }
override string getCanonicalQLClass() { result = "CommaExpr" }
/**
* Gets the left operand, which is the one whose value is discarded.
@@ -534,7 +534,7 @@ class CommaExpr extends Expr, @commaexpr {
*/
class AddressOfExpr extends UnaryOperation, @address_of {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AddressOfExpr" }
override string getCanonicalQLClass() { result = "AddressOfExpr" }
/** Gets the function or variable whose address is taken. */
Declaration getAddressable() {
@@ -566,7 +566,7 @@ class ReferenceToExpr extends Conversion, @reference_to {
override string toString() { result = "(reference to)" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ReferenceToExpr" }
override string getCanonicalQLClass() { result = "ReferenceToExpr" }
override int getPrecedence() { result = 15 }
}
@@ -578,7 +578,7 @@ class ReferenceToExpr extends Conversion, @reference_to {
*/
class PointerDereferenceExpr extends UnaryOperation, @indirect {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "PointerDereferenceExpr" }
override string getCanonicalQLClass() { result = "PointerDereferenceExpr" }
/**
* DEPRECATED: Use getOperand() instead.
@@ -614,7 +614,7 @@ class ReferenceDereferenceExpr extends Conversion, @ref_indirect {
override string toString() { result = "(reference dereference)" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ReferenceDereferenceExpr" }
override string getCanonicalQLClass() { result = "ReferenceDereferenceExpr" }
}
/**
@@ -719,7 +719,7 @@ class NewExpr extends NewOrNewArrayExpr, @new_expr {
override string toString() { result = "new" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NewExpr" }
override string getCanonicalQLClass() { result = "NewExpr" }
/**
* Gets the type that is being allocated.
@@ -746,7 +746,7 @@ class NewArrayExpr extends NewOrNewArrayExpr, @new_array_expr {
override string toString() { result = "new[]" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NewArrayExpr" }
override string getCanonicalQLClass() { result = "NewArrayExpr" }
/**
* Gets the type that is being allocated.
@@ -792,7 +792,7 @@ class DeleteExpr extends Expr, @delete_expr {
override string toString() { result = "delete" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DeleteExpr" }
override string getCanonicalQLClass() { result = "DeleteExpr" }
override int getPrecedence() { result = 15 }
@@ -863,7 +863,7 @@ class DeleteArrayExpr extends Expr, @delete_array_expr {
override string toString() { result = "delete[]" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DeleteArrayExpr" }
override string getCanonicalQLClass() { result = "DeleteArrayExpr" }
override int getPrecedence() { result = 15 }
@@ -939,7 +939,7 @@ class StmtExpr extends Expr, @expr_stmt {
Stmt getStmt() { result.getParent() = this }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "StmtExpr" }
override string getCanonicalQLClass() { result = "StmtExpr" }
/**
* Gets the result expression of the enclosed statement. For example,
@@ -967,7 +967,7 @@ class ThisExpr extends Expr, @thisaccess {
override string toString() { result = "this" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ThisExpr" }
override string getCanonicalQLClass() { result = "ThisExpr" }
override predicate mayBeImpure() {
none()
@@ -1005,7 +1005,7 @@ class NoExceptExpr extends Expr, @noexceptexpr {
override string toString() { result = "noexcept(...)" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NoExceptExpr" }
override string getCanonicalQLClass() { result = "NoExceptExpr" }
/**
* Gets the expression inside this noexcept expression.

View File

@@ -12,7 +12,7 @@ class LambdaExpression extends Expr, @lambdaexpr {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LambdaExpression" }
override string getCanonicalQLClass() { result = "LambdaExpression" }
/**
* Gets an implicitly or explicitly captured value of this lambda expression.
@@ -79,7 +79,7 @@ class Closure extends Class {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Closure" }
override string getCanonicalQLClass() { result = "Closure" }
/** Gets the lambda expression of which this is the type. */
LambdaExpression getLambdaExpression() {
@@ -106,7 +106,7 @@ class LambdaCapture extends @lambdacapture {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LambdaCapture" }
override string getCanonicalQLClass() { result = "LambdaCapture" }
/**
* Holds if this capture was made implicitly.

View File

@@ -14,7 +14,7 @@ class Literal extends Expr, @literal {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Literal" }
override string getCanonicalQLClass() { result = "Literal" }
override predicate mayBeImpure() {
none()
@@ -103,7 +103,7 @@ class CharLiteral extends TextLiteral {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CharLiteral" }
override string getCanonicalQLClass() { result = "CharLiteral" }
/**
* Gets the character of this literal. For example `L'a'` has character `"a"`.
@@ -124,7 +124,7 @@ class StringLiteral extends TextLiteral
// @aggregateliteral rather than @literal.
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "StringLiteral" }
override string getCanonicalQLClass() { result = "StringLiteral" }
}
@@ -137,7 +137,7 @@ class OctalLiteral extends Literal {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "OctalLiteral" }
override string getCanonicalQLClass() { result = "OctalLiteral" }
}
/**
@@ -149,7 +149,7 @@ class HexLiteral extends Literal {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "HexLiteral" }
override string getCanonicalQLClass() { result = "HexLiteral" }
}
/**
@@ -183,7 +183,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ClassAggregateLiteral" }
override string getCanonicalQLClass() { result = "ClassAggregateLiteral" }
/**
* Gets the expression within the aggregate literal that is used to initialize
@@ -245,7 +245,7 @@ class ArrayAggregateLiteral extends AggregateLiteral {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ArrayAggregateLiteral" }
override string getCanonicalQLClass() { result = "ArrayAggregateLiteral" }
/**
* Gets the expression within the aggregate literal that is used to initialize

View File

@@ -13,7 +13,7 @@ class NotExpr extends UnaryLogicalOperation, @notexpr {
override string getOperator() { result = "!" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "NotExpr" }
override string getCanonicalQLClass() { result = "NotExpr" }
override int getPrecedence() { result = 15 }
}
@@ -42,7 +42,7 @@ class LogicalAndExpr extends BinaryLogicalOperation, @andlogicalexpr {
override string getOperator() { result = "&&" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LogicalAndExpr" }
override string getCanonicalQLClass() { result = "LogicalAndExpr" }
override int getPrecedence() { result = 5 }
@@ -60,7 +60,7 @@ class LogicalOrExpr extends BinaryLogicalOperation, @orlogicalexpr {
override string getOperator() { result = "||" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LogicalOrExpr" }
override string getCanonicalQLClass() { result = "LogicalOrExpr" }
override int getPrecedence() { result = 4 }
@@ -81,7 +81,7 @@ class ConditionalExpr extends Operation, @conditionalexpr {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ConditionalExpr" }
override string getCanonicalQLClass() { result = "ConditionalExpr" }
/** Gets the 'then' expression of this conditional expression. */
Expr getThen() {

View File

@@ -46,6 +46,9 @@ abstract class FormattingFunction extends Function {
/** Gets the position at which the format parameter occurs. */
abstract int getFormatParameterIndex();
/** Canonical QL class corresponding to this element. */
override string getCanonicalQLClass() { result = "FormattingFunction" }
/**
* Holds if this `FormattingFunction` is in a context that supports
* Microsoft rules and extensions.

View File

@@ -12,7 +12,7 @@ import semmle.code.cpp.stmts.Stmt
class Block extends Stmt, @stmt_block {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Block" }
override string getCanonicalQLClass() { result = "Block" }
/**
* Gets a child declaration of this block.

View File

@@ -168,7 +168,7 @@ abstract class StmtParent extends ControlFlowNode {
class ExprStmt extends Stmt, @stmt_expr {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ExprStmt" }
override string getCanonicalQLClass() { result = "ExprStmt" }
/**
* Gets the expression of this 'expression' statement.
@@ -223,7 +223,7 @@ abstract class ConditionalStmt extends ControlStructure {
class IfStmt extends ConditionalStmt, @stmt_if {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "IfStmt" }
override string getCanonicalQLClass() { result = "IfStmt" }
/**
* Gets the condition expression of this 'if' statement.
@@ -319,7 +319,7 @@ abstract class Loop extends ControlStructure {
*/
class WhileStmt extends Loop, @stmt_while {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "WhileStmt" }
override string getCanonicalQLClass() { result = "WhileStmt" }
override Expr getCondition() { result = this.getChild(0) }
override Expr getControllingExpr() { result = this.getCondition() }
@@ -388,7 +388,7 @@ class WhileStmt extends Loop, @stmt_while {
abstract class JumpStmt extends Stmt, @jump {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "JumpStmt" }
override string getCanonicalQLClass() { result = "JumpStmt" }
/** Gets the target of this jump statement. */
Stmt getTarget() { jumpinfo(underlyingElement(this),_,unresolveElement(result)) }
@@ -405,7 +405,7 @@ abstract class JumpStmt extends Stmt, @jump {
class GotoStmt extends JumpStmt, @stmt_goto {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "GotoStmt" }
override string getCanonicalQLClass() { result = "GotoStmt" }
/**
* Gets the name of the label this 'goto' statement refers to.
@@ -499,7 +499,7 @@ class ComputedGotoStmt extends Stmt, @stmt_assigned_goto {
class ContinueStmt extends JumpStmt, @stmt_continue {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ContinueStmt" }
override string getCanonicalQLClass() { result = "ContinueStmt" }
override string toString() { result = "continue;" }
@@ -531,7 +531,7 @@ private Stmt getEnclosingContinuable(Stmt s) {
class BreakStmt extends JumpStmt, @stmt_break {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "BreakStmt" }
override string getCanonicalQLClass() { result = "BreakStmt" }
override string toString() { result = "break;" }
@@ -563,7 +563,7 @@ private Stmt getEnclosingBreakable(Stmt s) {
class LabelStmt extends Stmt, @stmt_label {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "LabelStmt" }
override string getCanonicalQLClass() { result = "LabelStmt" }
/** Gets the name of this 'label' statement. */
string getName() { jumpinfo(underlyingElement(this),result,_) and result != "" }
@@ -592,7 +592,7 @@ class LabelStmt extends Stmt, @stmt_label {
class ReturnStmt extends Stmt, @stmt_return {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ReturnStmt" }
override string getCanonicalQLClass() { result = "ReturnStmt" }
/**
* Gets the expression of this 'return' statement.
@@ -645,7 +645,7 @@ class ReturnStmt extends Stmt, @stmt_return {
class DoStmt extends Loop, @stmt_end_test_while {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DoStmt" }
override string getCanonicalQLClass() { result = "DoStmt" }
override Expr getCondition() { result = this.getChild(0) }
override Expr getControllingExpr() { result = this.getCondition() }
@@ -692,7 +692,7 @@ class DoStmt extends Loop, @stmt_end_test_while {
*/
class RangeBasedForStmt extends Loop, @stmt_range_based_for {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "RangeBasedForStmt" }
override string getCanonicalQLClass() { result = "RangeBasedForStmt" }
/**
* Gets the 'body' statement of this range-based 'for' statement.
@@ -788,7 +788,7 @@ class RangeBasedForStmt extends Loop, @stmt_range_based_for {
class ForStmt extends Loop, @stmt_for {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "ForStmt" }
override string getCanonicalQLClass() { result = "ForStmt" }
/**
* Gets the initialization statement of this 'for' statement.
@@ -1017,7 +1017,7 @@ private predicate inForUpdate(Expr forUpdate, Expr child) {
class SwitchCase extends Stmt, @stmt_switch_case {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SwitchCase" }
override string getCanonicalQLClass() { result = "SwitchCase" }
/**
* Gets the expression of this 'switch case' statement (or the start of
@@ -1380,7 +1380,7 @@ class DefaultCase extends SwitchCase {
*/
class SwitchStmt extends ConditionalStmt, @stmt_switch {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "SwitchStmt" }
override string getCanonicalQLClass() { result = "SwitchStmt" }
/**
* Gets the expression that this 'switch' statement switches on.
@@ -1593,7 +1593,7 @@ class Handler extends Stmt, @stmt_handler {
override string toString() { result = "<handler>" }
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "Handler" }
override string getCanonicalQLClass() { result = "Handler" }
/**
* Gets the block containing the implementation of this handler.
@@ -1650,7 +1650,7 @@ deprecated class FinallyEnd extends Stmt {
class TryStmt extends Stmt, @stmt_try_block {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "TryStmt" }
override string getCanonicalQLClass() { result = "TryStmt" }
override string toString() { result = "try { ... }" }
@@ -1730,7 +1730,7 @@ class FunctionTryStmt extends TryStmt {
not exists(this.getEnclosingBlock())
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "FunctionTryStmt" }
override string getCanonicalQLClass() { result = "FunctionTryStmt" }
}
/**
@@ -1738,7 +1738,7 @@ class FunctionTryStmt extends TryStmt {
*/
class CatchBlock extends Block {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CatchBlock" }
override string getCanonicalQLClass() { result = "CatchBlock" }
CatchBlock() { ishandler(underlyingElement(this)) }
@@ -1764,7 +1764,7 @@ class CatchAnyBlock extends CatchBlock {
not exists(this.getParameter())
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "CatchAnyBlock" }
override string getCanonicalQLClass() { result = "CatchAnyBlock" }
}
/**
@@ -1823,7 +1823,7 @@ class MicrosoftTryFinallyStmt extends MicrosoftTryStmt {
class DeclStmt extends Stmt, @stmt_decl {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "DeclStmt" }
override string getCanonicalQLClass() { result = "DeclStmt" }
/**
* Gets the `i`th declaration entry declared by this 'declaration' statement.
@@ -1905,7 +1905,7 @@ class DeclStmt extends Stmt, @stmt_decl {
class EmptyStmt extends Stmt, @stmt_empty {
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "EmptyStmt" }
override string getCanonicalQLClass() { result = "EmptyStmt" }
override string toString() { result = ";" }
@@ -1927,7 +1927,7 @@ class AsmStmt extends Stmt, @stmt_asm {
}
/** Canonical QL class corresponding to this element. */
string getCanonicalQLClass() { result = "AsmStmt" }
override string getCanonicalQLClass() { result = "AsmStmt" }
}
/**