clang 18.0.0git
Classes | Typedefs | Enumerations | Functions | Variables
clang::dataflow Namespace Reference

Dataflow Directional Tag Classes. More...

Classes

class  Arena
 The Arena owns the objects that model data within an analysis. More...
 
class  ASTMatchSwitchBuilder
 Collects cases of a "match switch": a collection of matchers paired with callbacks, which together define a switch that can be applied to a node whose type derives from BaseT. More...
 
class  AtomicBoolValue
 Models an atomic boolean. More...
 
struct  backward_analysis_tag
 
class  BoolValue
 Models a boolean. More...
 
class  CFGMatchSwitchBuilder
 Collects cases of a "match switch": a collection of matchers paired with callbacks, which together define a switch that can be applied to an AST node contained in a CFG element. More...
 
class  ChromiumCheckModel
 Models the behavior of Chromium's CHECK, DCHECK, etc. More...
 
struct  CNFFormula
 A boolean formula in conjunctive normal form. More...
 
struct  CNFFormulaBuilder
 Applies simplifications while building up a BooleanFormula. More...
 
struct  ContextSensitiveOptions
 
class  ControlFlowContext
 Holds CFG and other derived context that is needed to perform dataflow analysis. More...
 
class  DataflowAnalysis
 Base class template for dataflow analyses built on a single lattice type. More...
 
class  DataflowAnalysisContext
 Owns objects that encompass the state of a program and stores context that is used during dataflow analysis. More...
 
struct  DataflowAnalysisOptions
 
struct  DataflowAnalysisState
 
class  DataflowModel
 Abstract base class for dataflow "models": reusable analysis components that model a particular aspect of program semantics in the Environment. More...
 
class  Environment
 Holds the state of the program (store and heap) at a given program point. More...
 
class  Formula
 
class  FormulaBoolValue
 Models a compound boolean formula. More...
 
struct  forward_analysis_tag
 
class  IntegerValue
 Models an integer. More...
 
class  Logger
 A logger is notified as the analysis progresses. More...
 
class  MapLattice
 A lattice that maps keys to individual lattice elements. More...
 
class  NoopAnalysis
 
class  NoopLattice
 Trivial lattice for dataflow analysis with exactly one element. More...
 
class  PointerValue
 Models a symbolic pointer. Specifically, any value of type T*. More...
 
class  RecordStorageLocation
 A storage location for a record (struct, class, or union). More...
 
class  RecordValue
 Models a value of struct or class type. More...
 
class  ScalarStorageLocation
 A storage location that is not subdivided further for the purposes of abstract interpretation. More...
 
struct  SimplifyConstraintsInfo
 Information on the way a set of constraints was simplified. More...
 
class  Solver
 An interface for a SAT solver that can be used by dataflow analyses. More...
 
class  StmtToEnvMap
 Maps statements to the environments of basic blocks that contain them. More...
 
class  StorageLocation
 Base class for elements of the local variable store and of the heap. More...
 
class  TopBoolValue
 A TopBoolValue represents a boolean that is explicitly unconstrained. More...
 
struct  TransferState
 A common form of state shared between the cases of a transfer function. More...
 
struct  TransferStateForDiagnostics
 A read-only version of TransferState. More...
 
class  TypeErasedDataflowAnalysis
 Type-erased base class for dataflow analyses built on a single lattice type. More...
 
struct  TypeErasedDataflowAnalysisState
 Type-erased model of the program at a given program point. More...
 
struct  TypeErasedLattice
 Type-erased lattice element container. More...
 
class  UncheckedOptionalAccessDiagnoser
 
class  UncheckedOptionalAccessModel
 Dataflow analysis that models whether optionals hold values or not. More...
 
struct  UncheckedOptionalAccessModelOptions
 
class  Value
 Base class for all values computed by abstract interpretation. More...
 
class  WatchedLiteralsSolver
 A SAT solver that is an implementation of Algorithm D from Knuth's The Art of Computer Programming Volume 4: Satisfiability, Fascicle 6. More...
 
class  WatchedLiteralsSolverImpl
 

Typedefs

template<typename State , typename Result = void>
using CFGMatchSwitch = std::function< Result(const CFGElement &, ASTContext &, State &)>
 
using FieldSet = llvm::SmallSetVector< const FieldDecl *, 4 >
 A set of FieldDecl *.
 
template<typename ElementLattice >
using VarMapLattice = MapLattice< const clang::VarDecl *, ElementLattice >
 Convenience alias that captures the common use of map lattices to model in-scope variables.
 
template<typename T >
using MatchSwitchMatcher = ast_matchers::internal::Matcher< T >
 
template<typename T , typename State , typename Result = void>
using MatchSwitchAction = std::function< Result(const T *, const ast_matchers::MatchFinder::MatchResult &, State &)>
 
template<typename BaseT , typename State , typename Result = void>
using ASTMatchSwitch = std::function< Result(const BaseT &, ASTContext &, State &)>
 
using Variable = uint32_t
 Boolean variables are represented as positive integers.
 
using Literal = uint32_t
 Literals are represented as positive integers.
 
using ClauseID = uint32_t
 Clause identifiers are represented as positive integers.
 

Enumerations

enum class  ComparisonResult { Same , Different , Unknown }
 Indicates the result of a tentative comparison. More...
 
enum class  LatticeJoinEffect { Unchanged , Changed }
 Effect indicating whether a lattice join operation resulted in a new value. More...
 
enum class  Atom : unsigned
 Identifies an atomic boolean variable such as "V1". More...
 

Functions

template<typename AnalysisT >
llvm::Expected< std::vector< std::optional< DataflowAnalysisState< typename AnalysisT::Lattice > > > > runDataflowAnalysis (const ControlFlowContext &CFCtx, AnalysisT &Analysis, const Environment &InitEnv, std::function< void(const CFGElement &, const DataflowAnalysisState< typename AnalysisT::Lattice > &)> PostVisitCFG=nullptr)
 Performs dataflow analysis and returns a mapping from basic block IDs to dataflow analysis states that model the respective basic blocks.
 
template<typename AnalysisT >
auto createAnalysis (ASTContext &ASTCtx, Environment &Env) -> decltype(AnalysisT(ASTCtx, Env))
 
