[cfe-commits] r115119 - in /cfe/trunk/include/clang/Checker/PathSensitive: CheckerVisitor.def CheckerVisitor.h
Ted Kremenek
kremenek at apple.com
Wed Sep 29 18:06:26 PDT 2010
Author: kremenek
Date: Wed Sep 29 20:06:26 2010
New Revision: 115119
URL: http://llvm.org/viewvc/llvm-project?rev=115119&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def
cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.h
Modified: cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def?rev=115119&r1=115118&r2=115119&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.def Wed Sep 29 20:06:26 2010
@@ -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 @@
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
Modified: cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.h?rev=115119&r1=115118&r2=115119&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/CheckerVisitor.h Wed Sep 29 20:06:26 2010
@@ -79,6 +79,13 @@
}
}
+ 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;
}
More information about the cfe-commits
mailing list