clang 23.0.0git
clang::ento::EnvironmentEntry Class Reference

An entry in the environment consists of a Stmt and an LocationContext. More...

#include "clang/StaticAnalyzer/Core/PathSensitive/Environment.h"

Inheritance diagram for clang::ento::EnvironmentEntry:
[legend]

Public Member Functions

 EnvironmentEntry (const Stmt *s, const LocationContext *L)
const StmtgetStmt () const
const LocationContextgetLocationContext () const
void Profile (llvm::FoldingSetNodeID &ID) const

Static Public Member Functions

static void Profile (llvm::FoldingSetNodeID &ID, const EnvironmentEntry &E)
 Profile an EnvironmentEntry for inclusion in a FoldingSet.

Detailed Description

An entry in the environment consists of a Stmt and an LocationContext.

This allows the environment to manage context-sensitive bindings, which is essentially for modeling recursive function analysis, among other things. FIXME: Use 'Expr' instead of 'Stmt' because associating a result with a non-expression statement does not make sense. Currently the environment only containts 'Expr's; and there is only one easy-to-eliminate hack in 'processCallExit' and 'Environment::getSVal' that constructs and handles 'EnvironmentEntry' instances with a 'ReturnStmt' as the 'first' part.

Definition at line 40 of file Environment.h.

Constructor & Destructor Documentation

◆ EnvironmentEntry()

EnvironmentEntry::EnvironmentEntry ( const Stmt * s,
const LocationContext * L )

Definition at line 72 of file Environment.cpp.

References ignoreTransparentExprs(), and clang::nullptr.

Referenced by Profile().

Member Function Documentation

◆ getLocationContext()

const LocationContext * clang::ento::EnvironmentEntry::getLocationContext ( ) const
inline

◆ getStmt()

const Stmt * clang::ento::EnvironmentEntry::getStmt ( ) const
inline

◆ Profile() [1/2]

void clang::ento::EnvironmentEntry::Profile ( llvm::FoldingSetNodeID & ID) const
inline

Definition at line 55 of file Environment.h.

References Profile().

◆ Profile() [2/2]

void clang::ento::EnvironmentEntry::Profile ( llvm::FoldingSetNodeID & ID,
const EnvironmentEntry & E )
inlinestatic

Profile an EnvironmentEntry for inclusion in a FoldingSet.

Definition at line 49 of file Environment.h.

References EnvironmentEntry(), getLocationContext(), and getStmt().

Referenced by Profile().


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