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

Class Make::PreGuard

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

Predicates

directlyControls

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

directlyValueControls

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

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.

hasBranchEdge

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

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.

isEquality

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

Inherited predicates

getLocation

Gets the location of this AST node.

from AstNode
toString

Gets a textual representation of this AST node.

from AstNode