Teach CheckerVisitor about CXXOperatorCallExpr.

llvm-svn: 91509
This commit is contained in:
Ted Kremenek 2009-12-16 05:52:19 +00:00
parent 0de851a4f2
commit 73aad9af2d
2 changed files with 28 additions and 19 deletions

View File

@ -12,24 +12,26 @@
//===---------------------------------------------------------------------===//
#ifndef PREVISIT
#define PREVISIT(NODE)
#define PREVISIT(NODE, FALLBACK)
#endif
#ifndef POSTVISIT
#define POSTVISIT(NODE)
#define POSTVISIT(NODE, FALLBACK)
#endif
PREVISIT(ArraySubscriptExpr)
PREVISIT(BinaryOperator)
PREVISIT(CallExpr)
PREVISIT(CastExpr)
PREVISIT(DeclStmt)
PREVISIT(ObjCMessageExpr)
PREVISIT(ReturnStmt)
PREVISIT(ArraySubscriptExpr, Stmt)
PREVISIT(BinaryOperator, Stmt)
PREVISIT(CallExpr, Stmt)
PREVISIT(CastExpr, Stmt)
PREVISIT(CXXOperatorCallExpr, CallExpr)
PREVISIT(DeclStmt, Stmt)
PREVISIT(ObjCMessageExpr, Stmt)
PREVISIT(ReturnStmt, Stmt)
POSTVISIT(CallExpr)
POSTVISIT(BlockExpr)
POSTVISIT(BinaryOperator)
POSTVISIT(CallExpr, Stmt)
POSTVISIT(CXXOperatorCallExpr, CallExpr)
POSTVISIT(BlockExpr, Stmt)
POSTVISIT(BinaryOperator, Stmt)
#undef PREVISIT
#undef POSTVISIT

View File

@ -53,20 +53,20 @@ public:
static_cast<const BinaryOperator*>(S));
break;
#define PREVISIT(NAME) \
#define PREVISIT(NAME, FALLBACK) \
case Stmt::NAME ## Class:\
static_cast<ImplClass*>(this)->PreVisit ## NAME(C,static_cast<const NAME*>(S));\
break;
#include "clang/Analysis/PathSensitive/CheckerVisitor.def"
}
}
void PostVisit(CheckerContext &C, const Stmt *S) {
switch (S->getStmtClass()) {
default:
assert(false && "Unsupport statement.");
return;
#define POSTVISIT(NAME) \
#define POSTVISIT(NAME, FALLBACK) \
case Stmt::NAME ## Class:\
static_cast<ImplClass*>(this)->\
PostVisit ## NAME(C,static_cast<const NAME*>(S));\
@ -75,12 +75,19 @@ break;
}
}
#define PREVISIT(NAME) \
void PreVisit ## NAME(CheckerContext &C, const NAME* S) {}
void PreVisitStmt(CheckerContext &C, const Stmt *S) {}
void PostVisitStmt(CheckerContext &C, const Stmt *S) {}
#define PREVISIT(NAME, FALLBACK) \
void PreVisit ## NAME(CheckerContext &C, const NAME* S) {\
PreVisit ## FALLBACK(C, S);\
}
#include "clang/Analysis/PathSensitive/CheckerVisitor.def"
#define POSTVISIT(NAME) \
void PostVisit ## NAME(CheckerContext &C, const NAME* S) {}
#define POSTVISIT(NAME, FALLBACK) \
void PostVisit ## NAME(CheckerContext &C, const NAME* S) {\
PostVisit ## FALLBACK(C, S);\
}
#include "clang/Analysis/PathSensitive/CheckerVisitor.def"
};