Class CppType

The C++ type of an IR entity. This cannot just be Type for a couple reasons:

  • Some types needed by the IR might not exist in the database (e.g. RoutineTypes for functions that are always called directly)
  • Some types needed by the IR are not representable in the C++ type system (e.g. the result type of a VariableAddress where the variable is of reference type)

Import path

import semmle.code.cpp.ir.internal.CppType

Direct supertypes

Known direct subtypes

    Predicates

    getByteSize

    Gets the size of the type in bytes, if known.

    getDumpString

    Gets a string used in IR dumps

    getIRType

    Gets the IRType that represents this CppType. Many different CppTypes can map to a single IRType.

    hasType

    Holds if the CppType represents a prvalue of type Type (if isGLValue is false), or if it represents a glvalue of type Type (if isGLValue is true).

    hasUnspecifiedType

    Holds if this type represents the C++ type type. If isGLValue is true, then this type represents a glvalue of type type. Otherwise, it represents a prvalue of type type.

    toString

    Gets a textual representation of this type.