aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-25 04:41:41 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-25 04:41:41 +0000
commit1309f9a3b225ea846e5822691c39a77423125505 (patch)
tree1ba6d1976da4f426292619af026dbf9d9314c573
parent3db9eb1fbe5771d3d64db01af46b4eee9aca8ed0 (diff)
Split libAnalysis into two libraries: libAnalysis and libChecker.
(1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/Analyses/UninitializedValues.h3
-rw-r--r--include/clang/Analysis/PathSensitive/AnalysisContext.h277
-rw-r--r--include/clang/Checker/LocalCheckers.h (renamed from include/clang/Analysis/LocalCheckers.h)3
-rw-r--r--include/clang/Checker/ManagerRegistry.h (renamed from include/clang/Analysis/ManagerRegistry.h)2
-rw-r--r--include/clang/Checker/PathDiagnostic.h (renamed from include/clang/Analysis/PathDiagnostic.h)0
-rw-r--r--include/clang/Checker/PathSensitive/AnalysisManager.h (renamed from include/clang/Analysis/PathSensitive/AnalysisManager.h)6
-rw-r--r--include/clang/Checker/PathSensitive/BasicValueFactory.h (renamed from include/clang/Analysis/PathSensitive/BasicValueFactory.h)4
-rw-r--r--include/clang/Checker/PathSensitive/BugReporter.h (renamed from include/clang/Analysis/PathSensitive/BugReporter.h)6
-rw-r--r--include/clang/Checker/PathSensitive/BugType.h (renamed from include/clang/Analysis/PathSensitive/BugType.h)2
-rw-r--r--include/clang/Checker/PathSensitive/Checker.h (renamed from include/clang/Analysis/PathSensitive/Checker.h)6
-rw-r--r--include/clang/Checker/PathSensitive/CheckerVisitor.def (renamed from include/clang/Analysis/PathSensitive/CheckerVisitor.def)0
-rw-r--r--include/clang/Checker/PathSensitive/CheckerVisitor.h (renamed from include/clang/Analysis/PathSensitive/CheckerVisitor.h)10
-rw-r--r--include/clang/Checker/PathSensitive/Checkers/DereferenceChecker.h (renamed from include/clang/Analysis/PathSensitive/Checkers/DereferenceChecker.h)0
-rw-r--r--include/clang/Checker/PathSensitive/ConstraintManager.h (renamed from include/clang/Analysis/PathSensitive/ConstraintManager.h)2
-rw-r--r--include/clang/Checker/PathSensitive/Environment.h (renamed from include/clang/Analysis/PathSensitive/Environment.h)4
-rw-r--r--include/clang/Checker/PathSensitive/ExplodedGraph.h (renamed from include/clang/Analysis/PathSensitive/ExplodedGraph.h)2
-rw-r--r--include/clang/Checker/PathSensitive/GRAuditor.h (renamed from include/clang/Analysis/PathSensitive/GRAuditor.h)0
-rw-r--r--include/clang/Checker/PathSensitive/GRBlockCounter.h (renamed from include/clang/Analysis/PathSensitive/GRBlockCounter.h)0
-rw-r--r--include/clang/Checker/PathSensitive/GRCoreEngine.h (renamed from include/clang/Analysis/PathSensitive/GRCoreEngine.h)10
-rw-r--r--include/clang/Checker/PathSensitive/GRExprEngine.h (renamed from include/clang/Analysis/PathSensitive/GRExprEngine.h)14
-rw-r--r--include/clang/Checker/PathSensitive/GRExprEngineBuilders.h (renamed from include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h)2
-rw-r--r--include/clang/Checker/PathSensitive/GRSimpleAPICheck.h (renamed from include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h)4
-rw-r--r--include/clang/Checker/PathSensitive/GRState.h (renamed from include/clang/Analysis/PathSensitive/GRState.h)10
-rw-r--r--include/clang/Checker/PathSensitive/GRStateTrait.h (renamed from include/clang/Analysis/PathSensitive/GRStateTrait.h)0
-rw-r--r--include/clang/Checker/PathSensitive/GRSubEngine.h (renamed from include/clang/Analysis/PathSensitive/GRSubEngine.h)2
-rw-r--r--include/clang/Checker/PathSensitive/GRTransferFuncs.h (renamed from include/clang/Analysis/PathSensitive/GRTransferFuncs.h)6
-rw-r--r--include/clang/Checker/PathSensitive/GRWorkList.h (renamed from include/clang/Analysis/PathSensitive/GRWorkList.h)2
-rw-r--r--include/clang/Checker/PathSensitive/MemRegion.h (renamed from include/clang/Analysis/PathSensitive/MemRegion.h)4
-rw-r--r--include/clang/Checker/PathSensitive/SVals.h (renamed from include/clang/Analysis/PathSensitive/SVals.h)2
-rw-r--r--include/clang/Checker/PathSensitive/SValuator.h (renamed from include/clang/Analysis/PathSensitive/SValuator.h)2
-rw-r--r--include/clang/Checker/PathSensitive/Store.h (renamed from include/clang/Analysis/PathSensitive/Store.h)6
-rw-r--r--include/clang/Checker/PathSensitive/SymbolManager.h (renamed from include/clang/Analysis/PathSensitive/SymbolManager.h)0
-rw-r--r--include/clang/Checker/PathSensitive/ValueManager.h (renamed from include/clang/Analysis/PathSensitive/ValueManager.h)10
-rw-r--r--lib/Analysis/AnalysisContext.cpp26
-rw-r--r--lib/Analysis/CMakeLists.txt58
-rw-r--r--lib/Analysis/LiveVariables.cpp2
-rw-r--r--lib/Analysis/UninitializedValues.cpp1
-rw-r--r--lib/CMakeLists.txt1
-rw-r--r--lib/Checker/ArrayBoundChecker.cpp (renamed from lib/Analysis/ArrayBoundChecker.cpp)6
-rw-r--r--lib/Checker/AttrNonNullChecker.cpp (renamed from lib/Analysis/AttrNonNullChecker.cpp)4
-rw-r--r--lib/Checker/BasicConstraintManager.cpp (renamed from lib/Analysis/BasicConstraintManager.cpp)6
-rw-r--r--lib/Checker/BasicObjCFoundationChecks.cpp (renamed from lib/Analysis/BasicObjCFoundationChecks.cpp)18
-rw-r--r--lib/Checker/BasicObjCFoundationChecks.h (renamed from lib/Analysis/BasicObjCFoundationChecks.h)0
-rw-r--r--lib/Checker/BasicStore.cpp (renamed from lib/Analysis/BasicStore.cpp)4
-rw-r--r--lib/Checker/BasicValueFactory.cpp (renamed from lib/Analysis/BasicValueFactory.cpp)2
-rw-r--r--lib/Checker/BugReporter.cpp (renamed from lib/Analysis/BugReporter.cpp)6
-rw-r--r--lib/Checker/BugReporterVisitors.cpp (renamed from lib/Analysis/BugReporterVisitors.cpp)6
-rw-r--r--lib/Checker/BuiltinFunctionChecker.cpp (renamed from lib/Analysis/BuiltinFunctionChecker.cpp)2
-rw-r--r--lib/Checker/CFRefCount.cpp (renamed from lib/Analysis/CFRefCount.cpp)18
-rw-r--r--lib/Checker/CMakeLists.txt62
-rw-r--r--lib/Checker/CallAndMessageChecker.cpp (renamed from lib/Analysis/CallAndMessageChecker.cpp)4
-rw-r--r--lib/Checker/CallInliner.cpp (renamed from lib/Analysis/CallInliner.cpp)6
-rw-r--r--lib/Checker/CastToStructChecker.cpp (renamed from lib/Analysis/CastToStructChecker.cpp)2
-rw-r--r--lib/Checker/CheckDeadStores.cpp (renamed from lib/Analysis/CheckDeadStores.cpp)6
-rw-r--r--lib/Checker/CheckObjCDealloc.cpp (renamed from lib/Analysis/CheckObjCDealloc.cpp)6
-rw-r--r--lib/Checker/CheckObjCInstMethSignature.cpp (renamed from lib/Analysis/CheckObjCInstMethSignature.cpp)6
-rw-r--r--lib/Checker/CheckObjCUnusedIVars.cpp (renamed from lib/Analysis/CheckObjCUnusedIVars.cpp)6
-rw-r--r--lib/Checker/CheckSecuritySyntaxOnly.cpp (renamed from lib/Analysis/CheckSecuritySyntaxOnly.cpp)4
-rw-r--r--lib/Checker/CheckSizeofPointer.cpp (renamed from lib/Analysis/CheckSizeofPointer.cpp)4
-rw-r--r--lib/Checker/Checker.cpp (renamed from lib/Analysis/Checker.cpp)2
-rw-r--r--lib/Checker/DereferenceChecker.cpp (renamed from lib/Analysis/DereferenceChecker.cpp)8
-rw-r--r--lib/Checker/DivZeroChecker.cpp (renamed from lib/Analysis/DivZeroChecker.cpp)2
-rw-r--r--lib/Checker/Environment.cpp (renamed from lib/Analysis/Environment.cpp)2
-rw-r--r--lib/Checker/ExplodedGraph.cpp (renamed from lib/Analysis/ExplodedGraph.cpp)4
-rw-r--r--lib/Checker/FixedAddressChecker.cpp (renamed from lib/Analysis/FixedAddressChecker.cpp)2
-rw-r--r--lib/Checker/GRBlockCounter.cpp (renamed from lib/Analysis/GRBlockCounter.cpp)2
-rw-r--r--lib/Checker/GRCoreEngine.cpp (renamed from lib/Analysis/GRCoreEngine.cpp)4
-rw-r--r--lib/Checker/GRExprEngine.cpp (renamed from lib/Analysis/GRExprEngine.cpp)6
-rw-r--r--lib/Checker/GRExprEngineExperimentalChecks.cpp (renamed from lib/Analysis/GRExprEngineExperimentalChecks.cpp)2
-rw-r--r--lib/Checker/GRExprEngineExperimentalChecks.h (renamed from lib/Analysis/GRExprEngineExperimentalChecks.h)0
-rw-r--r--lib/Checker/GRExprEngineInternalChecks.h (renamed from lib/Analysis/GRExprEngineInternalChecks.h)0
-rw-r--r--lib/Checker/GRState.cpp (renamed from lib/Analysis/GRState.cpp)6
-rw-r--r--lib/Checker/MallocChecker.cpp (renamed from lib/Analysis/MallocChecker.cpp)8
-rw-r--r--lib/Checker/ManagerRegistry.cpp (renamed from lib/Analysis/ManagerRegistry.cpp)2
-rw-r--r--lib/Checker/MemRegion.cpp (renamed from lib/Analysis/MemRegion.cpp)7
-rw-r--r--lib/Checker/NSAutoreleasePoolChecker.cpp (renamed from lib/Analysis/NSAutoreleasePoolChecker.cpp)6
-rw-r--r--lib/Checker/NSErrorChecker.cpp (renamed from lib/Analysis/NSErrorChecker.cpp)8
-rw-r--r--lib/Checker/NoReturnFunctionChecker.cpp (renamed from lib/Analysis/NoReturnFunctionChecker.cpp)2
-rw-r--r--lib/Checker/OSAtomicChecker.cpp (renamed from lib/Analysis/OSAtomicChecker.cpp)2
-rw-r--r--lib/Checker/PathDiagnostic.cpp (renamed from lib/Analysis/PathDiagnostic.cpp)2
-rw-r--r--lib/Checker/PointerArithChecker.cpp (renamed from lib/Analysis/PointerArithChecker.cpp)2
-rw-r--r--lib/Checker/PointerSubChecker.cpp (renamed from lib/Analysis/PointerSubChecker.cpp)2
-rw-r--r--lib/Checker/PthreadLockChecker.cpp (renamed from lib/Analysis/PthreadLockChecker.cpp)6
-rw-r--r--lib/Checker/RangeConstraintManager.cpp (renamed from lib/Analysis/RangeConstraintManager.cpp)8
-rw-r--r--lib/Checker/RegionStore.cpp (renamed from lib/Analysis/RegionStore.cpp)8
-rw-r--r--lib/Checker/ReturnPointerRangeChecker.cpp (renamed from lib/Analysis/ReturnPointerRangeChecker.cpp)6
-rw-r--r--lib/Checker/ReturnStackAddressChecker.cpp (renamed from lib/Analysis/ReturnStackAddressChecker.cpp)6
-rw-r--r--lib/Checker/ReturnUndefChecker.cpp (renamed from lib/Analysis/ReturnUndefChecker.cpp)6
-rw-r--r--lib/Checker/SVals.cpp (renamed from lib/Analysis/SVals.cpp)2
-rw-r--r--lib/Checker/SValuator.cpp (renamed from lib/Analysis/SValuator.cpp)4
-rw-r--r--lib/Checker/SimpleConstraintManager.cpp (renamed from lib/Analysis/SimpleConstraintManager.cpp)6
-rw-r--r--lib/Checker/SimpleConstraintManager.h (renamed from lib/Analysis/SimpleConstraintManager.h)4
-rw-r--r--lib/Checker/SimpleSValuator.cpp (renamed from lib/Analysis/SimpleSValuator.cpp)4
-rw-r--r--lib/Checker/Store.cpp (renamed from lib/Analysis/Store.cpp)4
-rw-r--r--lib/Checker/SymbolManager.cpp (renamed from lib/Analysis/SymbolManager.cpp)4
-rw-r--r--lib/Checker/UndefBranchChecker.cpp (renamed from lib/Analysis/UndefBranchChecker.cpp)2
-rw-r--r--lib/Checker/UndefResultChecker.cpp (renamed from lib/Analysis/UndefResultChecker.cpp)6
-rw-r--r--lib/Checker/UndefinedArraySubscriptChecker.cpp (renamed from lib/Analysis/UndefinedArraySubscriptChecker.cpp)4
-rw-r--r--lib/Checker/UndefinedAssignmentChecker.cpp (renamed from lib/Analysis/UndefinedAssignmentChecker.cpp)4
-rw-r--r--lib/Checker/VLASizeChecker.cpp (renamed from lib/Analysis/VLASizeChecker.cpp)6
-rw-r--r--lib/Checker/ValueManager.cpp (renamed from lib/Analysis/ValueManager.cpp)4
-rw-r--r--lib/Frontend/AnalysisConsumer.cpp15
-rw-r--r--lib/Frontend/HTMLDiagnostics.cpp2
-rw-r--r--lib/Frontend/PlistDiagnostics.cpp2
-rwxr-xr-xlib/Makefile2
-rw-r--r--lib/Sema/SemaChecking.cpp2
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--lib/Sema/SemaExpr.cpp2
-rw-r--r--tools/driver/CMakeLists.txt1
-rw-r--r--tools/driver/Makefile6
110 files changed, 292 insertions, 584 deletions
diff --git a/include/clang/Analysis/Analyses/UninitializedValues.h b/include/clang/Analysis/Analyses/UninitializedValues.h
index 2b367b7e37..cd771acb06 100644
--- a/include/clang/Analysis/Analyses/UninitializedValues.h
+++ b/include/clang/Analysis/Analyses/UninitializedValues.h
@@ -70,5 +70,8 @@ public:
void InitializeValues(const CFG& cfg);
};
+
+void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
+ bool FullUninitTaint=false);
} // end namespace clang
#endif
diff --git a/include/clang/Analysis/PathSensitive/AnalysisContext.h b/include/clang/Analysis/PathSensitive/AnalysisContext.h
deleted file mode 100644
index c82bb962fd..0000000000
--- a/include/clang/Analysis/PathSensitive/AnalysisContext.h
+++ /dev/null
@@ -1,277 +0,0 @@
-//=== AnalysisContext.h - Analysis context for Path Sens analysis --*- 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 AnalysisContext, a class that manages the analysis context
-// data for path sensitive analysis.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ANALYSIS_ANALYSISCO