clang 17.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::dataflow::NoopAnalysis Class Reference

#include "clang/Analysis/FlowSensitive/NoopAnalysis.h"

Inheritance diagram for clang::dataflow::NoopAnalysis:
Inheritance graph
[legend]

Public Member Functions

 NoopAnalysis (ASTContext &Context, bool ApplyBuiltinTransfer)
 Deprecated. Use the DataflowAnalysisOptions constructor instead.
 
 NoopAnalysis (ASTContext &Context, DataflowAnalysisOptions Options)
 ApplyBuiltinTransfer controls whether to run the built-in transfer functions that model memory during the analysis.
 
void transfer (const CFGElement &E, NoopLattice &L, Environment &Env)
 
- Public Member Functions inherited from clang::dataflow::DataflowAnalysis< NoopAnalysis, NoopLattice >
 DataflowAnalysis (ASTContext &Context)
 
 DataflowAnalysis (ASTContext &Context, bool ApplyBuiltinTransfer)
 Deprecated. Use the DataflowAnalysisOptions constructor instead.
 
 DataflowAnalysis (ASTContext &Context, DataflowAnalysisOptions Options)
 
ASTContextgetASTContext () final
 Returns the ASTContext that is used by the analysis.
 
TypeErasedLattice typeErasedInitialElement () final
 Returns a type-erased lattice element that models the initial state of a basic block.
 
LatticeJoinEffect joinTypeErased (TypeErasedLattice &E1, const TypeErasedLattice &E2) final
 Joins two type-erased lattice elements by computing their least upper bound.
 
LatticeJoinEffect widenTypeErased (TypeErasedLattice &Current, const TypeErasedLattice &Previous) final
 Chooses a lattice element that approximates the current element at a program point, given the previous element at that point.
 
bool isEqualTypeErased (const TypeErasedLattice &E1, const TypeErasedLattice &E2) final
 Returns true if and only if the two given type-erased lattice elements are equal.
 
void transferTypeErased (const CFGElement &Element, TypeErasedLattice &E, Environment &Env) final
 Applies the analysis transfer function for a given control flow graph element and type-erased lattice element.
 
void transferBranchTypeErased (bool Branch, const Stmt *Stmt, TypeErasedLattice &E, Environment &Env) final
 Applies the analysis transfer function for a given edge from a CFG block of a conditional statement.
 
- Public Member Functions inherited from clang::dataflow::TypeErasedDataflowAnalysis
 TypeErasedDataflowAnalysis ()
 
 TypeErasedDataflowAnalysis (DataflowAnalysisOptions Options)
 
virtual ~TypeErasedDataflowAnalysis ()
 
virtual ASTContextgetASTContext ()=0
 Returns the ASTContext that is used by the analysis.
 
virtual TypeErasedLattice typeErasedInitialElement ()=0
 Returns a type-erased lattice element that models the initial state of a basic block.
 
virtual LatticeJoinEffect joinTypeErased (TypeErasedLattice &, const TypeErasedLattice &)=0
 Joins two type-erased lattice elements by computing their least upper bound.
 
virtual LatticeJoinEffect widenTypeErased (TypeErasedLattice &Current, const TypeErasedLattice &Previous)=0
 Chooses a lattice element that approximates the current element at a program point, given the previous element at that point.
 
virtual bool isEqualTypeErased (const TypeErasedLattice &, const TypeErasedLattice &)=0
 Returns true if and only if the two given type-erased lattice elements are equal.
 
virtual void transferTypeErased (const CFGElement &, TypeErasedLattice &, Environment &)=0
 Applies the analysis transfer function for a given control flow graph element and type-erased lattice element.
 
virtual void transferBranchTypeErased (bool Branch, const Stmt *, TypeErasedLattice &, Environment &)=0
 Applies the analysis transfer function for a given edge from a CFG block of a conditional statement.
 
const std::optional< DataflowAnalysisContext::Options > & builtinOptions () const
 If the built-in model is enabled, returns the options to be passed to them.
 
- Public Member Functions inherited from clang::dataflow::Environment::ValueModel
virtual ~ValueModel ()=default
 
virtual ComparisonResult compare (QualType Type, const Value &Val1, const Environment &Env1, const Value &Val2, const Environment &Env2)
 Returns: Same: Val1 is equivalent to Val2, according to the model.
 
virtual bool merge (QualType Type, const Value &Val1, const Environment &Env1, const Value &Val2, const Environment &Env2, Value &MergedVal, Environment &MergedEnv)
 Modifies MergedVal to approximate both Val1 and Val2.
 
virtual Valuewiden (QualType Type, Value &Prev, const Environment &PrevEnv, Value &Current, Environment &CurrentEnv)
 This function may widen the current value – replace it with an approximation that can reach a fixed point more quickly than iterated application of the transfer function alone.
 

Static Public Member Functions

static NoopLattice initialElement ()
 

Additional Inherited Members

- Public Types inherited from clang::dataflow::DataflowAnalysis< NoopAnalysis, NoopLattice >
using Lattice = NoopLattice
 Bounded join-semilattice that is used in the analysis.
 

Detailed Description

Definition at line 25 of file NoopAnalysis.h.

Constructor & Destructor Documentation

◆ NoopAnalysis() [1/2]

clang::dataflow::NoopAnalysis::NoopAnalysis ( ASTContext Context,
bool  ApplyBuiltinTransfer 
)
inline

Deprecated. Use the DataflowAnalysisOptions constructor instead.

Definition at line 28 of file NoopAnalysis.h.

◆ NoopAnalysis() [2/2]

clang::dataflow::NoopAnalysis::NoopAnalysis ( ASTContext Context,
DataflowAnalysisOptions  Options 
)
inline

ApplyBuiltinTransfer controls whether to run the built-in transfer functions that model memory during the analysis.

Their results are not used by NoopAnalysis, but tests that need to inspect the environment should enable them.

Definition at line 36 of file NoopAnalysis.h.

Member Function Documentation

◆ initialElement()

static NoopLattice clang::dataflow::NoopAnalysis::initialElement ( )
inlinestatic

Definition at line 39 of file NoopAnalysis.h.

◆ transfer()

void clang::dataflow::NoopAnalysis::transfer ( const CFGElement E,
NoopLattice L,
Environment Env 
)
inline

Definition at line 41 of file NoopAnalysis.h.


The documentation for this class was generated from the following file: