clang 20.0.0git
|
The Arena owns the objects that model data within an analysis. More...
#include "clang/Analysis/FlowSensitive/Arena.h"
Public Member Functions | |
Arena () | |
Arena (const Arena &)=delete | |
Arena & | operator= (const Arena &)=delete |
template<typename T , typename... Args> | |
std::enable_if_t< std::is_base_of< StorageLocation, T >::value, T & > | create (Args &&...args) |
Creates a T (some subclass of StorageLocation ), forwarding args to the constructor, and returns a reference to it. | |
template<typename T , typename... Args> | |
std::enable_if_t< std::is_base_of< Value, T >::value, T & > | create (Args &&...args) |
Creates a T (some subclass of Value ), forwarding args to the constructor, and returns a reference to it. | |
BoolValue & | makeBoolValue (const Formula &) |
Creates a BoolValue wrapping a particular formula. | |
AtomicBoolValue & | makeAtomValue () |
Creates a fresh atom and wraps in in an AtomicBoolValue. | |
TopBoolValue & | makeTopValue () |
Creates a fresh Top boolean value. | |
IntegerValue & | makeIntLiteral (llvm::APInt Value) |
Returns a symbolic integer value that models an integer literal equal to Value . | |
const Formula & | makeAnd (const Formula &LHS, const Formula &RHS) |
Returns a formula for the conjunction of LHS and RHS . | |
const Formula & | makeOr (const Formula &LHS, const Formula &RHS) |
Returns a formula for the disjunction of LHS and RHS . | |
const Formula & | makeNot (const Formula &Val) |
Returns a formula for the negation of Val . | |
const Formula & | makeImplies (const Formula &LHS, const Formula &RHS) |
Returns a formula for LHS => RHS . | |
const Formula & | makeEquals (const Formula &LHS, const Formula &RHS) |
Returns a formula for LHS <=> RHS . | |
const Formula & | makeAtomRef (Atom A) |
Returns a formula for the variable A. | |
const Formula & | makeLiteral (bool Value) |
Returns a formula for a literal true/false. | |
llvm::Expected< const Formula & > | parseFormula (llvm::StringRef) |
Atom | makeAtom () |
Returns a new atomic boolean variable, distinct from any other. | |
Atom | makeFlowConditionToken () |
Creates a fresh flow condition and returns a token that identifies it. | |
The Arena owns the objects that model data within an analysis.
For example, Value
, StorageLocation
, Atom
, and Formula
.
|
delete |
|
inline |
Creates a T
(some subclass of StorageLocation
), forwarding args
to the constructor, and returns a reference to it.
The Arena
takes ownership of the created object. The object will be destroyed when the Arena
is destroyed.
Definition at line 36 of file Arena.h.
Referenced by clang::dataflow::Environment::create().
Returns a formula for the conjunction of LHS
and RHS
.
Definition at line 41 of file Arena.cpp.
References clang::dataflow::Formula::And, clang::dataflow::cached(), clang::dataflow::canonicalFormulaPair(), clang::dataflow::Formula::create(), clang::if(), clang::dataflow::Formula::kind(), clang::dataflow::Formula::Literal, and clang::dataflow::Formula::literal().
Referenced by clang::dataflow::substitute().
|
inline |
Returns a new atomic boolean variable, distinct from any other.
Definition at line 118 of file Arena.h.
Referenced by makeAtomValue(), makeFlowConditionToken(), and makeTopValue().
Returns a formula for the variable A.
Definition at line 34 of file Arena.cpp.
References clang::dataflow::Formula::AtomRef, clang::dataflow::cached(), and clang::dataflow::Formula::create().
Referenced by clang::dataflow::joinDistinctValues(), makeAtomValue(), makeTopValue(), and clang::dataflow::simplifyConstraints().
|
inline |
Creates a fresh atom and wraps in in an AtomicBoolValue.
FIXME: For now, identical-address AtomicBoolValue <=> identical atom. Stop relying on pointer identity and remove this guarantee.
Definition at line 71 of file Arena.h.
References makeAtom(), makeAtomRef(), and makeBoolValue().
Referenced by clang::dataflow::Environment::makeAtomicBoolValue().
Creates a BoolValue wrapping a particular formula.
Passing in the same formula will result in the same BoolValue. FIXME: Interning BoolValues but not other Values is inconsistent. Decide whether we want Value interning or not.
Definition at line 112 of file Arena.cpp.
References clang::dataflow::Formula::AtomRef, and clang::dataflow::Formula::kind().
Referenced by clang::dataflow::Environment::getBoolLiteralValue(), clang::dataflow::Environment::makeAnd(), makeAtomValue(), clang::dataflow::Environment::makeIff(), clang::dataflow::Environment::makeImplication(), clang::dataflow::Environment::makeNot(), clang::dataflow::Environment::makeOr(), and clang::dataflow::unpackValue().
Returns a formula for LHS <=> RHS
.
Definition at line 91 of file Arena.cpp.
References clang::dataflow::cached(), clang::dataflow::canonicalFormulaPair(), clang::dataflow::Formula::create(), clang::dataflow::Formula::Equal, clang::dataflow::Formula::kind(), clang::dataflow::Formula::Literal, clang::dataflow::Formula::literal(), makeLiteral(), and makeNot().
Referenced by clang::dataflow::substitute().
|
inline |
Creates a fresh flow condition and returns a token that identifies it.
The token can be used to perform various operations on the flow condition such as adding constraints to it, forking it, joining it with another flow condition, or checking implications.
Definition at line 124 of file Arena.h.
References makeAtom().
Returns a formula for LHS => RHS
.
Definition at line 78 of file Arena.cpp.
References clang::dataflow::cached(), clang::dataflow::Formula::create(), clang::dataflow::Formula::Implies, clang::dataflow::Formula::kind(), clang::dataflow::Formula::Literal, clang::dataflow::Formula::literal(), makeLiteral(), and makeNot().
Referenced by clang::dataflow::substitute().
IntegerValue & clang::dataflow::Arena::makeIntLiteral | ( | llvm::APInt | Value | ) |
Returns a symbolic integer value that models an integer literal equal to Value
.
These literals are the same every time. Integer literals are not typed; the type is determined by the Expr
that an integer literal is associated with.
Definition at line 104 of file Arena.cpp.
Referenced by clang::dataflow::Environment::getIntLiteralValue().
Returns a formula for a literal true/false.
Definition at line 111 of file Arena.h.
Referenced by makeEquals(), makeImplies(), makeNot(), and clang::dataflow::simplifyConstraints().
Returns a formula for the negation of Val
.
Definition at line 67 of file Arena.cpp.
References clang::dataflow::cached(), clang::dataflow::Formula::create(), clang::if(), clang::dataflow::Formula::kind(), clang::dataflow::Formula::Literal, clang::dataflow::Formula::literal(), makeLiteral(), clang::dataflow::Formula::Not, and clang::dataflow::Formula::operands().
Referenced by makeEquals(), makeImplies(), clang::dataflow::substitute(), and clang::dataflow::widenDistinctValues().
Returns a formula for the disjunction of LHS
and RHS
.
Definition at line 54 of file Arena.cpp.
References clang::dataflow::cached(), clang::dataflow::canonicalFormulaPair(), clang::dataflow::Formula::create(), clang::if(), clang::dataflow::Formula::kind(), clang::dataflow::Formula::Literal, clang::dataflow::Formula::literal(), and clang::dataflow::Formula::Or.
Referenced by clang::dataflow::substitute().
|
inline |
Creates a fresh Top boolean value.
Definition at line 76 of file Arena.h.
References makeAtom(), and makeAtomRef().
Referenced by clang::dataflow::Environment::makeTopBoolValue().
llvm::Expected< const Formula & > clang::dataflow::Arena::parseFormula | ( | llvm::StringRef | In | ) |
Definition at line 202 of file Arena.cpp.
References clang::Result.