forked from OSchip/llvm-project
rename UndefinedArgChecker to CallAndMessageChecker.
llvm-svn: 89735
This commit is contained in:
parent
da32375115
commit
72269ec8cb
|
@ -1,4 +1,4 @@
|
|||
//===--- UndefinedArgChecker.h - Undefined arguments checker ----*- C++ -*--==//
|
||||
//===--- CallAndMessageChecker.cpp ------------------------------*- C++ -*--==//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
@ -7,8 +7,8 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This defines BadCallChecker, a builtin check in GRExprEngine that performs
|
||||
// checks for undefined arguments.
|
||||
// This defines CallAndMessageChecker, a builtin checker that checks for various
|
||||
// errors of call and objc message expressions.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
@ -19,15 +19,15 @@
|
|||
using namespace clang;
|
||||
|
||||
namespace {
|
||||
class VISIBILITY_HIDDEN UndefinedArgChecker
|
||||
: public CheckerVisitor<UndefinedArgChecker> {
|
||||
class VISIBILITY_HIDDEN CallAndMessageChecker
|
||||
: public CheckerVisitor<CallAndMessageChecker> {
|
||||
BugType *BT_call_null;
|
||||
BugType *BT_call_undef;
|
||||
BugType *BT_call_arg;
|
||||
BugType *BT_msg_undef;
|
||||
BugType *BT_msg_arg;
|
||||
public:
|
||||
UndefinedArgChecker() :
|
||||
CallAndMessageChecker() :
|
||||
BT_call_null(0), BT_call_undef(0), BT_call_arg(0),
|
||||
BT_msg_undef(0), BT_msg_arg(0) {}
|
||||
static void *getTag() {
|
||||
|
@ -41,11 +41,11 @@ private:
|
|||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
void clang::RegisterUndefinedArgChecker(GRExprEngine &Eng) {
|
||||
Eng.registerCheck(new UndefinedArgChecker());
|
||||
void clang::RegisterCallAndMessageChecker(GRExprEngine &Eng) {
|
||||
Eng.registerCheck(new CallAndMessageChecker());
|
||||
}
|
||||
|
||||
void UndefinedArgChecker::EmitBadCall(BugType *BT, CheckerContext &C,
|
||||
void CallAndMessageChecker::EmitBadCall(BugType *BT, CheckerContext &C,
|
||||
const CallExpr *CE) {
|
||||
ExplodedNode *N = C.GenerateSink();
|
||||
if (!N)
|
||||
|
@ -57,7 +57,7 @@ void UndefinedArgChecker::EmitBadCall(BugType *BT, CheckerContext &C,
|
|||
C.EmitReport(R);
|
||||
}
|
||||
|
||||
void UndefinedArgChecker::PreVisitCallExpr(CheckerContext &C,
|
||||
void CallAndMessageChecker::PreVisitCallExpr(CheckerContext &C,
|
||||
const CallExpr *CE){
|
||||
|
||||
const Expr *Callee = CE->getCallee()->IgnoreParens();
|
||||
|
@ -97,7 +97,7 @@ void UndefinedArgChecker::PreVisitCallExpr(CheckerContext &C,
|
|||
}
|
||||
}
|
||||
|
||||
void UndefinedArgChecker::PreVisitObjCMessageExpr(CheckerContext &C,
|
||||
void CallAndMessageChecker::PreVisitObjCMessageExpr(CheckerContext &C,
|
||||
const ObjCMessageExpr *ME) {
|
||||
|
||||
const GRState *state = C.getState();
|
||||
|
|
|
@ -226,7 +226,7 @@ void GRExprEngine::RegisterInternalChecks() {
|
|||
// automatically. Note that the check itself is owned by the GRExprEngine
|
||||
// object.
|
||||
RegisterAttrNonNullChecker(*this);
|
||||
RegisterUndefinedArgChecker(*this);
|
||||
RegisterCallAndMessageChecker(*this);
|
||||
RegisterDereferenceChecker(*this);
|
||||
RegisterVLASizeChecker(*this);
|
||||
RegisterDivZeroChecker(*this);
|
||||
|
|
|
@ -30,7 +30,7 @@ void RegisterPointerSubChecker(GRExprEngine &Eng);
|
|||
void RegisterPointerArithChecker(GRExprEngine &Eng);
|
||||
void RegisterFixedAddressChecker(GRExprEngine &Eng);
|
||||
void RegisterCastToStructChecker(GRExprEngine &Eng);
|
||||
void RegisterUndefinedArgChecker(GRExprEngine &Eng);
|
||||
void RegisterCallAndMessageChecker(GRExprEngine &Eng);
|
||||
void RegisterArrayBoundChecker(GRExprEngine &Eng);
|
||||
void RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng);
|
||||
void RegisterUndefinedAssignmentChecker(GRExprEngine &Eng);
|
||||
|
|
Loading…
Reference in New Issue