aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporterVisitors.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-08-06 01:32:16 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-08-06 01:32:16 +0000
commitc5619d901a68dc27a9e310a6a831f03efebcd950 (patch)
tree182ee9df6e543f6a7cbb063fccb62ba1c3548932 /lib/Analysis/BugReporterVisitors.cpp
parenta10f7eabea651c5ba71569e69143dd77008f2a56 (diff)
As GRState seems general enough, it is time to merge some template classes
and their impl base classes. This can greatly simply some code of the core analysis engine. This patch merges ExplodedNodeImpl into ExplodedNode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporterVisitors.cpp')
-rw-r--r--lib/Analysis/BugReporterVisitors.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Analysis/BugReporterVisitors.cpp b/lib/Analysis/BugReporterVisitors.cpp
index 2efa4c6857..77501bbba2 100644
--- a/lib/Analysis/BugReporterVisitors.cpp
+++ b/lib/Analysis/BugReporterVisitors.cpp
@@ -24,7 +24,7 @@ using namespace clang;
// Utility functions.
//===----------------------------------------------------------------------===//
-const Stmt *clang::bugreporter::GetDerefExpr(const ExplodedNode<GRState> *N) {
+const Stmt *clang::bugreporter::GetDerefExpr(const ExplodedNode *N) {
// Pattern match for a few useful cases (do something smarter later):
// a[0], p->f, *p
const Stmt *S = N->getLocationAs<PostStmt>()->getStmt();
@@ -46,7 +46,7 @@ const Stmt *clang::bugreporter::GetDerefExpr(const ExplodedNode<GRState> *N) {
}
const Stmt*
-clang::bugreporter::GetReceiverExpr(const ExplodedNode<GRState> *N){
+clang::bugreporter::GetReceiverExpr(const ExplodedNode *N){
const Stmt *S = N->getLocationAs<PostStmt>()->getStmt();
if (const ObjCMessageExpr *ME = dyn_cast<ObjCMessageExpr>(S))
return ME->getReceiver();
@@ -54,7 +54,7 @@ clang::bugreporter::GetReceiverExpr(const ExplodedNode<GRState> *N){
}
const Stmt*
-clang::bugreporter::GetDenomExpr(const ExplodedNode<GRState> *N) {
+clang::bugreporter::GetDenomExpr(const ExplodedNode *N) {
const Stmt *S = N->getLocationAs<PostStmt>()->getStmt();
if (const BinaryOperator *BE = dyn_cast<BinaryOperator>(S))
return BE->getRHS();
@@ -62,7 +62,7 @@ clang::bugreporter::GetDenomExpr(const ExplodedNode<GRState> *N) {
}
const Stmt*
-clang::bugreporter::GetCalleeExpr(const ExplodedNode<GRState> *N) {
+clang::bugreporter::GetCalleeExpr(const ExplodedNode *N) {
const Stmt *S = N->getLocationAs<PostStmt>()->getStmt();
if (const CallExpr *CE = dyn_cast<CallExpr>(S))
return CE->getCallee();
@@ -70,7 +70,7 @@ clang::bugreporter::GetCalleeExpr(const ExplodedNode<GRState> *N) {
}
const Stmt*
-clang::bugreporter::GetRetValExpr(const ExplodedNode<GRState> *N) {
+clang::bugreporter::GetRetValExpr(const ExplodedNode *N) {
const Stmt *S = N->getLocationAs<PostStmt>()->getStmt();
if (const ReturnStmt *RS = dyn_cast<ReturnStmt>(S))
return RS->getRetValue();
@@ -86,20 +86,20 @@ class VISIBILITY_HIDDEN FindLastStoreBRVisitor : public BugReporterVisitor {
const MemRegion *R;
SVal V;
bool satisfied;
- const ExplodedNode<GRState> *StoreSite;
+ const ExplodedNode *StoreSite;
public:
FindLastStoreBRVisitor(SVal v, const MemRegion *r)
: R(r), V(v), satisfied(false), StoreSite(0) {}
- PathDiagnosticPiece* VisitNode(const ExplodedNode<GRState> *N,
- const ExplodedNode<GRState> *PrevN,
+ PathDiagnosticPiece* VisitNode(const ExplodedNode *N,
+ const ExplodedNode *PrevN,
BugReporterContext& BRC) {
if (satisfied)
return NULL;
if (!StoreSite) {
- const ExplodedNode<GRState> *Node = N, *Last = NULL;
+ const ExplodedNode *Node = N, *Last = NULL;
for ( ; Node ; Last = Node, Node = Node->getFirstPred()) {
@@ -234,8 +234,8 @@ public:
TrackConstraintBRVisitor(SVal constraint, bool assumption)
: Constraint(constraint), Assumption(assumption), isSatisfied(false) {}
- PathDiagnosticPiece* VisitNode(const ExplodedNode<GRState> *N,
- const ExplodedNode<GRState> *PrevN,
+ PathDiagnosticPiece* VisitNode(const ExplodedNode *N,
+ const ExplodedNode *PrevN,
BugReporterContext& BRC) {
if (isSatisfied)
return NULL;
@@ -297,7 +297,7 @@ static void registerTrackConstraint(BugReporterContext& BRC, SVal Constraint,
void clang::bugreporter::registerTrackNullOrUndefValue(BugReporterContext& BRC,
const Stmt *S,
- const ExplodedNode<GRState>* N) {
+ const ExplodedNode* N) {
if (!S)
return;