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

Module IRGuards

Provides classes and predicates for reasoning about guards and the control flow elements controlled by those guards.

Import path

import semmle.code.cpp.controlflow.IRGuards

Imports

IR

Provides classes that describe the Intermediate Representation (IR) of the program.

cpp

Provides classes and predicates for working with C/C++ code.

Predicates

comparesEq

Holds if left = right + k evaluates to isLt given that some guard evaluates to value.

comparesLt

Holds if left < right + k evaluates to isLt given that some guard evaluates to value.

Classes

AbstractValue

An abstract value. This is either a boolean value, or a switch case.

BooleanValue

A Boolean value.

GuardCondition

A Boolean condition in the AST that guards one or more basic blocks. This includes operands of logical operators but not switch statements.

IRGuardCondition

A Boolean condition in the IR that guards one or more basic blocks.

MatchValue

A value that represents a match against a specific switch case.