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

Module IRCppLanguage

Import path

import semmle.code.cpp.ir.internal.IRCppLanguage

Imports

Predicates

Aliases

AST

A C/C++ element that has a location in a file

AutomaticVariable

A C/C++ variable with automatic storage duration. In other words, a function parameter or a local variable that is not static or thread-local. For example, the variables a and b in the following code. void myFunction(int a) { int b; static int c; }

BuiltInOperation

A C/C++ built-in operation. This is the root QL class encompassing built-in functionality.

Class

A class type [N4140 9].

ClassDerivation

A class derivation, for example the public B in the following code: class D : public B { ... };

ComplexDomain

The type domain of a floating-point type that represents a complex number.

Declaration

A C/C++ declaration: for example, a variable declaration, a type declaration, or a function declaration.

Expr

A C/C++ expression.

Field

A C structure member or C++ non-static member variable. For example the member variable m in the following code (but not s): class MyClass { public: int m; static int s; };

File

A file that was observed on disk during the build process.

FloatingPointType

The C/C++ floating point types. See 4.5. This includes float, double and long double, the fixed-size floating-point types like _Float32, the extended-precision floating-point types like _Float64x, and the decimal floating-point types like _Decimal32. It also includes the complex and imaginary versions of all of these types.

Function

A C/C++ function [N4140 8.3.5]. Both member functions and non-member functions are included. For example the function MyFunction in: void MyFunction() { DoSomething(); }

GlobalVariable

A C/C++ variable which has global scope or namespace scope. For example the variables a and b in the following code:

ImaginaryDomain

The type domain of a floating-point type that represents an imaginary number.

IntegralType

The C/C++ integral types. See 4.1.1. These are types that are represented as integers of varying sizes. Both enum types and floating-point types are excluded.

LanguageType

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)

Location

A location of a C/C++ artifact.

OpaqueTypeTag

A C/C++ type.

Parameter

A C/C++ function parameter or catch block parameter. For example the function parameter p and the catch block parameter e in the following code: void myFunction(int p) { try { ... } catch (const std::exception &e) { ... } }

RealDomain

The type domain of a floating-point type that represents a real number.

StaticVariable

A variable whose contents always have static storage duration. This can be a global variable, a namespace variable, a static local variable, or a static member variable.

StringLiteral

A string literal. For example: const char *s1 = "abcdef"; const wchar_t *s2 = L"123456";

Type

A C/C++ type.

TypeDomain

The type domain of a floating-point type. One of RealDomain, ComplexDomain, or ImaginaryDomain.

UnknownDefaultLocation

A dummy location which is used when something doesn’t have a location in the source code but needs to have a Location associated with it.

UnknownLocation

A dummy location which is used when something doesn’t have a location in the source code but needs to have a Location associated with it. There may be several distinct kinds of unknown locations. For example: one for expressions, one for statements and one for other program elements.

UnknownType

The unknown type. This type has no corresponding C/C++ syntax.

Variable

A C/C++ variable. For example, in the following code there are four variables, a, b, c and d:

VoidType

The C/C++ void type. See 4.7. void foo();