Change CheckerVisitor so that [Pre,Post]VisitCallExpr only handles CallExprs for simple C functions, not

all CallExprs (including CXXMemberCallExpr, etc.).  Now the generic handler for all CallExprs is [Pre,Post]VisitGenericCallExpr.

Also add [Pre,Post]Visit hooks for CXXMemberCallExpr.

Change GRExprEngine::VisitCXXMemberCallExpr() to do pre/post checker visits of the call.

llvm-svn: 115119
This commit is contained in:
Ted Kremenek 2010-09-30 01:06:26 +00:00
parent 99219f16b9
commit e18dd0a84e
2 changed files with 13 additions and 4 deletions

View File

@ -21,8 +21,9 @@
PREVISIT(ArraySubscriptExpr, Stmt)
PREVISIT(BinaryOperator, Stmt)
PREVISIT(CallExpr, Stmt)
PREVISIT(CXXOperatorCallExpr, CallExpr)
PREVISIT(CallExpr, GenericCall)
PREVISIT(CXXOperatorCallExpr, GenericCall)
PREVISIT(CXXMemberCallExpr, GenericCall)
PREVISIT(DeclStmt, Stmt)
PREVISIT(ObjCAtSynchronizedStmt, Stmt)
PREVISIT(ObjCMessageExpr, Stmt)
@ -30,8 +31,9 @@ PREVISIT(ReturnStmt, Stmt)
POSTVISIT(BlockExpr, Stmt)
POSTVISIT(BinaryOperator, Stmt)
POSTVISIT(CallExpr, Stmt)
POSTVISIT(CXXOperatorCallExpr, CallExpr)
POSTVISIT(CallExpr, GenericCall)
POSTVISIT(CXXOperatorCallExpr, GenericCall)
POSTVISIT(CXXMemberCallExpr, GenericCall)
POSTVISIT(ObjCMessageExpr, Stmt)
#undef PREVISIT

View File

@ -79,6 +79,13 @@ break;
}
}
void PreVisitGenericCall(CheckerContext &C, const CallExpr *CE) {
static_cast<ImplClass*>(this)->PreVisitStmt(C, CE);
}
void PostVisitGenericCall(CheckerContext &C, const CallExpr *CE) {
static_cast<ImplClass*>(this)->PostVisitStmt(C, CE);
}
void PreVisitStmt(CheckerContext &C, const Stmt *S) {
*C.respondsToCallback = false;
}