aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/Support
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-17 20:48:37 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-17 20:48:37 +0000
commit86946745225096243f6969dc745267b78fc211a6 (patch)
treeb0a2b0cfa4a9c1198f7308bd9263c5de16493d37 /include/clang/Analysis/Support
parent7c453b3ded5dc9bff05e6e66eb725a0938303d73 (diff)
Modified the notion of "Block-level expressions" in CFGs to include Stmt*. This
is because GNU-style Statement-expressions cause the last statement in the statement-expression to act like an expression. We now have two notions: block-level statements and block-level expressions. The former are all Stmt* that appear in the list of statements in CFGBlocks. The latter is the subset of the former; these block-level statements are used as subexpressions somewhere in the AST. CFG::isBlockExpr() returns true for the latter, not the former (previously isBlockExpr() always returned true for non-Expr Stmt*). Modified the LiveVariables analysis to also track liveness state for block-level expressions (using the updated definition of block-level expressions). Modified the dataflow solver so that when it records values for block-level statements, it records the dataflow value *before* the transfer function for a Stmt* is evaluated (not after). This is more in sync in what clients will want. Modified CFGStmtVisitor to record the current block-level statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/Support')
-rw-r--r--include/clang/Analysis/Support/ExprDeclBitVector.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/clang/Analysis/Support/ExprDeclBitVector.h b/include/clang/Analysis/Support/ExprDeclBitVector.h
index 12b93f98e6..dc634df5ed 100644
--- a/include/clang/Analysis/Support/ExprDeclBitVector.h
+++ b/include/clang/Analysis/Support/ExprDeclBitVector.h
@@ -139,11 +139,11 @@ struct ExprDeclBitVector_Types {
void setCFG(CFG* c) { cfg = c; }
CFG& getCFG() { assert(cfg && "CFG should not be NULL."); return *cfg; }
- bool isTracked(const Expr* E) { return cfg->isBlkExpr(E); }
+ bool isTracked(const Stmt* S) { return cfg->isBlkExpr(S); }
using DeclBitVector_Types::AnalysisDataTy::isTracked;
- unsigned getIdx(const Expr* E) const {
- CFG::BlkExprNumTy I = cfg->getBlkExprNum(E);
+ unsigned getIdx(const Stmt* S) const {
+ CFG::BlkExprNumTy I = cfg->getBlkExprNum(S);
assert(I && "expression not tracked for bitvector.");
return I;
}
@@ -187,12 +187,12 @@ struct ExprDeclBitVector_Types {
}
llvm::BitVector::reference
- operator()(const Expr* E, const AnalysisDataTy& AD) {
- return ExprBV[AD.getIdx(E)];
+ operator()(const Stmt* S, const AnalysisDataTy& AD) {
+ return ExprBV[AD.getIdx(S)];
}
const llvm::BitVector::reference
- operator()(const Expr* E, const AnalysisDataTy& AD) const {
- return const_cast<ValTy&>(*this)(E,AD);
+ operator()(const Stmt* S, const AnalysisDataTy& AD) const {
+ return const_cast<ValTy&>(*this)(S,AD);
}
using DeclBitVector_Types::ValTy::operator();