]> granicus.if.org Git - clang/commitdiff
[analyzer] Refactoring: Move checkers into lib/GR/Checkers and their own library...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 22 Dec 2010 18:52:56 +0000 (18:52 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 22 Dec 2010 18:52:56 +0000 (18:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122422 91177308-0d34-0410-b5e6-96231b3b80d8

62 files changed:
examples/PrintFunctionNames/CMakeLists.txt
examples/clang-interpreter/CMakeLists.txt
examples/clang-interpreter/Makefile
examples/wpa/CMakeLists.txt
examples/wpa/Makefile
lib/FrontendTool/CMakeLists.txt
lib/GR/AnalysisConsumer.cpp
lib/GR/AnalyzerStatsChecker.cpp
lib/GR/CMakeLists.txt
lib/GR/Checkers/AdjustedReturnValueChecker.cpp [moved from lib/GR/AdjustedReturnValueChecker.cpp with 100% similarity]
lib/GR/Checkers/ArrayBoundChecker.cpp [moved from lib/GR/ArrayBoundChecker.cpp with 100% similarity]
lib/GR/Checkers/AttrNonNullChecker.cpp [moved from lib/GR/AttrNonNullChecker.cpp with 100% similarity]
lib/GR/Checkers/BasicObjCFoundationChecks.cpp [moved from lib/GR/BasicObjCFoundationChecks.cpp with 100% similarity]
lib/GR/Checkers/BasicObjCFoundationChecks.h [moved from lib/GR/BasicObjCFoundationChecks.h with 100% similarity]
lib/GR/Checkers/BuiltinFunctionChecker.cpp [moved from lib/GR/BuiltinFunctionChecker.cpp with 100% similarity]
lib/GR/Checkers/CMakeLists.txt [new file with mode: 0644]
lib/GR/Checkers/CStringChecker.cpp [moved from lib/GR/CStringChecker.cpp with 100% similarity]
lib/GR/Checkers/CallAndMessageChecker.cpp [moved from lib/GR/CallAndMessageChecker.cpp with 100% similarity]
lib/GR/Checkers/CastSizeChecker.cpp [moved from lib/GR/CastSizeChecker.cpp with 100% similarity]
lib/GR/Checkers/CastToStructChecker.cpp [moved from lib/GR/CastToStructChecker.cpp with 100% similarity]
lib/GR/Checkers/CheckDeadStores.cpp [moved from lib/GR/CheckDeadStores.cpp with 100% similarity]
lib/GR/Checkers/CheckObjCDealloc.cpp [moved from lib/GR/CheckObjCDealloc.cpp with 100% similarity]
lib/GR/Checkers/CheckObjCInstMethSignature.cpp [moved from lib/GR/CheckObjCInstMethSignature.cpp with 100% similarity]
lib/GR/Checkers/CheckSecuritySyntaxOnly.cpp [moved from lib/GR/CheckSecuritySyntaxOnly.cpp with 100% similarity]
lib/GR/Checkers/CheckSizeofPointer.cpp [moved from lib/GR/CheckSizeofPointer.cpp with 100% similarity]
lib/GR/Checkers/ChrootChecker.cpp [moved from lib/GR/ChrootChecker.cpp with 100% similarity]
lib/GR/Checkers/DereferenceChecker.cpp [moved from lib/GR/DereferenceChecker.cpp with 100% similarity]
lib/GR/Checkers/DivZeroChecker.cpp [moved from lib/GR/DivZeroChecker.cpp with 100% similarity]
lib/GR/Checkers/FixedAddressChecker.cpp [moved from lib/GR/FixedAddressChecker.cpp with 100% similarity]
lib/GR/Checkers/GRExprEngineExperimentalChecks.cpp [moved from lib/GR/GRExprEngineExperimentalChecks.cpp with 100% similarity]
lib/GR/Checkers/GRExprEngineExperimentalChecks.h [moved from lib/GR/GRExprEngineExperimentalChecks.h with 100% similarity]
lib/GR/Checkers/GRExprEngineInternalChecks.h [moved from lib/GR/GRExprEngineInternalChecks.h with 100% similarity]
lib/GR/Checkers/IdempotentOperationChecker.cpp [moved from lib/GR/IdempotentOperationChecker.cpp with 100% similarity]
lib/GR/Checkers/LLVMConventionsChecker.cpp [moved from lib/GR/LLVMConventionsChecker.cpp with 100% similarity]
lib/GR/Checkers/MacOSXAPIChecker.cpp [moved from lib/GR/MacOSXAPIChecker.cpp with 100% similarity]
lib/GR/Checkers/Makefile [new file with mode: 0644]
lib/GR/Checkers/MallocChecker.cpp [moved from lib/GR/MallocChecker.cpp with 100% similarity]
lib/GR/Checkers/NSAutoreleasePoolChecker.cpp [moved from lib/GR/NSAutoreleasePoolChecker.cpp with 100% similarity]
lib/GR/Checkers/NSErrorChecker.cpp [moved from lib/GR/NSErrorChecker.cpp with 100% similarity]
lib/GR/Checkers/NoReturnFunctionChecker.cpp [moved from lib/GR/NoReturnFunctionChecker.cpp with 100% similarity]
lib/GR/Checkers/OSAtomicChecker.cpp [moved from lib/GR/OSAtomicChecker.cpp with 100% similarity]
lib/GR/Checkers/ObjCAtSyncChecker.cpp [moved from lib/GR/ObjCAtSyncChecker.cpp with 100% similarity]
lib/GR/Checkers/ObjCUnusedIVarsChecker.cpp [moved from lib/GR/ObjCUnusedIVarsChecker.cpp with 100% similarity]
lib/GR/Checkers/PointerArithChecker.cpp [moved from lib/GR/PointerArithChecker.cpp with 100% similarity]
lib/GR/Checkers/PointerSubChecker.cpp [moved from lib/GR/PointerSubChecker.cpp with 100% similarity]
lib/GR/Checkers/PthreadLockChecker.cpp [moved from lib/GR/PthreadLockChecker.cpp with 100% similarity]
lib/GR/Checkers/ReturnPointerRangeChecker.cpp [moved from lib/GR/ReturnPointerRangeChecker.cpp with 100% similarity]
lib/GR/Checkers/ReturnUndefChecker.cpp [moved from lib/GR/ReturnUndefChecker.cpp with 100% similarity]
lib/GR/Checkers/StackAddrLeakChecker.cpp [moved from lib/GR/StackAddrLeakChecker.cpp with 100% similarity]
lib/GR/Checkers/StreamChecker.cpp [moved from lib/GR/StreamChecker.cpp with 100% similarity]
lib/GR/Checkers/UndefBranchChecker.cpp [moved from lib/GR/UndefBranchChecker.cpp with 100% similarity]
lib/GR/Checkers/UndefCapturedBlockVarChecker.cpp [moved from lib/GR/UndefCapturedBlockVarChecker.cpp with 100% similarity]
lib/GR/Checkers/UndefResultChecker.cpp [moved from lib/GR/UndefResultChecker.cpp with 100% similarity]
lib/GR/Checkers/UndefinedArraySubscriptChecker.cpp [moved from lib/GR/UndefinedArraySubscriptChecker.cpp with 100% similarity]
lib/GR/Checkers/UndefinedAssignmentChecker.cpp [moved from lib/GR/UndefinedAssignmentChecker.cpp with 100% similarity]
lib/GR/Checkers/UnixAPIChecker.cpp [moved from lib/GR/UnixAPIChecker.cpp with 100% similarity]
lib/GR/Checkers/UnreachableCodeChecker.cpp [moved from lib/GR/UnreachableCodeChecker.cpp with 100% similarity]
lib/GR/Checkers/VLASizeChecker.cpp [moved from lib/GR/VLASizeChecker.cpp with 100% similarity]
lib/GR/GRExprEngine.cpp
lib/GR/Makefile
tools/driver/CMakeLists.txt
tools/driver/Makefile

index ae5444207db56f4662b22b3f37a40f983b0dc80f..f16dd2b695b6bdec79b449d9625cd9027ba5e196 100644 (file)
@@ -10,6 +10,7 @@ set( LLVM_USED_LIBS
   clangCodeGen
   clangParse
   clangSema
+  clangGRCheckers
   clangGRCore
   clangAnalysis
   clangIndex
index 65786db18ef85fceefd91381861624f659a38cdd..8bdea4ca22356a7f542650756e46cdbd4d3b9dbf 100644 (file)
@@ -6,6 +6,7 @@ set(LLVM_USED_LIBS
     clangDriver
     clangCodeGen
     clangSema
+    clangGRCheckers
     clangGRCore
     clangIndex
     clangAnalysis
index 9b7662461e732da1ed91a878936581684fae14d9..6a690b0bf8bde708e70ce084c95d3787d8d1dd68 100644 (file)
@@ -18,7 +18,7 @@ TOOL_NO_EXPORTS = 1
 LINK_COMPONENTS := jit interpreter nativecodegen bitreader bitwriter ipo \
        selectiondag asmparser
 USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a clangCodeGen.a \
-           clangSema.a clangGRCore.a clangAnalysis.a clangRewrite.a \
+           clangSema.a clangGRCheckers.a clangGRCore.a clangAnalysis.a clangRewrite.a \
            clangAST.a clangParse.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
index 9dbc04473d8caf75e75a4b19583634c7e1110255..94719b2993e1d84cd4099eb4475eaf8bfce82806 100644 (file)
@@ -7,6 +7,7 @@ set(LLVM_USED_LIBS
   clangSema
   clangAnalysis
   clangSerialization
+  clangGRCheckers
   clangGRCore
   clangRewrite
   clangAST
index 9e875f31f5414b3023787a169e08c24150c04d85..f04fcb7e2d2077a00306031ba22c7fbfb2f43f5a 100644 (file)
@@ -16,7 +16,7 @@ NO_INSTALL = 1
 TOOL_NO_EXPORTS = 1
 
 LINK_COMPONENTS := asmparser bitreader mc core
-USEDLIBS = clangGRCore.a clangIndex.a clangFrontend.a clangDriver.a \
+USEDLIBS = clangGRCheckers.a clangGRCore.a clangIndex.a clangFrontend.a clangDriver.a \
           clangSema.a clangAnalysis.a clangSerialization.a \
            clangAST.a clangParse.a clangLex.a clangBasic.a
 
index cfd5fbda08d69683f452d329d0fa2f4199aae3b7..f4ace981464b455856cd493bf1348b8e0bec602c 100644 (file)
@@ -1,7 +1,7 @@
 set(LLVM_NO_RTTI 1)
 
 set(LLVM_USED_LIBS clangDriver clangFrontend clangRewrite clangCodeGen 
-    clangGRCore)
+    clangGRCheckers clangGRCore)
 
 add_clang_library(clangFrontendTool
   ExecuteCompilerInvocation.cpp
index 839ce044fd41ad795faf8a295b3b729663964109..850a44074278f43e3694e4ae83fe390f4d9d7977 100644 (file)
 #include "clang/GR/PathSensitive/GRExprEngine.h"
 #include "clang/GR/PathSensitive/GRTransferFuncs.h"
 #include "clang/GR/PathDiagnosticClients.h"
-#include "GRExprEngineExperimentalChecks.h"
-#include "GRExprEngineInternalChecks.h"
+
+// FIXME: Restructure checker registration.
+#include "Checkers/GRExprEngineExperimentalChecks.h"
+#include "Checkers/GRExprEngineInternalChecks.h"
+
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Frontend/AnalyzerOptions.h"
index 2a229cc7e9c1cd54de582ce1eb5b91dd421bb497..2aa1515bf37d90828637984d6727930d8a04439a 100644 (file)
 #include "clang/GR/PathSensitive/CheckerVisitor.h"
 #include "clang/GR/PathSensitive/ExplodedGraph.h"
 #include "clang/GR/BugReporter/BugReporter.h"
-#include "GRExprEngineExperimentalChecks.h"
+
+// FIXME: Restructure checker registration.
+#include "Checkers/GRExprEngineExperimentalChecks.h"
+
 #include "clang/Basic/SourceManager.h"
 #include "llvm/ADT/SmallPtrSet.h"
 
index ed59398d991515ebb16bd252d96872c9e76776f1..9cf7a3dcb2e0eb06d02c37e5d543251905ec24ee 100644 (file)
@@ -3,85 +3,41 @@ set(LLVM_NO_RTTI 1)
 set(LLVM_USED_LIBS clangBasic clangLex clangAST clangFrontend clangRewrite)
 
 add_clang_library(clangGRCore
-  AdjustedReturnValueChecker.cpp
   AggExprVisitor.cpp
   AnalysisConsumer.cpp
   AnalysisManager.cpp
   AnalyzerStatsChecker.cpp
-  ArrayBoundChecker.cpp
-  AttrNonNullChecker.cpp
   BasicConstraintManager.cpp
-  BasicObjCFoundationChecks.cpp
   BasicStore.cpp
   BasicValueFactory.cpp
   BugReporter.cpp
   BugReporterVisitors.cpp
-  BuiltinFunctionChecker.cpp
   CFRefCount.cpp
-  CStringChecker.cpp
-  CallAndMessageChecker.cpp
-  CastSizeChecker.cpp
-  CastToStructChecker.cpp
-  CheckDeadStores.cpp
-  CheckObjCDealloc.cpp
-  CheckObjCInstMethSignature.cpp
-  CheckSecuritySyntaxOnly.cpp
-  CheckSizeofPointer.cpp
   Checker.cpp
   CheckerHelpers.cpp
-  ChrootChecker.cpp
-  DereferenceChecker.cpp
-  DivZeroChecker.cpp
   Environment.cpp
   ExplodedGraph.cpp
-  FixedAddressChecker.cpp
   FlatStore.cpp
   FrontendActions.cpp
   GRBlockCounter.cpp
   GRCXXExprEngine.cpp
   GRCoreEngine.cpp
   GRExprEngine.cpp
-  GRExprEngineExperimentalChecks.cpp
   GRState.cpp
   HTMLDiagnostics.cpp
-  IdempotentOperationChecker.cpp
-  LLVMConventionsChecker.cpp
-  MacOSXAPIChecker.cpp
-  MallocChecker.cpp
   ManagerRegistry.cpp
   MemRegion.cpp
-  NSAutoreleasePoolChecker.cpp
-  NSErrorChecker.cpp
-  NoReturnFunctionChecker.cpp
-  OSAtomicChecker.cpp
-  ObjCAtSyncChecker.cpp
-  ObjCUnusedIVarsChecker.cpp
   PathDiagnostic.cpp
   PlistDiagnostics.cpp
-  PointerArithChecker.cpp
-  PointerSubChecker.cpp
-  PthreadLockChecker.cpp
   RangeConstraintManager.cpp
   RegionStore.cpp
-  ReturnPointerRangeChecker.cpp
-  ReturnUndefChecker.cpp
-  SValBuilder.cpp
-  SVals.cpp
   SimpleConstraintManager.cpp
   SimpleSValBuilder.cpp
-  StackAddrLeakChecker.cpp
   Store.cpp
-  StreamChecker.cpp
+  SValBuilder.cpp
+  SVals.cpp
   SymbolManager.cpp
   TextPathDiagnostics.cpp
-  UndefBranchChecker.cpp
-  UndefCapturedBlockVarChecker.cpp
-  UndefResultChecker.cpp
-  UndefinedArraySubscriptChecker.cpp
-  UndefinedAssignmentChecker.cpp
-  UnixAPIChecker.cpp
-  UnreachableCodeChecker.cpp
-  VLASizeChecker.cpp
   )
 
 add_dependencies(clangGRCore ClangAttrClasses ClangAttrList ClangDeclNodes
diff --git a/lib/GR/Checkers/CMakeLists.txt b/lib/GR/Checkers/CMakeLists.txt
new file mode 100644 (file)
index 0000000..700adb5
--- /dev/null
@@ -0,0 +1,49 @@
+add_clang_library(clangGRCheckers
+  AdjustedReturnValueChecker.cpp
+  ArrayBoundChecker.cpp
+  AttrNonNullChecker.cpp
+  BasicObjCFoundationChecks.cpp
+  BuiltinFunctionChecker.cpp
+  CallAndMessageChecker.cpp
+  CastSizeChecker.cpp
+  CastToStructChecker.cpp
+  CheckDeadStores.cpp
+  CheckObjCDealloc.cpp
+  CheckObjCInstMethSignature.cpp
+  CheckSecuritySyntaxOnly.cpp
+  CheckSizeofPointer.cpp
+  ChrootChecker.cpp
+  CStringChecker.cpp
+  DereferenceChecker.cpp
+  DivZeroChecker.cpp
+  FixedAddressChecker.cpp
+  GRExprEngineExperimentalChecks.cpp
+  IdempotentOperationChecker.cpp
+  LLVMConventionsChecker.cpp
+  MacOSXAPIChecker.cpp
+  MallocChecker.cpp
+  NSAutoreleasePoolChecker.cpp
+  NSErrorChecker.cpp
+  NoReturnFunctionChecker.cpp
+  OSAtomicChecker.cpp
+  ObjCAtSyncChecker.cpp
+  ObjCUnusedIVarsChecker.cpp
+  PointerArithChecker.cpp
+  PointerSubChecker.cpp
+  PthreadLockChecker.cpp
+  ReturnPointerRangeChecker.cpp
+  ReturnUndefChecker.cpp
+  StackAddrLeakChecker.cpp
+  StreamChecker.cpp
+  UndefBranchChecker.cpp
+  UndefCapturedBlockVarChecker.cpp
+  UndefResultChecker.cpp
+  UndefinedArraySubscriptChecker.cpp
+  UndefinedAssignmentChecker.cpp
+  UnixAPIChecker.cpp
+  UnreachableCodeChecker.cpp
+  VLASizeChecker.cpp
+  )
+
+add_dependencies(clangGRCore ClangAttrClasses ClangAttrList ClangDeclNodes
+                 ClangStmtNodes)
diff --git a/lib/GR/Checkers/Makefile b/lib/GR/Checkers/Makefile
new file mode 100644 (file)
index 0000000..b3d213a
--- /dev/null
@@ -0,0 +1,17 @@
+##===- clang/lib/Checker/Makefile --------------------------*- Makefile -*-===##
+# 
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+# 
+##===----------------------------------------------------------------------===##
+#
+# This implements analyses built on top of source-level CFGs. 
+#
+##===----------------------------------------------------------------------===##
+
+CLANG_LEVEL := ../../..
+LIBRARYNAME := clangGRCheckers
+
+include $(CLANG_LEVEL)/Makefile
index da3259299020c0b7c987227c09e40e7653ae3004..8743f71efe30372e5d4c383ecefabef1722607d9 100644 (file)
 //  functions and build the ExplodedGraph at the expression level.
 //
 //===----------------------------------------------------------------------===//
-#include "GRExprEngineInternalChecks.h"
+
+// FIXME: Restructure checker registration.
+#include "Checkers/GRExprEngineInternalChecks.h"
+
 #include "clang/GR/BugReporter/BugType.h"
 #include "clang/GR/PathSensitive/AnalysisManager.h"
 #include "clang/GR/PathSensitive/GRExprEngine.h"
index 71066effe4b18e6db64538bba49ac43f4931456b..3261983107e15647c5675ca159ba16df5b8ae26d 100644 (file)
@@ -13,6 +13,7 @@
 
 CLANG_LEVEL := ../..
 LIBRARYNAME := clangGRCore
+PARALLEL_DIRS := Checkers
 
 include $(CLANG_LEVEL)/Makefile
 
index 66dd512b446100da8fe79035134fdd7964a59f99..9c331a5b6dd7258adf7c4616a30e6c1fafed7dff 100644 (file)
@@ -8,6 +8,7 @@ set( LLVM_USED_LIBS
   clangCodeGen
   clangParse
   clangSema
+  clangGRCheckers
   clangGRCore
   clangAnalysis
   clangIndex
index 834e238b71b28da9e3bb51d62be76210448ed4ed..a98d715c2e21eadb25ec8c50297748768fb3d926 100644 (file)
@@ -39,7 +39,7 @@ LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
                    ipo selectiondag
 USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \
            clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \
-           clangGRCore.a clangAnalysis.a clangIndex.a clangRewrite.a \
+           clangGRCheckers.a clangGRCore.a clangAnalysis.a clangIndex.a clangRewrite.a \
            clangAST.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile