aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/Analyses/LiveVariables.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-17 18:25:22 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-17 18:25:22 +0000
commit79649dfed2fc4b8cf0f7b6890df69458dbceeb04 (patch)
tree7b8066966f019d89c91463b937c25c069db1bdab /include/clang/Analysis/Analyses/LiveVariables.h
parenteed50586435ce4d2690f44ceabd69ad531d80970 (diff)
Added support to dataflow solver to (when requested) also record dataflow
values for the block-level expressions. Modified 'LiveVariables' to provide the option to clients to record liveness information for block-level expressions (using the above feature). Modified 'DeadStores' to conform to the new interface of 'LiveVariables'. Modified 'GRConstants' to compute liveness information for block-level expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/Analyses/LiveVariables.h')
-rw-r--r--include/clang/Analysis/Analyses/LiveVariables.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h
index 33516e78aa..9f536988a9 100644
--- a/include/clang/Analysis/Analyses/LiveVariables.h
+++ b/include/clang/Analysis/Analyses/LiveVariables.h
@@ -70,6 +70,12 @@ public:
/// IsLive - Return true if a variable is live at beginning of a
/// specified block.
bool isLive(const CFGBlock* B, const VarDecl* D) const;
+
+ /// IsLive - 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.
+ bool isLive(const Stmt* S, const VarDecl* D) const;
/// IsLive - Return true if a variable is live according to the
/// provided livness bitvector.
@@ -93,7 +99,13 @@ public:
void InitializeValues(const CFG& cfg);
void runOnCFG(CFG& cfg);
- void runOnAllBlocks(const CFG& cfg, ObserverTy& Obs);
+
+ /// runOnAllBlocks - Propagate the dataflow values once for each block,
+ /// starting from the current dataflow values. 'recordStmtValues' indicates
+ /// whether the method should store dataflow values per each individual
+ /// block-level expression.
+ void runOnAllBlocks(const CFG& cfg, ObserverTy* Obs,
+ bool recordStmtValues=false);
};
} // end namespace clang