Remove UndefinedAssignmentChecker's header.

llvm-svn: 89585
This commit is contained in:
Zhongxing Xu 2009-11-22 12:29:52 +00:00
parent 15dd46215e
commit f0b7fc8890
4 changed files with 21 additions and 36 deletions

View File

@ -1,33 +0,0 @@
//===--- UndefinedAssignmentChecker.h ---------------------------*- C++ -*--==//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This defines UndefinedAssginmentChecker, a builtin check in GRExprEngine that
// checks for assigning undefined values.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_UNDEFASSIGNMENTCHECKER
#define LLVM_CLANG_UNDEFASSIGNMENTCHECKER
#include "clang/Analysis/PathSensitive/CheckerVisitor.h"
namespace clang {
class UndefinedAssignmentChecker
: public CheckerVisitor<UndefinedAssignmentChecker> {
BugType *BT;
public:
UndefinedAssignmentChecker() : BT(0) {}
static void *getTag();
virtual void PreVisitBind(CheckerContext &C, const Stmt *AssignE,
const Stmt *StoreE, SVal location,
SVal val);
};
}
#endif

View File

@ -317,8 +317,6 @@ void GRExprEngine::RegisterInternalChecks() {
// their associated BugType will get registered with the BugReporter
// automatically. Note that the check itself is owned by the GRExprEngine
// object.
registerCheck(new UndefinedAssignmentChecker());
RegisterAttrNonNullChecker(*this);
RegisterUndefinedArgChecker(*this);
RegisterDereferenceChecker(*this);
@ -327,4 +325,5 @@ void GRExprEngine::RegisterInternalChecks() {
RegisterReturnStackAddressChecker(*this);
RegisterReturnUndefChecker(*this);
RegisterUndefinedArraySubscriptChecker(*this);
RegisterUndefinedAssignmentChecker(*this);
}

View File

@ -33,6 +33,7 @@ void RegisterCastToStructChecker(GRExprEngine &Eng);
void RegisterUndefinedArgChecker(GRExprEngine &Eng);
void RegisterArrayBoundChecker(GRExprEngine &Eng);
void RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng);
void RegisterUndefinedAssignmentChecker(GRExprEngine &Eng);
} // end clang namespace
#endif

View File

@ -12,11 +12,29 @@
//
//===----------------------------------------------------------------------===//
#include "clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h"
#include "GRExprEngineInternalChecks.h"
#include "clang/Analysis/PathSensitive/CheckerVisitor.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
using namespace clang;
namespace {
class VISIBILITY_HIDDEN UndefinedAssignmentChecker
: public CheckerVisitor<UndefinedAssignmentChecker> {
BugType *BT;
public:
UndefinedAssignmentChecker() : BT(0) {}
static void *getTag();
virtual void PreVisitBind(CheckerContext &C, const Stmt *AssignE,
const Stmt *StoreE, SVal location,
SVal val);
};
}
void clang::RegisterUndefinedAssignmentChecker(GRExprEngine &Eng){
Eng.registerCheck(new UndefinedAssignmentChecker());
}
void *UndefinedAssignmentChecker::getTag() {
static int x = 0;
return &x;