[cfe-commits] r91509 - in /cfe/trunk/include/clang/Analysis/PathSensitive: CheckerVisitor.def CheckerVisitor.h

Ted Kremenek kremenek at apple.com
Tue Dec 15 21:52:20 PST 2009


Author: kremenek
Date: Tue Dec 15 23:52:19 2009
New Revision: 91509

URL: http://llvm.org/viewvc/llvm-project?rev=91509&view=rev
Log:
Teach CheckerVisitor about CXXOperatorCallExpr.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def
    cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def?rev=91509&r1=91508&r2=91509&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def Tue Dec 15 23:52:19 2009
@@ -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

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h?rev=91509&r1=91508&r2=91509&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h Tue Dec 15 23:52:19 2009
@@ -53,20 +53,20 @@
                                          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 @@
     }
   }
 
-#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"
 };
 





More information about the cfe-commits mailing list