template<typename AnalysisT , typename Diagnostic >
llvm::Expected< llvm::SmallVector< Diagnostic > > diagnoseFunction (const FunctionDecl &FuncDecl, ASTContext &ASTCtx, llvm::function_ref< llvm::SmallVector< Diagnostic >(const CFGElement &, ASTContext &, const TransferStateForDiagnostics< typename AnalysisT::Lattice > &)> Diagnoser, std::int64_t MaxSATIterations=1 '000 '000 '000)
 Runs a dataflow analysis over the given function and then runs Diagnoser over the results.
 
const ExprignoreCFGOmittedNodes (const Expr &E)
 Skip past nodes that the CFG does not emit.
 
const StmtignoreCFGOmittedNodes (const Stmt &S)
 
FieldSet getObjectFields (QualType Type)
 Returns the set of all fields in the type.
 
bool containsSameFields (const FieldSet &Fields, const RecordStorageLocation::FieldToLoc &FieldLocs)
 Returns whether Fields and FieldLocs contain the same fields.
 
RecordStorageLocationgetImplicitObjectLocation (const CXXMemberCallExpr &MCE, const Environment &Env)
 Returns the storage location for the implicit object of a CXXMemberCallExpr, or null if none is defined in the environment.
 
RecordStorageLocationgetBaseObjectLocation (const MemberExpr &ME, const Environment &Env)
 Returns the storage location for the base object of a MemberExpr, or null if none is defined in the environment.
 
std::vector< FieldDecl * > getFieldsForInitListExpr (const RecordDecl *RD)
 Returns the fields of RD that are initialized by an InitListExpr, in the order in which they appear in InitListExpr::inits().
 
RecordValuerefreshRecordValue (RecordStorageLocation &Loc, Environment &Env)
 Associates a new RecordValue with Loc and returns the new value.
 
RecordValuerefreshRecordValue (const Expr &Expr, Environment &Env)
 Associates a new RecordValue with Expr and returns the new value.
 
llvm::StringRef debugString (Value::Kind Kind)
 Returns a string representation of a value kind.
 
llvm::StringRef debugString (Solver::Result::Status Status)
 Returns a string representation of the result status of a SAT check.
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, Atom A)
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, const Formula &F)
 
template<typename Key , typename ElementLattice >
std::ostream & operator<< (std::ostream &Os, const clang::dataflow::MapLattice< Key, ElementLattice > &M)
 
template<typename ElementLattice >
std::ostream & operator<< (std::ostream &Os, const clang::dataflow::VarMapLattice< ElementLattice > &M)
 
std::ostream & operator<< (std::ostream &OS, const NoopLattice &)
 
void copyRecord (RecordStorageLocation &Src, RecordStorageLocation &Dst, Environment &Env)
 Copies a record (struct, class, or union) from Src to Dst.
 
bool recordsEqual (const RecordStorageLocation &Loc1, const Environment &Env1, const RecordStorageLocation &Loc2, const Environment &Env2)
 Returns whether the records Loc1 and Loc2 are equal.
 
bool recordsEqual (const RecordStorageLocation &Loc1, const RecordStorageLocation &Loc2, const Environment &Env)
 
void simplifyConstraints (llvm::SetVector< const Formula * > &Constraints, Arena &arena, SimplifyConstraintsInfo *Info=nullptr)
 Simplifies a set of constraints (implicitly connected by "and") in a way that does not change satisfiability of the constraints.
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &, const Solver::Result &)
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &, Solver::Result::Assignment)
 
void transfer (const StmtToEnvMap &StmtToEnv, const Stmt &S, Environment &Env)
 Evaluates S and updates Env accordingly.
 
llvm::Expected< std::vector< std::optional< TypeErasedDataflowAnalysisState > > > runTypeErasedDataflowAnalysis (const ControlFlowContext &CFCtx, TypeErasedDataflowAnalysis &Analysis, const Environment &InitEnv, std::function< void(const CFGElement &, const TypeErasedDataflowAnalysisState &)> PostVisitCFG=nullptr)
 Performs dataflow analysis and returns a mapping from basic block IDs to dataflow analysis states that model the respective basic blocks.
 
bool areEquivalentValues (const Value &Val1, const Value &Val2)
 An equivalence relation for values.
 
raw_ostream & operator<< (raw_ostream &OS, const Value &Val)
 
static std::pair< const Formula *, const Formula * > canonicalFormulaPair (const Formula &LHS, const Formula &RHS)
 
template<class Key , class ComputeFunc >
const Formulacached (llvm::DenseMap< Key, const Formula * > &Cache, Key K, ComputeFunc &&Compute)
 
static llvm::DenseMap< const Stmt *, const CFGBlock * > buildStmtToBasicBlockMap (const CFG &Cfg)
 Returns a map from statements to basic blocks that contain them.
 
static llvm::BitVector findReachableBlocks (const CFG &Cfg)
 
template<typename T >
static llvm::DenseSet< llvm::StringRef > getKeys (const llvm::StringMap< T > &Map)
 
static void printAtomList (const llvm::SmallVector< Atom > &Atoms, llvm::raw_ostream &OS)
 
static std::unique_ptr< LoggermakeLoggerFromCommandLine ()
 
static llvm::DenseMap< const ValueDecl *, StorageLocation * > intersectDeclToLoc (const llvm::DenseMap< const ValueDecl *, StorageLocation * > &DeclToLoc1, const llvm::DenseMap< const ValueDecl *, StorageLocation * > &DeclToLoc2)
 Returns a map consisting of key-value entries that are present in both maps.
 
static bool equateUnknownValues (Value::Kind K)
 
static bool compareDistinctValues (QualType Type, Value &Val1, const Environment &Env1, Value &Val2, const Environment &Env2, Environment::ValueModel &Model)
 
static ValuemergeDistinctValues (QualType Type, Value &Val1, const Environment &Env1, Value &Val2, const Environment &Env2, Environment &MergedEnv, Environment::ValueModel &Model)
 Attempts to merge distinct values Val1 and Val2 in Env1 and Env2, respectively, of the same type Type.
 
static ValuewidenDistinctValues (QualType Type, Value &Prev, const Environment &PrevEnv, Value &Current, Environment &CurrentEnv, Environment::ValueModel &Model)
 
template<typename Key >
bool compareKeyToValueMaps (const llvm::MapVector< Key, Value * > &Map1, const llvm::MapVector< Key, Value * > &Map2, const Environment &Env1, const Environment &Env2, Environment::ValueModel &Model)
 
static llvm::MapVector< const StorageLocation *, Value * > joinLocToVal (const llvm::MapVector< const StorageLocation *, Value * > &LocToVal, const llvm::MapVector< const StorageLocation *, Value * > &LocToVal2, const Environment &Env1, const Environment &Env2, Environment &JoinedEnv, Environment::ValueModel &Model)
 
template<typename Key >
llvm::MapVector< Key, Value * > widenKeyToValueMap (const llvm::MapVector< Key, Value * > &CurMap, const llvm::MapVector< Key, Value * > &PrevMap, Environment &CurEnv, const Environment &PrevEnv, Environment::ValueModel &Model, LatticeJoinEffect &Effect)
 
static void insertIfGlobal (const Decl &D, llvm::DenseSet< const VarDecl * > &Vars)
 Initializes a global storage value.
 
static void insertIfFunction (const Decl &D, llvm::DenseSet< const FunctionDecl * > &Funcs)
 
static MemberExprgetMemberForAccessor (const CXXMemberCallExpr &C)
 
static void getFieldsGlobalsAndFuncs (const Decl &D, FieldSet &Fields, llvm::DenseSet< const VarDecl * > &Vars, llvm::DenseSet< const FunctionDecl * > &Funcs)
 
static void getFieldsGlobalsAndFuncs (const Stmt &S, FieldSet &Fields, llvm::DenseSet< const VarDecl * > &Vars, llvm::DenseSet< const FunctionDecl * > &Funcs)
 Traverses S and inserts into Fields, Vars and Funcs any fields, global variables and functions that are declared in or referenced from sub-statements.
 
static llvm::StringLiteral sigil (Formula::Kind K)
 
bool isCheckLikeMethod (llvm::SmallDenseSet< const CXXMethodDecl * > &CheckDecls, const CXXMethodDecl &D)
 Determines whether D is one of the methods used to implement Chromium's CHECK macros.
 
static bool isTopLevelNamespaceWithName (const NamespaceDecl &NS, llvm::StringRef Name)
 
static bool hasOptionalClassName (const CXXRecordDecl &RD)
 
static QualType valueTypeFromOptionalType (QualType OptionalTy)
 
static const Formulasubstitute (const Formula &F, const llvm::DenseMap< Atom, const Formula * > &Substitutions, Arena &arena)
 
static llvm::DenseSet< AtomprojectToLeaders (const llvm::DenseSet< Atom > &Atoms, llvm::EquivalenceClasses< Atom > &EquivalentAtoms)
 
static llvm::SmallVector< AtomatomsInEquivalenceClass (const llvm::EquivalenceClasses< Atom > &EquivalentAtoms, llvm::EquivalenceClasses< Atom >::iterator LeaderIt)
 
static BoolValueevaluateBooleanEquality (const Expr &LHS, const Expr &RHS, Environment &Env)
 
static BoolValueunpackValue (BoolValue &V, Environment &Env)
 
static ValuemaybeUnpackLValueExpr (const Expr &E, Environment &Env)
 
static void propagateValue (const Expr &From, const Expr &To, Environment &Env)
 
static void propagateStorageLocation (const Expr &From, const Expr &To, Environment &Env)
 
static void propagateValueOrStorageLocation (const Expr &From, const Expr &To, Environment &Env)
 
static int blockIndexInPredecessor (const CFGBlock &Pred, const CFGBlock &Block)
 Returns the index of Block in the successors of Pred.
 
static bool isBackedgeNode (const CFGBlock &B)
 
static TypeErasedDataflowAnalysisState computeBlockInputState (const CFGBlock &Block, AnalysisContext &AC)
 Computes the input state for a given basic block by joining the output states of its predecessors.
 
static void builtinTransferStatement (const CFGStmt &Elt, TypeErasedDataflowAnalysisState &InputState, AnalysisContext &AC)
 Built-in transfer function for CFGStmt.
 
static void builtinTransferInitializer (const CFGInitializer &Elt, TypeErasedDataflowAnalysisState &InputState)
 Built-in transfer function for CFGInitializer.
 
static void builtinTransfer (const CFGElement &Elt, TypeErasedDataflowAnalysisState &State, AnalysisContext &AC)
 
static TypeErasedDataflowAnalysisState transferCFGBlock (const CFGBlock &Block, AnalysisContext &AC, std::function< void(const CFGElement &, const TypeErasedDataflowAnalysisState &)> PostVisitCFG=nullptr)
 Transfers State by evaluating each element in the Block based on the AC.Analysis specified.
 
static bool areEquivalentIndirectionValues (const Value &Val1, const Value &Val2)
 
static constexpr Literal posLit (Variable V)
 Returns the positive literal V.
 
static constexpr bool isPosLit (Literal L)
 
static constexpr bool isNegLit (Literal L)
 
static constexpr Literal negLit (Variable V)
 Returns the negative literal !V.
 
static constexpr Literal notLit (Literal L)
 Returns the negated literal !L.
 
static constexpr Variable var (Literal L)
 Returns the variable of L.
 
CNFFormula buildCNF (const llvm::ArrayRef< const Formula * > &Vals)
 Converts the conjunction of Vals into a formula in conjunctive normal form where each clause has at least one and at most three literals.
 

Variables

static constexpr int MaxCompositeValueDepth = 3
 
static constexpr int MaxCompositeValueSize = 1000
 
static constexpr Variable NullVar = 0
 A null boolean variable is used as a placeholder in various data structures and algorithms.
 
static constexpr Literal NullLit = 0
 A null literal is used as a placeholder in various data structures and algorithms.
 
static constexpr ClauseID NullClause = 0
 A null clause identifier is used as a placeholder in various data structures and algorithms.
 

Detailed Description

Dataflow Directional Tag Classes.

These are used for tag dispatching within the dataflow solver/transfer functions to determine what direction a dataflow analysis flows.

Typedef Documentation

◆ ASTMatchSwitch

template<typename BaseT , typename State , typename Result = void>
using clang::dataflow::ASTMatchSwitch = typedef std::function<Result(const BaseT &, ASTContext &, State &)>

Definition at line 72 of file MatchSwitch.h.

◆ CFGMatchSwitch

template<typename State , typename Result = void>
using clang::dataflow::CFGMatchSwitch = typedef std::function<Result(const CFGElement &, ASTContext &, State &)>

Definition at line 33 of file CFGMatchSwitch.h.

◆ ClauseID

using clang::dataflow::ClauseID = typedef uint32_t

Clause identifiers are represented as positive integers.

Definition at line 81 of file WatchedLiteralsSolver.cpp.

◆ FieldSet

A set of FieldDecl *.

Use SmallSetVector to guarantee deterministic iteration order.

Definition at line 56 of file DataflowAnalysisContext.h.

◆ Literal

using clang::dataflow::Literal = typedef uint32_t

Literals are represented as positive integers.

Specifically, for a boolean variable V that is represented as the positive integer I, the positive literal V is represented as the integer 2*I and the negative literal !V is represented as the integer 2*I+1.

Definition at line 58 of file WatchedLiteralsSolver.cpp.

◆ MatchSwitchAction

template<typename T , typename State , typename Result = void>
using clang::dataflow::MatchSwitchAction = typedef std::function<Result( const T *, const ast_matchers::MatchFinder::MatchResult &, State &)>

Definition at line 68 of file MatchSwitch.h.

◆ MatchSwitchMatcher

template<typename T >
using clang::dataflow::MatchSwitchMatcher = typedef ast_matchers::internal::Matcher<T>

Definition at line 65 of file MatchSwitch.h.

◆ Variable

using clang::dataflow::Variable = typedef uint32_t

Boolean variables are represented as positive integers.

Definition at line 48 of file WatchedLiteralsSolver.cpp.

◆ VarMapLattice

template<typename ElementLattice >
using clang::dataflow::VarMapLattice = typedef MapLattice<const clang::VarDecl *, ElementLattice>

Convenience alias that captures the common use of map lattices to model in-scope variables.

Definition at line 112 of file MapLattice.h.

Enumeration Type Documentation

◆ Atom

enum class clang::dataflow::Atom : unsigned
strong

Identifies an atomic boolean variable such as "V1".

This often represents an assertion that is interesting to the analysis but cannot immediately be proven true or false. For example:

  • V1 may mean "the program reaches this point",
  • V2 may mean "the parameter was null"

We can use these variables in formulas to describe relationships we know to be true: "if the parameter was null, the program reaches this point". We also express hypotheses as formulas, and use a SAT solver to check whether they are consistent with the known facts.

Definition at line 34 of file Formula.h.

◆ ComparisonResult

Indicates the result of a tentative comparison.

Enumerator
Same 
Different 
Unknown 

Definition at line 42 of file DataflowEnvironment.h.

◆ LatticeJoinEffect

Effect indicating whether a lattice join operation resulted in a new value.

Enumerator
Unchanged 
Changed 

Definition at line 23 of file DataflowLattice.h.

Function Documentation

◆ areEquivalentIndirectionValues()

static bool clang::dataflow::areEquivalentIndirectionValues ( const Value Val1,
const Value Val2 
)
static

Definition at line 20 of file Value.cpp.

Referenced by areEquivalentValues().

◆ areEquivalentValues()

bool clang::dataflow::areEquivalentValues ( const Value Val1,
const Value Val2 
)

An equivalence relation for values.

It obeys reflexivity, symmetry and transitivity. It does not include comparison of Properties.

Computes equivalence for these subclasses:

Otherwise, falls back to pointer equality.

Definition at line 29 of file Value.cpp.

References areEquivalentIndirectionValues(), and clang::dataflow::Value::getKind().

Referenced by compareKeyToValueMaps(), clang::dataflow::Environment::join(), joinLocToVal(), and widenKeyToValueMap().

◆ atomsInEquivalenceClass()

static llvm::SmallVector< Atom > clang::dataflow::atomsInEquivalenceClass ( const llvm::EquivalenceClasses< Atom > &  EquivalentAtoms,
llvm::EquivalenceClasses< Atom >::iterator  LeaderIt 
)
static

Definition at line 66 of file SimplifyConstraints.cpp.

References clang::Result.

Referenced by simplifyConstraints().

◆ blockIndexInPredecessor()

static int clang::dataflow::blockIndexInPredecessor ( const CFGBlock Pred,
const CFGBlock Block 
)
static

Returns the index of Block in the successors of Pred.

Definition at line 46 of file TypeErasedDataflowAnalysis.cpp.

References clang::Block, clang::CFGBlock::succ_begin(), and clang::CFGBlock::succs().

Referenced by computeBlockInputState().

◆ buildCNF()

CNFFormula clang::dataflow::buildCNF ( const llvm::ArrayRef< const Formula * > &  Vals)

◆ buildStmtToBasicBlockMap()

static llvm::DenseMap< const Stmt *, const CFGBlock * > clang::dataflow::buildStmtToBasicBlockMap ( const CFG Cfg)
static

Returns a map from statements to basic blocks that contain them.

Definition at line 29 of file ControlFlowContext.cpp.

References clang::Block.

Referenced by clang::dataflow::ControlFlowContext::build().

◆ builtinTransfer()

static void clang::dataflow::builtinTransfer ( const CFGElement Elt,
TypeErasedDataflowAnalysisState State,
AnalysisContext &  AC 
)
static

◆ builtinTransferInitializer()

static void clang::dataflow::builtinTransferInitializer ( const CFGInitializer Elt,
TypeErasedDataflowAnalysisState InputState 
)
static

◆ builtinTransferStatement()

static void clang::dataflow::builtinTransferStatement ( const CFGStmt Elt,
TypeErasedDataflowAnalysisState InputState,
AnalysisContext &  AC 
)
static

Built-in transfer function for CFGStmt.

Definition at line 359 of file TypeErasedDataflowAnalysis.cpp.

References clang::dataflow::TypeErasedDataflowAnalysisState::Env, clang::CFGStmt::getStmt(), and transfer().

Referenced by builtinTransfer().

◆ cached()

template<class Key , class ComputeFunc >
const Formula & clang::dataflow::cached ( llvm::DenseMap< Key, const Formula * > &  Cache,
Key  K,
ComputeFunc &&  Compute 
)

◆ canonicalFormulaPair()

static std::pair< const Formula *, const Formula * > clang::dataflow::canonicalFormulaPair ( const Formula LHS,
const Formula RHS 
)
static

◆ compareDistinctValues()

static bool clang::dataflow::compareDistinctValues ( QualType  Type,
Value Val1,
const Environment Env1,
Value Val2,
const Environment Env2,
Environment::ValueModel Model 
)
static

◆ compareKeyToValueMaps()

template<typename Key >
bool clang::dataflow::compareKeyToValueMaps ( const llvm::MapVector< Key, Value * > &  Map1,
const llvm::MapVector< Key, Value * > &  Map2,
const Environment Env1,
const Environment Env2,
Environment::ValueModel Model 
)

◆ computeBlockInputState()

static TypeErasedDataflowAnalysisState clang::dataflow::computeBlockInputState ( const CFGBlock Block,
AnalysisContext &  AC 
)
static

Computes the input state for a given basic block by joining the output states of its predecessors.

Requirements:

All predecessors of Block except those with loop back edges must have already been transferred. States in AC.BlockStates that are set to std::nullopt represent basic blocks that are not evaluated yet.

Definition at line 285 of file TypeErasedDataflowAnalysis.cpp.

References clang::Block, blockIndexInPredecessor(), and clang::Copy.

Referenced by transferCFGBlock().

◆ containsSameFields()

bool clang::dataflow::containsSameFields ( const FieldSet Fields,
const RecordStorageLocation::FieldToLoc FieldLocs 
)

Returns whether Fields and FieldLocs contain the same fields.

Definition at line 398 of file DataflowAnalysisContext.cpp.

Referenced by clang::dataflow::DataflowAnalysisContext::createRecordStorageLocation().

◆ copyRecord()

void clang::dataflow::copyRecord ( RecordStorageLocation Src,
RecordStorageLocation Dst,
Environment Env 
)

Copies a record (struct, class, or union) from Src to Dst.

This performs a deep copy, i.e. it copies every field (including synthetic fields) and recurses on fields of record type. It also copies properties from the RecordValue associated with Src to the RecordValue associated with Dst (if these RecordValues exist).

If there is a RecordValue associated with Dst in the environment, this function creates a new RecordValue and associates it with Dst; clients need to be aware of this and must not assume that the RecordValue associated with Dst remains the same after the call.

We create a new RecordValue rather than modifying properties on the old RecordValue because the old RecordValue may be shared with other Environments, and we don't want changes to properties to be visible there.

Requirements:

Src and Dst must have the same canonical unqualified type.

Definition at line 17 of file RecordOps.cpp.

References clang::dataflow::RecordStorageLocation::children(), copyRecord(), Env, clang::Type::getAsCXXRecordDecl(), clang::QualType::getCanonicalType(), clang::dataflow::RecordStorageLocation::getChild(), clang::dataflow::RecordStorageLocation::getSyntheticField(), clang::dataflow::StorageLocation::getType(), clang::QualType::getUnqualifiedType(), clang::dataflow::Value::properties(), clang::dataflow::RecordStorageLocation::setChild(), clang::dataflow::Value::setProperty(), and clang::dataflow::RecordStorageLocation::synthetic_fields().

Referenced by builtinTransferInitializer(), and copyRecord().

◆ createAnalysis()

template<typename AnalysisT >
auto clang::dataflow::createAnalysis ( ASTContext ASTCtx,
Environment Env 
) -> decltype(AnalysisT(ASTCtx, Env))

Definition at line 243 of file DataflowAnalysis.h.

References Env.

◆ debugString() [1/2]

llvm::StringRef clang::dataflow::debugString ( Solver::Result::Status  Status)

Returns a string representation of the result status of a SAT check.

Definition at line 54 of file DebugSupport.cpp.

References clang::dataflow::Solver::Result::Satisfiable, clang::dataflow::Solver::Result::TimedOut, and clang::dataflow::Solver::Result::Unsatisfiable.

◆ debugString() [2/2]

llvm::StringRef clang::dataflow::debugString ( Value::Kind  Kind)

◆ diagnoseFunction()

template<typename AnalysisT , typename Diagnostic >
llvm::Expected< llvm::SmallVector< Diagnostic > > clang::dataflow::diagnoseFunction ( const FunctionDecl FuncDecl,
ASTContext ASTCtx,
llvm::function_ref< llvm::SmallVector< Diagnostic >(const CFGElement &, ASTContext &, const TransferStateForDiagnostics< typename AnalysisT::Lattice > &)>  Diagnoser,
std::int64_t  MaxSATIterations = 1'000'000'000 
)

Runs a dataflow analysis over the given function and then runs Diagnoser over the results.

Returns a list of diagnostics for FuncDecl or an error. Currently, errors can occur (at least) because the analysis requires too many iterations over the CFG or the SAT solver times out.

The default value of MaxSATIterations was chosen based on the following observations:

  • Non-pathological calls to the solver typically require only a few hundred iterations.
  • This limit is still low enough to keep runtimes acceptable (on typical machines) in cases where we hit the limit.

Definition at line 265 of file DataflowAnalysis.h.

References Analysis, clang::dataflow::ControlFlowContext::build(), Env, and runTypeErasedDataflowAnalysis().

◆ equateUnknownValues()

static bool clang::dataflow::equateUnknownValues ( Value::Kind  K)
static

◆ evaluateBooleanEquality()

static BoolValue & clang::dataflow::evaluateBooleanEquality ( const Expr LHS,
const Expr RHS,
Environment Env 
)
static

◆ findReachableBlocks()

static llvm::BitVector clang::dataflow::findReachableBlocks ( const CFG Cfg)
static

◆ getBaseObjectLocation()

RecordStorageLocation * clang::dataflow::getBaseObjectLocation ( const MemberExpr ME,
const Environment Env 
)

Returns the storage location for the base object of a MemberExpr, or null if none is defined in the environment.

Dereferences the pointer if the member expression was written using ->.

Definition at line 1009 of file DataflowEnvironment.cpp.

References Env, clang::MemberExpr::getBase(), clang::dataflow::Environment::getStorageLocation(), clang::dataflow::Environment::getValue(), and clang::MemberExpr::isArrow().

◆ getFieldsForInitListExpr()

std::vector< FieldDecl * > clang::dataflow::getFieldsForInitListExpr ( const RecordDecl RD)

Returns the fields of RD that are initialized by an InitListExpr, in the order in which they appear in InitListExpr::inits().

Definition at line 1022 of file DataflowEnvironment.cpp.

References clang::RecordDecl::fields().

Referenced by getFieldsGlobalsAndFuncs().

◆ getFieldsGlobalsAndFuncs() [1/2]

static void clang::dataflow::getFieldsGlobalsAndFuncs ( const Decl D,
FieldSet Fields,
llvm::DenseSet< const VarDecl * > &  Vars,
llvm::DenseSet< const FunctionDecl * > &  Funcs 
)
static

Definition at line 318 of file DataflowEnvironment.cpp.

References insertIfFunction(), and insertIfGlobal().

Referenced by getFieldsGlobalsAndFuncs().

◆ getFieldsGlobalsAndFuncs() [2/2]

static void clang::dataflow::getFieldsGlobalsAndFuncs ( const Stmt S,
FieldSet Fields,
llvm::DenseSet< const VarDecl * > &  Vars,
llvm::DenseSet< const FunctionDecl * > &  Funcs 
)
static

Traverses S and inserts into Fields, Vars and Funcs any fields, global variables and functions that are declared in or referenced from sub-statements.

Definition at line 335 of file DataflowEnvironment.cpp.

References clang::C, getFieldsForInitListExpr(), getFieldsGlobalsAndFuncs(), getMemberForAccessor(), insertIfFunction(), and insertIfGlobal().

◆ getImplicitObjectLocation()

RecordStorageLocation * clang::dataflow::getImplicitObjectLocation ( const CXXMemberCallExpr MCE,
const Environment Env 
)

Returns the storage location for the implicit object of a CXXMemberCallExpr, or null if none is defined in the environment.

Dereferences the pointer if the member call expression was written using ->.

Definition at line 995 of file DataflowEnvironment.cpp.

References Env, clang::CXXMemberCallExpr::getImplicitObjectArgument(), clang::dataflow::Environment::getStorageLocation(), clang::Expr::getType(), clang::dataflow::Environment::getValue(), and clang::Type::isPointerType().

◆ getKeys()

template<typename T >
static llvm::DenseSet< llvm::StringRef > clang::dataflow::getKeys ( const llvm::StringMap< T > &  Map)
static

◆ getMemberForAccessor()

static MemberExpr * clang::dataflow::getMemberForAccessor ( const CXXMemberCallExpr C)
static

Definition at line 302 of file DataflowEnvironment.cpp.

References clang::C.

Referenced by getFieldsGlobalsAndFuncs().

◆ getObjectFields()

clang::dataflow::FieldSet clang::dataflow::getObjectFields ( QualType  Type)

Returns the set of all fields in the type.

Gets the set of all fields in the type.

Definition at line 392 of file DataflowAnalysisContext.cpp.

References getFieldsFromClassHierarchy().

Referenced by clang::dataflow::DataflowAnalysisContext::getModeledFields().

◆ hasOptionalClassName()

static bool clang::dataflow::hasOptionalClassName ( const CXXRecordDecl RD)
static

◆ ignoreCFGOmittedNodes() [1/2]

const Expr & clang::dataflow::ignoreCFGOmittedNodes ( const Expr E)

Skip past nodes that the CFG does not emit.

These nodes are invisible to flow-sensitive analysis, and should be ignored as they will effectively not exist.

  • ParenExpr - The CFG takes the operator precedence into account, but otherwise omits the node afterwards.
  • ExprWithCleanups - The CFG will generate the appropriate calls to destructors and then omit the node.

Definition at line 359 of file DataflowAnalysisContext.cpp.

Referenced by clang::dataflow::StmtToEnvMap::getEnvironment(), clang::dataflow::DataflowAnalysisContext::getStableStorageLocation(), clang::dataflow::Environment::getValue(), and ignoreCFGOmittedNodes().

◆ ignoreCFGOmittedNodes() [2/2]

const Stmt & clang::dataflow::ignoreCFGOmittedNodes ( const Stmt S)

Definition at line 370 of file DataflowAnalysisContext.cpp.

References ignoreCFGOmittedNodes().

◆ insertIfFunction()

static void clang::dataflow::insertIfFunction ( const Decl D,
llvm::DenseSet< const FunctionDecl * > &  Funcs 
)
static

Definition at line 296 of file DataflowEnvironment.cpp.

Referenced by getFieldsGlobalsAndFuncs().

◆ insertIfGlobal()

static void clang::dataflow::insertIfGlobal ( const Decl D,
llvm::DenseSet< const VarDecl * > &  Vars 
)
static

Initializes a global storage value.

Definition at line 289 of file DataflowEnvironment.cpp.

References V.

Referenced by getFieldsGlobalsAndFuncs().

◆ intersectDeclToLoc()

static llvm::DenseMap< const ValueDecl *, StorageLocation * > clang::dataflow::intersectDeclToLoc ( const llvm::DenseMap< const ValueDecl *, StorageLocation * > &  DeclToLoc1,
const llvm::DenseMap< const ValueDecl *, StorageLocation * > &  DeclToLoc2 
)
static

Returns a map consisting of key-value entries that are present in both maps.

Definition at line 39 of file DataflowEnvironment.cpp.

References clang::Result.

Referenced by clang::dataflow::Environment::join().

◆ isBackedgeNode()

static bool clang::dataflow::isBackedgeNode ( const CFGBlock B)
static

◆ isCheckLikeMethod()

bool clang::dataflow::isCheckLikeMethod ( llvm::SmallDenseSet< const CXXMethodDecl * > &  CheckDecls,
const CXXMethodDecl D 
)

◆ isNegLit()

static constexpr bool clang::dataflow::isNegLit ( Literal  L)
staticconstexpr

◆ isPosLit()

static constexpr bool clang::dataflow::isPosLit ( Literal  L)
staticconstexpr

◆ isTopLevelNamespaceWithName()

static bool clang::dataflow::isTopLevelNamespaceWithName ( const NamespaceDecl NS,
llvm::StringRef  Name 
)
static

◆ joinLocToVal()

static llvm::MapVector< const StorageLocation *, Value * > clang::dataflow::joinLocToVal ( const llvm::MapVector< const StorageLocation *, Value * > &  LocToVal,
const llvm::MapVector< const StorageLocation *, Value * > &  LocToVal2,
const Environment Env1,
const Environment Env2,
Environment JoinedEnv,
Environment::ValueModel Model 
)
static

◆ makeLoggerFromCommandLine()

static std::unique_ptr< Logger > clang::dataflow::makeLoggerFromCommandLine ( )
static

◆ maybeUnpackLValueExpr()

static Value * clang::dataflow::maybeUnpackLValueExpr ( const Expr E,
Environment Env 
)
static

◆ mergeDistinctValues()

static Value * clang::dataflow::mergeDistinctValues ( QualType  Type,
Value Val1,
const Environment Env1,
Value Val2,
const Environment Env2,
Environment MergedEnv,
Environment::ValueModel Model 
)
static

Attempts to merge distinct values Val1 and Val2 in Env1 and Env2, respectively, of the same type Type.

Merging generally produces a single value that (soundly) approximates the two inputs, although the actual meaning depends on Model.

Definition at line 93 of file DataflowEnvironment.cpp.

References clang::dataflow::Environment::arena(), clang::dataflow::Environment::assume(), clang::dataflow::Environment::create(), clang::dataflow::Environment::createValue(), clang::dataflow::Environment::getFlowConditionToken(), clang::dataflow::Arena::makeAtomRef(), and clang::dataflow::Environment::ValueModel::merge().

Referenced by clang::dataflow::Environment::join(), and joinLocToVal().

◆ negLit()

static constexpr Literal clang::dataflow::negLit ( Variable  V)
staticconstexpr

◆ notLit()

static constexpr Literal clang::dataflow::notLit ( Literal  L)
staticconstexpr

Returns the negated literal !L.

Definition at line 75 of file WatchedLiteralsSolver.cpp.

◆ operator<<() [1/8]

llvm::raw_ostream & clang::dataflow::operator<< ( llvm::raw_ostream &  OS,
const Solver::Result R 
)

◆ operator<<() [2/8]

llvm::raw_ostream & clang::dataflow::operator<< ( llvm::raw_ostream &  OS,
Solver::Result::Assignment  Assignment 
)

◆ operator<<() [3/8]

llvm::raw_ostream & clang::dataflow::operator<< ( llvm::raw_ostream &  OS,
Atom  A 
)
inline

Definition at line 121 of file Formula.h.

◆ operator<<() [4/8]

llvm::raw_ostream & clang::dataflow::operator<< ( llvm::raw_ostream &  OS,
const Formula F 
)
inline

Definition at line 124 of file Formula.h.

References clang::dataflow::Formula::print().

◆ operator<<() [5/8]

raw_ostream & clang::dataflow::operator<< ( raw_ostream &  OS,
const Value Val 
)

◆ operator<<() [6/8]

template<typename Key , typename ElementLattice >
std::ostream & clang::dataflow::operator<< ( std::ostream &  Os,
const clang::dataflow::MapLattice< Key, ElementLattice > &  M 
)

Definition at line 115 of file MapLattice.h.

◆ operator<<() [7/8]

template<typename ElementLattice >
std::ostream & clang::dataflow::operator<< ( std::ostream &  Os,
const clang::dataflow::VarMapLattice< ElementLattice > &  M 
)

Definition at line 128 of file MapLattice.h.

◆ operator<<() [8/8]

std::ostream & clang::dataflow::operator<< ( std::ostream &  OS,
const NoopLattice  
)
inline

Definition at line 34 of file NoopLattice.h.

◆ posLit()

static constexpr Literal clang::dataflow::posLit ( Variable  V)
staticconstexpr

◆ printAtomList()

static void clang::dataflow::printAtomList ( const llvm::SmallVector< Atom > &  Atoms,
llvm::raw_ostream &  OS 
)
static

◆ projectToLeaders()

static llvm::DenseSet< Atom > clang::dataflow::projectToLeaders ( const llvm::DenseSet< Atom > &  Atoms,
llvm::EquivalenceClasses< Atom > &  EquivalentAtoms 
)
static

Definition at line 53 of file SimplifyConstraints.cpp.

References clang::Result.

Referenced by simplifyConstraints().

◆ propagateStorageLocation()

static void clang::dataflow::propagateStorageLocation ( const Expr From,
const Expr To,
Environment Env 
)
static

◆ propagateValue()

static void clang::dataflow::propagateValue ( const Expr From,
const Expr To,
Environment Env 
)
static

◆ propagateValueOrStorageLocation()

static void clang::dataflow::propagateValueOrStorageLocation ( const Expr From,
const Expr To,
Environment Env 
)
static

◆ recordsEqual() [1/2]

bool clang::dataflow::recordsEqual ( const RecordStorageLocation Loc1,
const Environment Env1,
const RecordStorageLocation Loc2,
const Environment Env2 
)

Returns whether the records Loc1 and Loc2 are equal.

Values for Loc1 are retrieved from Env1, and values for Loc2 are retrieved from Env2. A convenience overload retrieves values for Loc1 and Loc2 from the same environment.

