[cfe-commits] r89585 - in /cfe/trunk: include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h lib/Analysis/GRExprEngineInternalChecks.cpp lib/Analysis/GRExprEngineInternalChecks.h lib/Analysis/UndefinedAssignmentChecker.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Sun Nov 22 04:29:53 PST 2009
Author: zhongxingxu
Date: Sun Nov 22 06:29:52 2009
New Revision: 89585
URL: http://llvm.org/viewvc/llvm-project?rev=89585&view=rev
Log:
Remove UndefinedAssignmentChecker's header.
Removed:
cfe/trunk/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h
Modified:
cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.h
cfe/trunk/lib/Analysis/UndefinedAssignmentChecker.cpp
Removed: cfe/trunk/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h?rev=89584&view=auto
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h (removed)
@@ -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
-
Modified: cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp?rev=89585&r1=89584&r2=89585&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp Sun Nov 22 06:29:52 2009
@@ -317,8 +317,6 @@
// 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 @@
RegisterReturnStackAddressChecker(*this);
RegisterReturnUndefChecker(*this);
RegisterUndefinedArraySubscriptChecker(*this);
+ RegisterUndefinedAssignmentChecker(*this);
}
Modified: cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.h?rev=89585&r1=89584&r2=89585&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.h (original)
+++ cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.h Sun Nov 22 06:29:52 2009
@@ -33,6 +33,7 @@
void RegisterUndefinedArgChecker(GRExprEngine &Eng);
void RegisterArrayBoundChecker(GRExprEngine &Eng);
void RegisterUndefinedArraySubscriptChecker(GRExprEngine &Eng);
+void RegisterUndefinedAssignmentChecker(GRExprEngine &Eng);
} // end clang namespace
#endif
Modified: cfe/trunk/lib/Analysis/UndefinedAssignmentChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/UndefinedAssignmentChecker.cpp?rev=89585&r1=89584&r2=89585&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/UndefinedAssignmentChecker.cpp (original)
+++ cfe/trunk/lib/Analysis/UndefinedAssignmentChecker.cpp Sun Nov 22 06:29:52 2009
@@ -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;
More information about the cfe-commits
mailing list