class NoopAnalysis

Declaration

class NoopAnalysis : public DataflowAnalysis { /* full declaration omitted */ };

Description

Base class template for dataflow analyses built on a single lattice type. Requirements: `Derived` must be derived from a specialization of this class template and must provide the following public members: * `LatticeT initialElement()` - returns a lattice element that models the initial state of a basic block; * `void transfer(const Stmt *, LatticeT & , Environment & )` - applies the analysis transfer function for a given statement and lattice element. `Derived` can optionally override the following members: * `bool merge(QualType, const Value & , const Value & , Value & , Environment & )` - joins distinct values. This could be a strict lattice join or a more general widening operation. `LatticeT` is a bounded join-shdocattice that is used by `Derived` and must provide the following public members: * `LatticeJoinEffect join(const LatticeT & )` - joins the object and the argument by computing their least upper bound, modifies the object if necessary, and returns an effect indicating whether any changes were made to it; * `bool operator==(const LatticeT & ) const` - returns true if and only if the object is equal to the argument.

Declared at: clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h:25

Inherits from: DataflowAnalysis

Method Overview

  • public NoopAnalysis(clang::ASTContext & Context, bool ApplyBuiltinTransfer)
  • public NoopAnalysis(clang::ASTContext & Context, clang::dataflow::DataflowAnalysisOptions Options)
  • public static clang::dataflow::NoopLattice initialElement()
  • public void transfer(const clang::Stmt * S, clang::dataflow::NoopLattice & E, clang::dataflow::Environment & Env)

Methods

NoopAnalysis(clang::ASTContext& Context,
             bool ApplyBuiltinTransfer)

Description

Deprecated. Use the `DataflowAnalysisOptions` constructor instead.

Declared at: clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h:28

Parameters

clang::ASTContext& Context
bool ApplyBuiltinTransfer

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

Description

`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.

Declared at: clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h:36

Parameters

clang::ASTContext& Context
clang::dataflow::DataflowAnalysisOptions Options

static clang::dataflow::NoopLattice
initialElement()

Declared at: clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h:39

void transfer(const clang::Stmt* S,
              clang::dataflow::NoopLattice& E,
              clang::dataflow::Environment& Env)

Declared at: clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h:41

Parameters

const clang::Stmt* S
clang::dataflow::NoopLattice& E
clang::dataflow::Environment& Env