This performs a deep comparison, i.e. it compares every field (including synthetic fields) and recurses on fields of record type. Fields of reference type compare equal if they refer to the same storage location. If RecordValues are associated with Loc1 and Loc2, it also compares the properties on thoseRecordValue`s.

Note on how to interpret the result:

  • If this returns true, the records are guaranteed to be equal at runtime.
  • If this returns false, the records may still be equal at runtime; our analysis merely cannot guarantee that they will be equal.

Requirements:

Src and Dst must have the same canonical unqualified type.

Definition at line 84 of file RecordOps.cpp.

References clang::dataflow::RecordStorageLocation::children(), clang::QualType::getCanonicalType(), clang::dataflow::RecordStorageLocation::getChild(), clang::dataflow::RecordStorageLocation::getSyntheticField(), clang::dataflow::StorageLocation::getType(), clang::QualType::getUnqualifiedType(), clang::dataflow::Environment::getValue(), recordsEqual(), and clang::dataflow::RecordStorageLocation::synthetic_fields().

Referenced by recordsEqual().

◆ recordsEqual() [2/2]

bool clang::dataflow::recordsEqual ( const RecordStorageLocation Loc1,
const RecordStorageLocation Loc2,
const Environment Env 
)
inline

Definition at line 67 of file RecordOps.h.

References Env, and recordsEqual().

◆ refreshRecordValue() [1/2]

RecordValue & clang::dataflow::refreshRecordValue ( const Expr Expr,
Environment Env 
)

◆ refreshRecordValue() [2/2]

RecordValue & clang::dataflow::refreshRecordValue ( RecordStorageLocation Loc,
Environment Env 
)

Associates a new RecordValue with Loc and returns the new value.

It is not defined whether the field values remain the same or not.

This function is primarily intended for use by checks that set custom properties on RecordValues to model the state of these values. Such checks should avoid modifying the properties of an existing RecordValue because these changes would be visible to other Environments that share the same RecordValue. Instead, call refreshRecordValue(), then set the properties on the new RecordValue that it returns. Typical usage:

refreshRecordValue(Loc, Env).setProperty("my_prop", MyPropValue);

Definition at line 1034 of file DataflowEnvironment.cpp.

References clang::dataflow::Environment::create(), Env, and clang::dataflow::Environment::setValue().

◆ runDataflowAnalysis()

template<typename AnalysisT >
llvm::Expected< std::vector< std::optional< DataflowAnalysisState< typename AnalysisT::Lattice > > > > clang::dataflow::runDataflowAnalysis ( const ControlFlowContext CFCtx,
AnalysisT &  Analysis,
const Environment InitEnv,
std::function< void(const CFGElement &, const DataflowAnalysisState< typename AnalysisT::Lattice > &)>  PostVisitCFG = nullptr 
)

Performs dataflow analysis and returns a mapping from basic block IDs to dataflow analysis states that model the respective basic blocks.

The returned vector, if any, will have the same size as the number of CFG blocks, with indices corresponding to basic block IDs. Returns an error if the dataflow analysis cannot be performed successfully. Otherwise, calls PostVisitCFG on each CFG element with the final analysis results at that program point.

Definition at line 192 of file DataflowAnalysis.h.

References Analysis, BlockStates, CFCtx, InitEnv, and runTypeErasedDataflowAnalysis().

◆ runTypeErasedDataflowAnalysis()

llvm::Expected< std::vector< std::optional< TypeErasedDataflowAnalysisState > > > clang::dataflow::runTypeErasedDataflowAnalysis ( const ControlFlowContext CFCtx,
TypeErasedDataflowAnalysis Analysis,
const Environment InitEnv,
std::function< void(const CFGElement &, const TypeErasedDataflowAnalysisState &)>  PostVisitCFG = nullptr 
)

◆ sigil()

static llvm::StringLiteral clang::dataflow::sigil ( Formula::Kind  K)
static

◆ simplifyConstraints()

void clang::dataflow::simplifyConstraints ( llvm::SetVector< const Formula * > &  Constraints,
Arena arena,
SimplifyConstraintsInfo Info = nullptr 
)

Simplifies a set of constraints (implicitly connected by "and") in a way that does not change satisfiability of the constraints.

This does not mean that the set of solutions is the same before and after simplification. Info, if non-null, will be populated with information about the simplifications that were made to the formula (e.g. to display to the user).

Definition at line 75 of file SimplifyConstraints.cpp.

References clang::dataflow::Formula::And, clang::dataflow::Formula::AtomRef, atomsInEquivalenceClass(), clang::dataflow::Formula::Equal, clang::dataflow::SimplifyConstraintsInfo::EquivalentAtoms, clang::dataflow::SimplifyConstraintsInfo::FalseAtoms, clang::dataflow::Formula::kind(), clang::dataflow::Arena::makeAtomRef(), clang::dataflow::Arena::makeLiteral(), clang::dataflow::Formula::Not, clang::dataflow::Formula::operands(), projectToLeaders(), substitute(), and clang::dataflow::SimplifyConstraintsInfo::TrueAtoms.

Referenced by clang::dataflow::DataflowAnalysisContext::dumpFlowCondition().

◆ substitute()

static const Formula & clang::dataflow::substitute ( const Formula F,
const llvm::DenseMap< Atom, const Formula * > &  Substitutions,
Arena arena 
)
static

◆ transfer()

void clang::dataflow::transfer ( const StmtToEnvMap StmtToEnv,
const Stmt S,
Environment Env 
)

Evaluates S and updates Env accordingly.

Requirements:

S must not be ParenExpr or ExprWithCleanups.

Definition at line 824 of file Transfer.cpp.

References Env.

Referenced by builtinTransferStatement(), and clang::dataflow::DataflowAnalysis< Derived, LatticeT >::transferTypeErased().

◆ transferCFGBlock()

static TypeErasedDataflowAnalysisState clang::dataflow::transferCFGBlock ( const CFGBlock Block,
AnalysisContext &  AC,
std::function< void(const CFGElement &, const TypeErasedDataflowAnalysisState &)>  PostVisitCFG = nullptr 
)
static

Transfers State by evaluating each element in the Block based on the AC.Analysis specified.

Built-in transfer functions (if the option for ApplyBuiltinTransfer is set by the analysis) will be applied to the element before evaluation by the user-specified analysis. PostVisitCFG (if provided) will be applied to the element after evaluation by the user-specified analysis.

Definition at line 465 of file TypeErasedDataflowAnalysis.cpp.

References clang::Block, builtinTransfer(), and computeBlockInputState().

Referenced by runTypeErasedDataflowAnalysis().

◆ unpackValue()

static BoolValue & clang::dataflow::unpackValue ( BoolValue V,
Environment Env 
)
static

◆ valueTypeFromOptionalType()

static QualType clang::dataflow::valueTypeFromOptionalType ( QualType  OptionalTy)
static

◆ var()

static constexpr Variable clang::dataflow::var ( Literal  L)
staticconstexpr

Returns the variable of L.

Definition at line 78 of file WatchedLiteralsSolver.cpp.

Referenced by clang::dataflow::CNFFormulaBuilder::addClause().

◆ widenDistinctValues()

static Value & clang::dataflow::widenDistinctValues ( QualType  Type,
Value Prev,
const Environment PrevEnv,
Value Current,
Environment CurrentEnv,
Environment::ValueModel Model 
)
static

◆ widenKeyToValueMap()

template<typename Key >
llvm::MapVector< Key, Value * > clang::dataflow::widenKeyToValueMap ( const llvm::MapVector< Key, Value * > &  CurMap,
const llvm::MapVector< Key, Value * > &  PrevMap,
Environment CurEnv,
const Environment PrevEnv,
Environment::ValueModel Model,
LatticeJoinEffect Effect 
)

Variable Documentation

◆ MaxCompositeValueDepth

constexpr int clang::dataflow::MaxCompositeValueDepth = 3
staticconstexpr

Definition at line 35 of file DataflowEnvironment.cpp.

◆ MaxCompositeValueSize

constexpr int clang::dataflow::MaxCompositeValueSize = 1000
staticconstexpr

Definition at line 36 of file DataflowEnvironment.cpp.

Referenced by clang::dataflow::Environment::createValue().

◆ NullClause

constexpr ClauseID clang::dataflow::NullClause = 0
staticconstexpr

A null clause identifier is used as a placeholder in various data structures and algorithms.

Definition at line 85 of file WatchedLiteralsSolver.cpp.

◆ NullLit

constexpr Literal clang::dataflow::NullLit = 0
staticconstexpr

A null literal is used as a placeholder in various data structures and algorithms.

Definition at line 62 of file WatchedLiteralsSolver.cpp.

Referenced by clang::dataflow::CNFFormulaBuilder::addClause(), and clang::dataflow::CNFFormula::addClause().

◆ NullVar

constexpr Variable clang::dataflow::NullVar = 0
staticconstexpr

A null boolean variable is used as a placeholder in various data structures and algorithms.

Definition at line 52 of file WatchedLiteralsSolver.cpp.

Referenced by clang::dataflow::WatchedLiteralsSolverImpl::WatchedLiteralsSolverImpl().