зеркало из https://github.com/microsoft/clang-1.git
Teach CheckerVisitor about CXXOperatorCallExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91509 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
1c8008715b
Коммит
6b8ee78873
|
@ -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
|
||||
|
|
|
@ -53,7 +53,7 @@ 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;
|
||||
|
@ -66,7 +66,7 @@ break;
|
|||
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"
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче