CodeQL library for C/C++
codeql/cpp-all 0.13.0 (changelog, source)
Search

Class SwitchEvaluator

A helper class for evaluation of switch expressions.

Import path

import semmle.code.cpp.controlflow.internal.ConstantExprs

Direct supertypes

Indirect supertypes

Predicates

interesting

e is an expression for which we want to calculate a value.

Inherited predicates

abs

Returns the absolute value of the receiver (or INT_MIN when the receiver is INT_MIN)

from int
acos

Returns the inverse cosine of the receiver

from int
allowVariableWithoutInitializer

When evaluating a syntactic subexpression of e, we may consider variable v even though it lacks an initializer. Normally, this is not sound, as uninitialized variables can contain arbitrary data (in fact, a query UninitialisedLocal.ql exists for finding that).

from ExprEvaluator
asin

Returns the inverse sine of the receiver

from int
atan

Returns the inverse tangent of the receiver

from int
bitAnd

Returns the bitwise and of the receiver and the argument

from int
bitNot

Returns the bitwise complement of the receiver

from int
bitOr

Returns the bitwise or of the receiver and the argument

from int
bitShiftLeft

Returns the bitwise left shift of the receiver by the argument

from int
bitShiftRight

Returns the unsigned bitwise right shift of the receiver by the argument

from int
bitShiftRightSigned

Returns the signed bitwise right shift of the receiver by the argument

from int
bitXor

Returns the bitwise xor of the receiver and the argument

from int
ceil

Returns the smallest integer greater than or equal to the receiver

from float
copySign

Returns the floating point number with the magnitude of the receiver and the sign of the argument.

from float
cos

Returns the cosine of the receiver

from int
cosh

Returns the hyperbolic cosine of the receiver

from int
exp

Returns e (the base of the natural logarithm) raised to the power of the receiver

from int
floor

Returns the largest integer that is not greater than the receiver

from float
gcd

Returns the greatest common divisor of the receiver and the argument, or zero if both receiver and argument are zero, or INT_MIN if the greatest common divisor is INT_MAX+1

from int
getValue

Gets the value of (interesting) expression e, if any.

from ExprEvaluator
ignoreNonAnalyzableVariableDefinition

When evaluating a syntactic subexpression of e, we may ignore the non-analyzable variable definition def for variable v.

from ExprEvaluator
ignoreVariableAssignment

When evaluating a syntactic subexpression of e, we may ignore the expression value assigned to variable v.

from ExprEvaluator
interestingInternal

req is an expression for which a value is required to be evaluated in order to calculate a value for interesting expression e. sub indicates whether req is a syntactic subexpression of e.

from ExprEvaluator
log

Returns the natural logarithm of the receiver

from int
log

Returns the logarithm of the receiver in the given base

from int
log

Returns the logarithm of the receiver in the given base

from int
log10

Returns the base-10 logarithm of the receiver

from int
log2

Returns the base-2 logarithm of the receiver

from int
maximum

Returns the larger of the receiver and the argument

from int
maximum

Returns the larger of the receiver and the argument

from int
minimum

Returns the smaller of the receiver and the argument

from int
minimum

Returns the smaller of the receiver and the argument

from int
nextAfter

Returns the number adjacent to the receiver in the direction of the argument.

from float
nextDown

Returns the number adjacent to the receiver in the direction of negative infinity.

from float
nextUp

Returns the number adjacent to the receiver in the direction of positive infinity.

from float
pow

Returns the receiver raised to the given power

from int
pow

Returns the receiver raised to the given power

from int
signum

Returns the sign of the receiver: zero if it is zero, 1.0 if it is greater than zero, -1.0 if it is less than zero.

from float
sin

Returns the sine of the receiver

from int
sinh

Returns the hyperbolic sine of the receiver

from int
sqrt

Returns the square root of the receiver

from int
tan

Returns the tangent of the receiver

from int
tanh

Returns the hyperbolic tangent of the receiver

from int
toString

Returns a string representation of the receiver (in decimal)

from int
toUnicode

Returns the unicode character for the receiver seen as a unicode code point

from int
ulp

Returns the ULP (unit in last place) of the receiver.

from float

Charpred