Module TranslatedExpr

Import path

import semmle.code.cpp.ir.implementation.raw.internal.TranslatedExpr

Imports

Predicates

exprNeedsCopyIfNotLoaded

Holds if the translation of expr will not directly generate any Instruction for use as result. For such instructions we can synthesize a CopyValue instruction to ensure that there is a 1-to-1 mapping between expressions and result-bearing instructions.

getTranslatedAllocationSize
getTranslatedAllocatorCall
getTranslatedExpr

Gets the TranslatedExpr for the specified expression. If expr is a load, the result is the TranslatedExpr for the load portion.

Classes

StructorCallContext

Abstract class implemented by any TranslatedElement that has a child expression that is a call to a constructor or destructor, in order to provide a pointer to the object being constructed or destroyed.

TranslatedAllocationSize

The IR translation of the allocation size argument passed to operator new in a new expression.

TranslatedAllocatorCall

The IR translation of a call to operator new as part of a new or new[] expression.

TranslatedArithmeticLiteral
TranslatedArrayExpr

IR translation of an array access expression (e.g. a[i]). The array being accessed will either be a prvalue of pointer type (possibly due to an implicit array-to-pointer conversion), or a glvalue of a GNU vector type.

TranslatedAssignExpr
TranslatedAssignOperation
TranslatedAssumeExpr

The IR translation of an __assume expression. We currently translate these as NoOp. In the future, we will probably want to do something better. At a minimum, we can model __assume(0) as Unreached.

TranslatedBinaryOperation

IR translation of a simple binary operation.

TranslatedBoolConversion

Represents the translation of a BoolConversion expression, which generates a comparison with zero.

TranslatedBuiltInOperation

The IR translation of a built-in operation (i.e. anything that extends BuiltInOperation).

TranslatedCommaExpr
TranslatedConditionDeclExpr

The IR translation of a ConditionDeclExpr, which represents the value of the declared variable after conversion to bool in code such as: if (int* p = &x) { }

TranslatedConditionValue
TranslatedConditionalExpr
TranslatedConstantAllocationSize

The IR translation of a constant allocation size.

TranslatedConstantExpr

IR translation of an expression with a compile-time constant value. This includes not only literals, but also “integral constant expressions” (e.g. 1 + 2).

TranslatedConversion
TranslatedCoreExpr

The IR translation of the “core” part of an expression. This is the part of the expression that produces the result value of the expression, before any lvalue-to-rvalue conversion on the result. Every expression has a single TranslatedCoreExpr.

TranslatedCrementOperation
TranslatedDeleteArrayExprPlaceHolder

A placeholder for the translation of a delete[] expression.

TranslatedDeleteExprPlaceHolder

A placeholder for the translation of a delete expression.

TranslatedDestructorFieldDestruction

Represents the IR translation of the destruction of a field from within the destructor of the field’s declaring class.

TranslatedDynamicCast

Represents the translation of a dynamic_cast expression.

TranslatedErrorExpr
TranslatedExpr

The IR translation of some part of an expression. A single Expr may consist of multiple TranslatedExpr objects. Every Expr has a single TranslatedCoreExpr, which produces the result of the expression before any implicit lvalue-to-rvalue conversion. Any expression with an lvalue-to-rvalue conversion will also have a TranslatedLoad to perform that conversion on the original result. A few expressions have additional TranslatedExpr objects that compute intermediate values, such as the TranslatedAllocatorCall and TranslatedAllocationSize within the translation of a NewExpr.

TranslatedFieldAccess
TranslatedFunctionAccess
TranslatedInheritanceConversion

Represents the translation of a BaseClassConversion or DerivedClassConversion expression.

TranslatedLambdaExpr

The IR translation of a lambda expression. This initializes a temporary variable whose type is that of the lambda, using the initializer list that represents the captures of the lambda.

TranslatedLoad

IR translation of an implicit lvalue-to-rvalue conversion on the result of an expression.

TranslatedNewArrayExpr

The IR translation of a new[] expression.

TranslatedNewExpr

The IR translation of a new expression.

TranslatedNewOrNewArrayExpr

The IR translation of a new or new[] expression.

TranslatedNonConstantAllocationSize

The IR translation of a non-constant allocation size.

TranslatedNonConstantExpr

IR translation of an expression whose value is not known at compile time.

TranslatedNonFieldVariableAccess
TranslatedPostfixCrementOperation
TranslatedPrefixCrementOperation
TranslatedReThrowExpr

IR translation of a throw expression with no argument (e.g. throw;).

TranslatedResultCopy

IR translation of an implicit lvalue-to-rvalue conversion on the result of an expression.

TranslatedSimpleConversion

Represents the translation of a conversion expression that generates a Convert instruction.

TranslatedSingleInstructionConversion

Represents the translation of a conversion expression that generates a single instruction.

TranslatedSingleInstructionExpr

IR translation of an expression that performs a single operation on its operands and returns the result.

TranslatedStmtExpr

The IR translation of StmtExpr (the GNU statement expression extension to C/C++), such as ({ doSomething(); a + b; })

TranslatedStringLiteral
TranslatedThisExpr
TranslatedThrowExpr

IR translation of a throw expression.

TranslatedThrowValueExpr

IR translation of a throw expression with an argument (e.g. throw std::bad_alloc()).

TranslatedTransparentConversion
TranslatedTransparentExpr
TranslatedTransparentUnaryOperation
TranslatedUnaryExpr
TranslatedVarArg

The IR translation of a BuiltInVarArg expression.

TranslatedVarArgCopy

The IR translation of a BuiltInVarArgCopy expression.

TranslatedVarArgsEnd

The IR translation of a BuiltInVarArgsEnd expression.

TranslatedVarArgsStart

The IR translation of a BuiltInVarArgsStart expression.

TranslatedVariableAccess