summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-22 22:35:28 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-22 22:35:28 +0000
commitbfd28fd59671e9d04c8af78a4f829888b944dc72 (patch)
tree9530cd8328cda331764ff8b70a590eafa10a226a /clang/lib/Analysis/GRExprEngine.cpp
parent1164d1f283cd551e84fc70f3bfc57e7b8973c5f1 (diff)
downloadbcm5719-llvm-bfd28fd59671e9d04c8af78a4f829888b944dc72.tar.gz
bcm5719-llvm-bfd28fd59671e9d04c8af78a4f829888b944dc72.zip
Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.
Educate GRExprEngine::VisitGraph() about 'PreStmt'. Mark the constructor of 'PostStmt' to be explicit, preventing implicit conversions and the selection of the wrong 'generateNode' method in GRStmtNodeBuilder. Constify a bunch of arguments, which falls out of the changes to ProgramPoint. llvm-svn: 76809
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index 24e4cfaaa1d..eb31f84b0c4 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -89,7 +89,7 @@ public:
isSink |= (*I)->Audit(N, VMgr);
// Next handle the auditors that accept only specific statements.
- Stmt* S = cast<PostStmt>(N->getLocation()).getStmt();
+ const Stmt* S = cast<PostStmt>(N->getLocation()).getStmt();
void* key = reinterpret_cast<void*>((uintptr_t) S->getStmtClass());
MapTy::iterator MI = M.find(key);
if (MI != M.end()) {
@@ -3096,9 +3096,8 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
break;
default: {
- if (isa<PostStmt>(Loc)) {
- const PostStmt& L = cast<PostStmt>(Loc);
- Stmt* S = L.getStmt();
+ if (StmtPoint *L = dyn_cast<StmtPoint>(&Loc)) {
+ const Stmt* S = L->getStmt();
SourceLocation SLoc = S->getLocStart();
Out << S->getStmtClassName() << ' ' << (void*) S << ' ';
@@ -3113,7 +3112,9 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
<< "\\l";
}
- if (isa<PostLoad>(Loc))
+ if (isa<PreStmt>(Loc))
+ Out << "\\lPreStmt\\l;";
+ else if (isa<PostLoad>(Loc))
Out << "\\lPostLoad\\l;";
else if (isa<PostStore>(Loc))
Out << "\\lPostStore\\l";
OpenPOWER on IntegriCloud