13 #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIVEVARIABLES_H 14 #define LLVM_CLANG_ANALYSIS_ANALYSES_LIVEVARIABLES_H 18 #include "llvm/ADT/ImmutableSet.h" 40 : liveStmts(nullptr), liveDecls(nullptr), liveBindings(nullptr) {}
43 llvm::ImmutableSet<const VarDecl *> LiveDecls,
44 llvm::ImmutableSet<const BindingDecl *> LiveBindings)
45 : liveStmts(LiveStmts), liveDecls(LiveDecls),
46 liveBindings(LiveBindings) {}
55 virtual void anchor();
104 static const void *
getTag();
117 static const void *
getTag();
The base class of a hierarchy of objects representing analyses tied to AnalysisDeclContext.
static LiveVariables * computeLiveness(AnalysisDeclContext &analysisContext, bool killAtAssign)
Compute the liveness information for a given CFG.
Stmt - This represents one statement.
Represents a variable declaration or definition.
llvm::ImmutableSet< const BindingDecl * > liveBindings
bool equals(const LivenessValues &V) const
AnalysisDeclContext contains the context data for the function or method under analysis.
void runOnAllBlocks(Observer &obs)
~LiveVariables() override
static const void * getTag()
Represents a single basic block in a source-level CFG.
virtual void observerKill(const DeclRefExpr *DR)
Called when the live variables analysis registers that a variable is killed.
void dumpBlockLiveness(const SourceManager &M)
Print to stderr the variable liveness information associated with each basic block.
llvm::ImmutableSet< const VarDecl * > liveDecls
Dataflow Directional Tag Classes.
bool isLive(const Stmt *S) const
static LiveVariables * create(AnalysisDeclContext &analysisContext)
llvm::ImmutableSet< const Stmt * > liveStmts
virtual void observeStmt(const Stmt *S, const CFGBlock *currentBlock, const LivenessValues &V)
A callback invoked right before invoking the liveness transfer function on the given statement...
static LiveVariables * create(AnalysisDeclContext &analysisContext)
void dumpStmtLiveness(const SourceManager &M)
Print to stderr the statement liveness information associated with each basic block.
A reference to a declared variable, function, enum, etc.
This class handles loading and caching of source files into memory.
LivenessValues(llvm::ImmutableSet< const Stmt *> LiveStmts, llvm::ImmutableSet< const VarDecl *> LiveDecls, llvm::ImmutableSet< const BindingDecl *> LiveBindings)
friend class LiveVariables