clang 20.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
clang::LiveVariables Class Reference

#include "clang/Analysis/Analyses/LiveVariables.h"

Inheritance diagram for clang::LiveVariables:
Inheritance graph
[legend]

Classes

class  LivenessValues
 
class  Observer
 

Public Member Functions

 ~LiveVariables () override
 
bool isLive (const CFGBlock *B, const VarDecl *D)
 Return true if a variable is live at the end of a specified block.
 
bool isLive (const Stmt *S, const VarDecl *D)
 Returns true if a variable is live at the beginning of the the statement.
 
bool isLive (const Stmt *Loc, const Expr *Val)
 Returns true the block-level expression value is live before the given block-level expression (see runOnAllBlocks).
 
void dumpBlockLiveness (const SourceManager &M)
 Print to stderr the variable liveness information associated with each basic block.
 
void dumpExprLiveness (const SourceManager &M)
 Print to stderr the expression liveness information associated with each basic block.
 
void runOnAllBlocks (Observer &obs)
 
- Public Member Functions inherited from clang::ManagedAnalysis
virtual ~ManagedAnalysis ()
 

Static Public Member Functions

static std::unique_ptr< LiveVariablescomputeLiveness (AnalysisDeclContext &analysisContext, bool killAtAssign)
 Compute the liveness information for a given CFG.
 
static std::unique_ptr< LiveVariablescreate (AnalysisDeclContext &analysisContext)
 
static const void * getTag ()
 

Additional Inherited Members

- Protected Member Functions inherited from clang::ManagedAnalysis
 ManagedAnalysis ()=default
 

Detailed Description

Definition at line 28 of file LiveVariables.h.

Constructor & Destructor Documentation

◆ ~LiveVariables()

LiveVariables::~LiveVariables ( )
override

Definition at line 554 of file LiveVariables.cpp.

Member Function Documentation

◆ computeLiveness()

std::unique_ptr< LiveVariables > LiveVariables::computeLiveness ( AnalysisDeclContext analysisContext,
bool  killAtAssign 
)
static

◆ create()

static std::unique_ptr< LiveVariables > clang::LiveVariables::create ( AnalysisDeclContext analysisContext)
inlinestatic

Definition at line 101 of file LiveVariables.h.

References computeLiveness().

◆ dumpBlockLiveness()

void LiveVariables::dumpBlockLiveness ( const SourceManager M)

Print to stderr the variable liveness information associated with each basic block.

Definition at line 614 of file LiveVariables.cpp.

References getImpl().

◆ dumpExprLiveness()

void LiveVariables::dumpExprLiveness ( const SourceManager M)

Print to stderr the expression liveness information associated with each basic block.

Definition at line 660 of file LiveVariables.cpp.

References getImpl().

◆ getTag()

const void * LiveVariables::getTag ( )
static

Definition at line 678 of file LiveVariables.cpp.

◆ isLive() [1/3]

bool LiveVariables::isLive ( const CFGBlock B,
const VarDecl D 
)

Return true if a variable is live at the end of a specified block.

Definition at line 141 of file LiveVariables.cpp.

References D, getImpl(), and isAlwaysAlive().

Referenced by clang::ento::SymbolReaper::isLive().

◆ isLive() [2/3]

bool LiveVariables::isLive ( const Stmt Loc,
const Expr Val 
)

Returns true the block-level expression value is live before the given block-level expression (see runOnAllBlocks).

Definition at line 149 of file LiveVariables.cpp.

References getImpl(), and Loc.

◆ isLive() [3/3]

bool LiveVariables::isLive ( const Stmt S,
const VarDecl D 
)

Returns true if a variable is live at the beginning of the the statement.

This query only works if liveness information has been recorded at the statement level (see runOnAllBlocks), and only returns liveness information for block-level expressions.

Definition at line 145 of file LiveVariables.cpp.

References D, getImpl(), and isAlwaysAlive().

◆ runOnAllBlocks()

void LiveVariables::runOnAllBlocks ( LiveVariables::Observer obs)

Definition at line 546 of file LiveVariables.cpp.

References clang::CFG::begin(), clang::CFG::end(), and getImpl().


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