]> granicus.if.org Git - clang/commitdiff
[analyzer] Remove unused checker stuff from AnalysisConsumer and some unused headers.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 28 Feb 2011 22:30:38 +0000 (22:30 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 28 Feb 2011 22:30:38 +0000 (22:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126690 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.h [deleted file]
lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
lib/StaticAnalyzer/Checkers/ExprEngine.cpp
lib/StaticAnalyzer/Checkers/InternalChecks.h [deleted file]
lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

index 7aff2010d84dcd833ddf7f8af60090466157b750..7a65c2e294c1776f0d75dea467468334083cf837 100644 (file)
@@ -13,8 +13,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "BasicObjCFoundationChecks.h"
-
 #include "ClangSACheckers.h"
 #include "clang/StaticAnalyzer/Core/CheckerV2.h"
 #include "clang/StaticAnalyzer/Core/CheckerManager.h"
@@ -24,7 +22,6 @@
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
-#include "clang/StaticAnalyzer/Checkers/LocalCheckers.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/Expr.h"
 #include "clang/AST/ExprObjC.h"
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.h b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.h
deleted file mode 100644 (file)
index 92cfb1a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//== BasicObjCFoundationChecks.h - Simple Apple-Foundation checks -*- C++ -*--//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file defines BasicObjCFoundationChecks, a class that encapsulates
-//  a set of simple checks to run on Objective-C code using Apple's Foundation
-//  classes.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_GR_BASICOBJCFOUNDATIONCHECKS
-#define LLVM_CLANG_GR_BASICOBJCFOUNDATIONCHECKS
-
-namespace clang {
-
-class ASTContext;
-class Decl;
-
-namespace ento {
-
-class BugReporter;
-class ExprEngine;
-
-void RegisterNSErrorChecks(BugReporter& BR, ExprEngine &Eng, const Decl &D);
-
-} // end GR namespace
-
-} // end clang namespace
-
-#endif
index 3b39372725a4d99d65428e0ea133aa30faa0582a..486abf5c691761522733c7e9d6d5c54b3a3b151c 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "ClangSACheckers.h"
 #include "clang/StaticAnalyzer/Core/CheckerV2.h"
-#include "clang/StaticAnalyzer/Checkers/LocalCheckers.h"
 #include "clang/Analysis/Analyses/LiveVariables.h"
 #include "clang/Analysis/Visitors/CFGRecStmtVisitor.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
index 552ca7d84a28b13a47525325a680335f824b5ae2..6dfbedc3bb95dbdf53522ba1dbacd6c58f3c95d6 100644 (file)
@@ -13,9 +13,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// FIXME: Restructure checker registration.
-#include "InternalChecks.h"
-
 #include "clang/StaticAnalyzer/Core/CheckerManager.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
diff --git a/lib/StaticAnalyzer/Checkers/InternalChecks.h b/lib/StaticAnalyzer/Checkers/InternalChecks.h
deleted file mode 100644 (file)
index 3dd04c3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-//=-- InternalChecks.h- Builtin ExprEngine Checks -------------------*- C++ -*-=
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file defines functions to instantiate and register the "built-in"
-//  checks in ExprEngine.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_GR_ExprEngine_INTERNAL_CHECKS
-#define LLVM_CLANG_GR_ExprEngine_INTERNAL_CHECKS
-
-namespace clang {
-
-namespace ento {
-
-class ExprEngine;
-
-// Foundational checks that handle basic semantics.
-void RegisterDereferenceChecker(ExprEngine &Eng);
-
-} // end GR namespace
-
-} // end clang namespace
-
-#endif
index 9e3adc804f67acd5a6b635bd2fb837bd1fec4aa1..387fe8e0599015a3103624a2ec83c8b247afc24f 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "ClangSACheckers.h"
 #include "clang/StaticAnalyzer/Core/CheckerV2.h"
-#include "clang/StaticAnalyzer/Checkers/LocalCheckers.h"
 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/StmtVisitor.h"
index 067475c3b44506ff7d4294c38c422d6cb131c193..a63e65a1e6343e42f320ce770d82faae3f976bb8 100644 (file)
@@ -17,8 +17,6 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/ParentMap.h"
-#include "clang/Analysis/Analyses/LiveVariables.h"
-#include "clang/Analysis/Analyses/UninitializedValues.h"
 #include "clang/Analysis/CFG.h"
 #include "clang/StaticAnalyzer/Frontend/CheckerRegistration.h"
 #include "clang/StaticAnalyzer/Core/CheckerManager.h"
@@ -30,9 +28,6 @@
 #include "clang/StaticAnalyzer/Core/PathSensitive/TransferFuncs.h"
 #include "clang/StaticAnalyzer/Core/PathDiagnosticClients.h"
 
-// FIXME: Restructure checker registration.
-#include "../Checkers/BasicObjCFoundationChecks.h"
-
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Frontend/AnalyzerOptions.h"
@@ -66,20 +61,6 @@ createPlistHTMLDiagnosticClient(const std::string& prefix,
 namespace {
 
 class AnalysisConsumer : public ASTConsumer {
-public:
-  typedef void (*CodeAction)(AnalysisConsumer &C, AnalysisManager &M, Decl *D);
-  typedef void (*TUAction)(AnalysisConsumer &C, AnalysisManager &M,
-                           TranslationUnitDecl &TU);
-
-private:
-  typedef std::vector<CodeAction> Actions;
-  typedef std::vector<TUAction> TUActions;
-
-  Actions FunctionActions;
-  Actions ObjCMethodActions;
-  Actions ObjCImplementationActions;
-  Actions CXXMethodActions;
-
 public:
   ASTContext* Ctx;
   const Preprocessor &PP;
@@ -160,16 +141,6 @@ public:
     }
   }
 
-  void addCodeAction(CodeAction action) {
-    FunctionActions.push_back(action);
-    ObjCMethodActions.push_back(action);
-    CXXMethodActions.push_back(action);
-  }
-
-  void addObjCImplementationAction(CodeAction action) {
-    ObjCImplementationActions.push_back(action);
-  }
-
   virtual void Initialize(ASTContext &Context) {
     Ctx = &Context;
     checkerMgr.reset(registerCheckers(Opts, PP.getLangOptions(),
@@ -191,7 +162,7 @@ public:
   virtual void HandleTranslationUnit(ASTContext &C);
   void HandleDeclContext(ASTContext &C, DeclContext *dc);
 
-  void HandleCode(Decl *D, Actions& actions);
+  void HandleCode(Decl *D);
 };
 } // end anonymous namespace
 
@@ -225,14 +196,14 @@ void AnalysisConsumer::HandleDeclContext(ASTContext &C, DeclContext *dc) {
               FD->getDeclName().getAsString() != Opts.AnalyzeSpecificFunction)
             break;
           DisplayFunction(FD);
-          HandleCode(FD, FunctionActions);
+          HandleCode(FD);
         }
         break;
       }
         
       case Decl::ObjCImplementation: {
         ObjCImplementationDecl* ID = cast<ObjCImplementationDecl>(*I);
-        HandleCode(ID, ObjCImplementationActions);
+        HandleCode(ID);
         
         for (ObjCImplementationDecl::method_iterator MI = ID->meth_begin(), 
              ME = ID->meth_end(); MI != ME; ++MI) {
@@ -243,7 +214,7 @@ void AnalysisConsumer::HandleDeclContext(ASTContext &C, DeclContext *dc) {
                 Opts.AnalyzeSpecificFunction != (*MI)->getSelector().getAsString())
               break;
             DisplayFunction(*MI);
-            HandleCode(*MI, ObjCMethodActions);
+            HandleCode(*MI);
           }
         }
         break;
@@ -281,7 +252,7 @@ static void FindBlocks(DeclContext *D, llvm::SmallVectorImpl<Decl*> &WL) {
 static void ActionObjCMemChecker(AnalysisConsumer &C, AnalysisManager& mgr,
                                  Decl *D);
 
-void AnalysisConsumer::HandleCode(Decl *D, Actions& actions) {
+void AnalysisConsumer::HandleCode(Decl *D) {
 
   // Don't run the actions if an error has occured with parsing the file.
   Diagnostic &Diags = PP.getDiagnostics();