clang: include/clang/Analysis/Analyses/LiveVariables.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIVEVARIABLES_H
14#define LLVM_CLANG_ANALYSIS_ANALYSES_LIVEVARIABLES_H
15
18#include "llvm/ADT/ImmutableSet.h"
19
21
22class CFG;
23class CFGBlock;
24class Stmt;
25class DeclRefExpr;
26class SourceManager;
27
29public:
31 public:
32
33 llvm::ImmutableSet<const Expr *> liveExprs;
34 llvm::ImmutableSet<const VarDecl *> liveDecls;
36
38
41
43 llvm::ImmutableSet<const VarDecl *> LiveDecls,
44 llvm::ImmutableSet<const BindingDecl *> LiveBindings)
47
50
52 };
53
55 virtual void anchor();
56 public:
58
59
60
64
65
66
68 };
69
71
72
73 static std::unique_ptr
75
76
77
79
80
81
82
83
85
86
87
89
90
91
93
94
95
97
99
100 static std::unique_ptr
103 }
104
105 static const void *getTag();
106
107private:
109 void *impl;
110};
111
113public:
114 static std::unique_ptr
117 }
118
119 static const void *getTag();
120};
121
122}
123
124#endif
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Represents a single basic block in a source-level CFG.
A reference to a declared variable, function, enum, etc.
This represents one expression.
llvm::ImmutableSet< const BindingDecl * > liveBindings
LivenessValues(llvm::ImmutableSet< const Expr * > liveExprs, llvm::ImmutableSet< const VarDecl * > LiveDecls, llvm::ImmutableSet< const BindingDecl * > LiveBindings)
llvm::ImmutableSet< const Expr * > liveExprs
llvm::ImmutableSet< const VarDecl * > liveDecls
bool isLive(const Expr *E) const
bool equals(const LivenessValues &V) const
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.
virtual void observerKill(const DeclRefExpr *DR)
Called when the live variables analysis registers that a variable is killed.
static std::unique_ptr< LiveVariables > create(AnalysisDeclContext &analysisContext)
void dumpExprLiveness(const SourceManager &M)
Print to stderr the expression liveness information associated with each basic block.
void dumpBlockLiveness(const SourceManager &M)
Print to stderr the variable liveness information associated with each basic block.
void runOnAllBlocks(Observer &obs)
~LiveVariables() override
static const void * getTag()
bool isLive(const CFGBlock *B, const VarDecl *D)
Return true if a variable is live at the end of a specified block.
static std::unique_ptr< LiveVariables > computeLiveness(AnalysisDeclContext &analysisContext, bool killAtAssign)
Compute the liveness information for a given CFG.
The base class of a hierarchy of objects representing analyses tied to AnalysisDeclContext.
static std::unique_ptr< LiveVariables > create(AnalysisDeclContext &analysisContext)
static const void * getTag()
This class handles loading and caching of source files into memory.
Stmt - This represents one statement.
Represents a variable declaration or definition.
The JSON file list parser is used to communicate input to InstallAPI.