class Environment::ValueModel

Declaration

class Environment::ValueModel { /* full declaration omitted */ };

Description

Supplements `Environment` with non-standard comparison and join operations.

Declared at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:60

Method Overview

  • public virtual bool compareEquivalent(clang::QualType Type, const clang::dataflow::Value & Val1, const clang::dataflow::Environment & Env1, const clang::dataflow::Value & Val2, const clang::dataflow::Environment & Env2)
  • public virtual bool merge(clang::QualType Type, const clang::dataflow::Value & Val1, const clang::dataflow::Environment & Env1, const clang::dataflow::Value & Val2, const clang::dataflow::Environment & Env2, clang::dataflow::Value & MergedVal, clang::dataflow::Environment & MergedEnv)
  • public virtual ~ValueModel()

Methods

virtual bool compareEquivalent(
    clang::QualType Type,
    const clang::dataflow::Value& Val1,
    const clang::dataflow::Environment& Env1,
    const clang::dataflow::Value& Val2,
    const clang::dataflow::Environment& Env2)

Description

Returns true if and only if `Val1` is equivalent to `Val2`. Requirements: `Val1` and `Val2` must be distinct. `Val1` and `Val2` must model values of type `Type`. `Val1` and `Val2` must be assigned to the same storage location in `Env1` and `Env2` respectively.

Declared at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:74

Parameters

clang::QualType Type
const clang::dataflow::Value& Val1
const clang::dataflow::Environment& Env1
const clang::dataflow::Value& Val2
const clang::dataflow::Environment& Env2

virtual bool merge(
    clang::QualType Type,
    const clang::dataflow::Value& Val1,
    const clang::dataflow::Environment& Env1,
    const clang::dataflow::Value& Val2,
    const clang::dataflow::Environment& Env2,
    clang::dataflow::Value& MergedVal,
    clang::dataflow::Environment& MergedEnv)

Description

Modifies `MergedVal` to approximate both `Val1` and `Val2`. This could be a strict lattice join or a more general widening operation. If this function returns true, `MergedVal` will be assigned to a storage location of type `Type` in `MergedEnv`. `Env1` and `Env2` can be used to query child values and path condition implications of `Val1` and `Val2` respectively. Requirements: `Val1` and `Val2` must be distinct. `Val1`, `Val2`, and `MergedVal` must model values of type `Type`. `Val1` and `Val2` must be assigned to the same storage location in `Env1` and `Env2` respectively.

Declared at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:103

Parameters

clang::QualType Type
const clang::dataflow::Value& Val1
const clang::dataflow::Environment& Env1
const clang::dataflow::Value& Val2
const clang::dataflow::Environment& Env2
clang::dataflow::Value& MergedVal
clang::dataflow::Environment& MergedEnv

virtual ~ValueModel()

Declared at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:62