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

Class Make::Logic::Guard

A guard. This may be any expression whose value determines subsequent control flow. It may also be a switch case, which as a guard is considered to evaluate to either true or false depending on whether the case matches.

Import path

import codeql.controlflow.Guards

Direct supertypes

Indirect supertypes

Predicates

controls

Holds if this guard evaluating to branch controls the basic block bb. That is, execution of bb implies that this guard evaluated to branch.

controlsBranchEdge

Holds if this guard evaluating to branch controls the control-flow branch edge from bb1 to bb2. That is, following the edge from bb1 to bb2 implies that this guard evaluated to branch.

valueControls

Holds if this guard evaluating to v controls the basic block bb. That is, execution of bb implies that this guard evaluated to v.

valueControlsBranchEdge

Holds if this guard evaluating to v controls the control-flow branch edge from bb1 to bb2. That is, following the edge from bb1 to bb2 implies that this guard evaluated to v.

Inherited predicates

directlyControls

Holds if this guard evaluating to branch directly controls the basic block bb.

from PreGuard
directlyValueControls

Holds if this guard evaluating to v directly controls the basic block bb.

from PreGuard
getBasicBlock

Gets the basic block of this guard. For expressions, this is the basic block of the expression itself, and for switch cases, this is the basic block of the expression being compared against the cases.

from PreGuard
getLocation

Gets the location of this AST node.

from AstNode
hasBranchEdge

Holds if this guard is the last node in bb1 and that its successor is bb2 exactly when evaluating to branch.

from PreGuard
hasValueBranchEdge

Holds if this guard evaluating to v corresponds to taking the edge from bb1 to bb2. For ordinary conditional branching this guard is the last node in bb1, but for switch case matching it is the switch expression, which may either be in bb1 or an earlier basic block.

from PreGuard
isEquality

Holds if this guard tests equality between e1 and e2 upon evaluating to eqval.

from PreGuard
toString

Gets a textual representation of this AST node.

from AstNode