forked from OSchip/llvm-project
Remove UndefinedAssignmentChecker's header.
llvm-svn: 89585
This commit is contained in:
parent
15dd46215e
commit
f0b7fc8890
|
@ -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
|
|
||||||
|
|
|
@ -317,8 +317,6 @@ void GRExprEngine::RegisterInternalChecks() {
|
||||||
// their associated BugType will get registered with the BugReporter
|
// their associated BugType will get registered with the BugReporter
|
||||||
// automatically. Note that the check itself is owned by the GRExprEngine
|
// automatically. Note that the check itself is owned by the GRExprEngine
|
||||||
// object.
|
// object.
|
||||||
registerCheck(new UndefinedAssignmentChecker());
|
|
||||||
|
|
||||||
RegisterAttrNonNullChecker(*this);
|
RegisterAttrNonNullChecker(*this);
|
||||||
RegisterUndefinedArgChecker(*this);
|
RegisterUndefinedArgChecker(*this);
|
||||||
RegisterDereferenceChecker(*this);
|
RegisterDereferenceChecker(*this);
|
||||||
|
@ -327,4 +325,5 @@ void GRExprEngine::RegisterInternalChecks() {
|
||||||
RegisterReturnStackAddressChecker(*this);
|
RegisterReturnStackAddressChecker(*this);
|
||||||
RegisterReturnUndefChecker(*this);
|
RegisterReturnUndefChecker(*this);
|
||||||
RegisterUndefinedArraySubscriptChecker(*this);
|
RegisterUndefinedArraySubscriptChecker(*this);
|
||||||
|
RegisterUndefinedAssignmentChecker(*this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ void RegisterCastToStructChecker(GRExprEngine &Eng);
|
||||||
void RegisterUndefinedArgChecker(GRExprEngine &Eng);
|
void RegisterUndefinedArgChecker(GRExprEngine &Eng);
|
||||||
void RegisterArrayBoundChecker(GRExprEngine &Eng);
|
void RegisterArrayBoundChecker(GRExprEngine &Eng);
|
||||||
void RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng);
|
void RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng);
|
||||||
|
void RegisterUndefinedAssignmentChecker(GRExprEngine &Eng);
|
||||||
|
|
||||||
} // end clang namespace
|
} // end clang namespace
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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"
|
#include "clang/Analysis/PathSensitive/BugReporter.h"
|
||||||
|
|
||||||
using namespace clang;
|
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() {
|
void *UndefinedAssignmentChecker::getTag() {
|
||||||
static int x = 0;
|
static int x = 0;
|
||||||
return &x;
|
return &x;
|
||||||
|
|
Loading…
Reference in New Issue