From: Ted Kremenek Date: Mon, 25 Jan 2010 04:41:41 +0000 (+0000) Subject: Split libAnalysis into two libraries: libAnalysis and libChecker. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1309f9a3b225ea846e5822691c39a77423125505;p=clang 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 --- 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_ANALYSISCONTEXT_H -#define LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H - -#include "clang/AST/Decl.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/FoldingSet.h" -#include "llvm/ADT/PointerUnion.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/Support/Allocator.h" - -namespace clang { - -class Decl; -class Stmt; -class CFG; -class CFGBlock; -class LiveVariables; -class ParentMap; -class ImplicitParamDecl; -class LocationContextManager; -class BlockDataRegion; -class StackFrameContext; - -/// AnalysisContext contains the context data for the function or method under -/// analysis. -class AnalysisContext { - const Decl *D; - - // AnalysisContext owns the following data. - CFG *cfg; - LiveVariables *liveness; - ParentMap *PM; - llvm::DenseMap *ReferencedBlockVars; - llvm::BumpPtrAllocator A; - bool AddEHEdges; -public: - AnalysisContext(const Decl *d, bool addehedges = false) - : D(d), cfg(0), liveness(0), PM(0), ReferencedBlockVars(0), - AddEHEdges(addehedges) {} - - ~AnalysisContext(); - - ASTContext &getASTContext() { return D->getASTContext(); } - const Decl *getDecl() { return D; } - /// getAddEHEdges - Return true iff we are adding exceptional edges from - /// callExprs. If this is false, then try/catch statements and blocks - /// reachable from them can appear to be dead in the CFG, analysis passes must - /// cope with that. - bool getAddEHEdges() const { return AddEHEdges; } - Stmt *getBody(); - CFG *getCFG(); - ParentMap &getParentMap(); - LiveVariables *getLiveVariables(); - - typedef const VarDecl * const * referenced_decls_iterator; - - std::pair - getReferencedBlockVars(const BlockDecl *BD); - - /// Return the ImplicitParamDecl* associated with 'self' if this - /// AnalysisContext wraps an ObjCMethodDecl. Returns NULL otherwise. - const ImplicitParamDecl *getSelfDecl() const; -}; - -class AnalysisContextManager { - typedef llvm::DenseMap ContextMap; - ContextMap Contexts; -public: - ~AnalysisContextManager(); - - AnalysisContext *getContext(const Decl *D); - - // Discard all previously created AnalysisContexts. - void clear(); -}; - -class LocationContext : public llvm::FoldingSetNode { -public: - enum ContextKind { StackFrame, Scope, Block }; - -private: - ContextKind Kind; - AnalysisContext *Ctx; - const LocationContext *Parent; - -protected: - LocationContext(ContextKind k, AnalysisContext *ctx, - const LocationContext *parent) - : Kind(k), Ctx(ctx), Parent(parent) {} - -public: - virtual ~LocationContext(); - - ContextKind getKind() const { return Kind; } - - AnalysisContext *getAnalysisContext() const { return Ctx; } - - const LocationContext *getParent() const { return Parent; } - - const Decl *getDecl() const { return getAnalysisContext()->getDecl(); } - - CFG *getCFG() const { return getAnalysisContext()->getCFG(); } - - LiveVariables *getLiveVariables() const { - return getAnalysisContext()->getLiveVariables(); - } - - ParentMap &getParentMap() const { - return getAnalysisContext()->getParentMap(); - } - - const ImplicitParamDecl *getSelfDecl() const { - return Ctx->getSelfDecl(); - } - - const StackFrameContext *getCurrentStackFrame() const; - const StackFrameContext * - getStackFrameForDeclContext(const DeclContext *DC) const; - - virtual void Profile(llvm::FoldingSetNodeID &ID) = 0; - - static bool classof(const LocationContext*) { return true; } - -public: - static void ProfileCommon(llvm::FoldingSetNodeID &ID, - ContextKind ck, - AnalysisContext *ctx, - const LocationContext *parent, - const void* data); -}; - -class StackFrameContext : public LocationContext { - // The callsite where this stack frame is established. - const Stmt *CallSite; - - // The parent block of the callsite. - const CFGBlock *Block; - - // The index of the callsite in the CFGBlock. - unsigned Index; - - friend class LocationContextManager; - StackFrameContext(AnalysisContext *ctx, const LocationContext *parent, - const Stmt *s, const CFGBlock *blk, unsigned idx) - : LocationContext(StackFrame, ctx, parent), CallSite(s), Block(blk), - Index(idx) {} - -public: - ~StackFrameContext() {} - - const Stmt *getCallSite() const { return CallSite; } - - const CFGBlock *getCallSiteBlock() const { return Block; } - - unsigned getIndex() const { return Index; } - - void Profile(llvm::FoldingSetNodeID &ID); - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx, - const LocationContext *parent, const Stmt *s, - const CFGBlock *blk, unsigned idx) { - ProfileCommon(ID, StackFrame, ctx, parent, s); - ID.AddPointer(blk); - ID.AddInteger(idx); - } - - static bool classof(const LocationContext* Ctx) { - return Ctx->getKind() == StackFrame; - } -}; - -class ScopeContext : public LocationContext { - const Stmt *Enter; - - friend class LocationContextManager; - ScopeContext(AnalysisContext *ctx, const LocationContext *parent, - const Stmt *s) - : LocationContext(Scope, ctx, parent), Enter(s) {} - -public: - ~ScopeContext() {} - - void Profile(llvm::FoldingSetNodeID &ID); - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx, - const LocationContext *parent, const Stmt *s) { - ProfileCommon(ID, Scope, ctx, parent, s); - } - - static bool classof(const LocationContext* Ctx) { - return Ctx->getKind() == Scope; - } -}; - -class BlockInvocationContext : public LocationContext { - llvm::PointerUnion Data; - - friend class LocationContextManager; - - BlockInvocationContext(AnalysisContext *ctx, const LocationContext *parent, - const BlockDataRegion *br) - : LocationContext(Block, ctx, parent), Data(br) {} - - BlockInvocationContext(AnalysisContext *ctx, const LocationContext *parent, - const BlockDecl *bd) - : LocationContext(Block, ctx, parent), Data(bd) {} - -public: - ~BlockInvocationContext() {} - - const BlockDataRegion *getBlockRegion() const { - return Data.is() ? - Data.get() : 0; - } - - const BlockDecl *getBlockDecl() const; - - void Profile(llvm::FoldingSetNodeID &ID); - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx, - const LocationContext *parent, const BlockDataRegion *br){ - ProfileCommon(ID, Block, ctx, parent, br); - } - - static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx, - const LocationContext *parent, const BlockDecl *bd) { - ProfileCommon(ID, Block, ctx, parent, bd); - } - - static bool classof(const LocationContext* Ctx) { - return Ctx->getKind() == Block; - } -}; - -class LocationContextManager { - llvm::FoldingSet Contexts; -public: - ~LocationContextManager(); - - const StackFrameContext *getStackFrame(AnalysisContext *ctx, - const LocationContext *parent, - const Stmt *s, const CFGBlock *blk, - unsigned idx); - - const ScopeContext *getScope(AnalysisContext *ctx, - const LocationContext *parent, - const Stmt *s); - - const BlockInvocationContext * - getBlockInvocation(AnalysisContext *ctx, const LocationContext *parent, - const BlockDataRegion *BR); - - /// Discard all previously created LocationContext objects. - void clear(); -private: - template - const LOC *getLocationContext(AnalysisContext *ctx, - const LocationContext *parent, - const DATA *d); -}; - -} // end clang namespace -#endif diff --git a/include/clang/Analysis/LocalCheckers.h b/include/clang/Checker/LocalCheckers.h similarity index 93% rename from include/clang/Analysis/LocalCheckers.h rename to include/clang/Checker/LocalCheckers.h index 9c343e0786..b179c8eb6c 100644 --- a/include/clang/Analysis/LocalCheckers.h +++ b/include/clang/Checker/LocalCheckers.h @@ -35,9 +35,6 @@ class GRExprEngine; void CheckDeadStores(CFG &cfg, LiveVariables &L, ParentMap &map, BugReporter& BR); -void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags, - bool FullUninitTaint=false); - GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled, const LangOptions& lopts); diff --git a/include/clang/Analysis/ManagerRegistry.h b/include/clang/Checker/ManagerRegistry.h similarity index 97% rename from include/clang/Analysis/ManagerRegistry.h rename to include/clang/Checker/ManagerRegistry.h index 972993855c..ebfd28e109 100644 --- a/include/clang/Analysis/ManagerRegistry.h +++ b/include/clang/Checker/ManagerRegistry.h @@ -14,7 +14,7 @@ #ifndef LLVM_CLANG_ANALYSIS_MANAGER_REGISTRY_H #define LLVM_CLANG_ANALYSIS_MANAGER_REGISTRY_H -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRState.h" namespace clang { diff --git a/include/clang/Analysis/PathDiagnostic.h b/include/clang/Checker/PathDiagnostic.h similarity index 100% rename from include/clang/Analysis/PathDiagnostic.h rename to include/clang/Checker/PathDiagnostic.h diff --git a/include/clang/Analysis/PathSensitive/AnalysisManager.h b/include/clang/Checker/PathSensitive/AnalysisManager.h similarity index 96% rename from include/clang/Analysis/PathSensitive/AnalysisManager.h rename to include/clang/Checker/PathSensitive/AnalysisManager.h index 8288864f2b..f9bd7aec05 100644 --- a/include/clang/Analysis/PathSensitive/AnalysisManager.h +++ b/include/clang/Checker/PathSensitive/AnalysisManager.h @@ -15,9 +15,9 @@ #ifndef LLVM_CLANG_ANALYSIS_ANALYSISMANAGER_H #define LLVM_CLANG_ANALYSIS_ANALYSISMANAGER_H -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" -#include "clang/Analysis/PathDiagnostic.h" +#include "clang/Analysis/AnalysisContext.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathDiagnostic.h" namespace clang { diff --git a/include/clang/Analysis/PathSensitive/BasicValueFactory.h b/include/clang/Checker/PathSensitive/BasicValueFactory.h similarity index 98% rename from include/clang/Analysis/PathSensitive/BasicValueFactory.h rename to include/clang/Checker/PathSensitive/BasicValueFactory.h index 12f0ce2d50..1717c268d3 100644 --- a/include/clang/Analysis/PathSensitive/BasicValueFactory.h +++ b/include/clang/Checker/PathSensitive/BasicValueFactory.h @@ -16,8 +16,8 @@ #ifndef LLVM_CLANG_ANALYSIS_BASICVALUEFACTORY_H #define LLVM_CLANG_ANALYSIS_BASICVALUEFACTORY_H -#include "clang/Analysis/PathSensitive/SymbolManager.h" -#include "clang/Analysis/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/SVals.h" #include "clang/AST/ASTContext.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/APSInt.h" diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Checker/PathSensitive/BugReporter.h similarity index 98% rename from include/clang/Analysis/PathSensitive/BugReporter.h rename to include/clang/Checker/PathSensitive/BugReporter.h index 6f6681a362..2e88d8efad 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Checker/PathSensitive/BugReporter.h @@ -17,9 +17,9 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Basic/SourceLocation.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/ExplodedGraph.h" -#include "clang/Analysis/PathSensitive/BugType.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/ExplodedGraph.h" +#include "clang/Checker/PathSensitive/BugType.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallString.h" diff --git a/include/clang/Analysis/PathSensitive/BugType.h b/include/clang/Checker/PathSensitive/BugType.h similarity index 97% rename from include/clang/Analysis/PathSensitive/BugType.h rename to include/clang/Checker/PathSensitive/BugType.h index b75a8189e5..db7a99f0e7 100644 --- a/include/clang/Analysis/PathSensitive/BugType.h +++ b/include/clang/Checker/PathSensitive/BugType.h @@ -14,7 +14,7 @@ #ifndef LLVM_CLANG_ANALYSIS_BUGTYPE #define LLVM_CLANG_ANALYSIS_BUGTYPE -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include #include diff --git a/include/clang/Analysis/PathSensitive/Checker.h b/include/clang/Checker/PathSensitive/Checker.h similarity index 98% rename from include/clang/Analysis/PathSensitive/Checker.h rename to include/clang/Checker/PathSensitive/Checker.h index 924a8b11b0..d498044b82 100644 --- a/include/clang/Analysis/PathSensitive/Checker.h +++ b/include/clang/Checker/PathSensitive/Checker.h @@ -15,9 +15,9 @@ #ifndef LLVM_CLANG_ANALYSIS_CHECKER #define LLVM_CLANG_ANALYSIS_CHECKER #include "clang/Analysis/Support/SaveAndRestore.h" -#include "clang/Analysis/PathSensitive/GRCoreEngine.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRCoreEngine.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/StmtCXX.h" diff --git a/include/clang/Analysis/PathSensitive/CheckerVisitor.def b/include/clang/Checker/PathSensitive/CheckerVisitor.def similarity index 100% rename from include/clang/Analysis/PathSensitive/CheckerVisitor.def rename to include/clang/Checker/PathSensitive/CheckerVisitor.def diff --git a/include/clang/Analysis/PathSensitive/CheckerVisitor.h b/include/clang/Checker/PathSensitive/CheckerVisitor.h similarity index 91% rename from include/clang/Analysis/PathSensitive/CheckerVisitor.h rename to include/clang/Checker/PathSensitive/CheckerVisitor.h index 37ec8def50..913a6c75bc 100644 --- a/include/clang/Analysis/PathSensitive/CheckerVisitor.h +++ b/include/clang/Checker/PathSensitive/CheckerVisitor.h @@ -13,7 +13,7 @@ #ifndef LLVM_CLANG_ANALYSIS_CHECKERVISITOR #define LLVM_CLANG_ANALYSIS_CHECKERVISITOR -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/Checker.h" namespace clang { @@ -57,7 +57,7 @@ public: case Stmt::NAME ## Class:\ static_cast(this)->PreVisit ## NAME(C,static_cast(S));\ break; -#include "clang/Analysis/PathSensitive/CheckerVisitor.def" +#include "clang/Checker/PathSensitive/CheckerVisitor.def" } } @@ -76,7 +76,7 @@ case Stmt::NAME ## Class:\ static_cast(this)->\ PostVisit ## NAME(C,static_cast(S));\ break; -#include "clang/Analysis/PathSensitive/CheckerVisitor.def" +#include "clang/Checker/PathSensitive/CheckerVisitor.def" } } @@ -87,13 +87,13 @@ break; void PreVisit ## NAME(CheckerContext &C, const NAME* S) {\ PreVisit ## FALLBACK(C, S);\ } -#include "clang/Analysis/PathSensitive/CheckerVisitor.def" +#include "clang/Checker/PathSensitive/CheckerVisitor.def" #define POSTVISIT(NAME, FALLBACK) \ void PostVisit ## NAME(CheckerContext &C, const NAME* S) {\ PostVisit ## FALLBACK(C, S);\ } -#include "clang/Analysis/PathSensitive/CheckerVisitor.def" +#include "clang/Checker/PathSensitive/CheckerVisitor.def" }; } // end clang namespace diff --git a/include/clang/Analysis/PathSensitive/Checkers/DereferenceChecker.h b/include/clang/Checker/PathSensitive/Checkers/DereferenceChecker.h similarity index 100% rename from include/clang/Analysis/PathSensitive/Checkers/DereferenceChecker.h rename to include/clang/Checker/PathSensitive/Checkers/DereferenceChecker.h diff --git a/include/clang/Analysis/PathSensitive/ConstraintManager.h b/include/clang/Checker/PathSensitive/ConstraintManager.h similarity index 98% rename from include/clang/Analysis/PathSensitive/ConstraintManager.h rename to include/clang/Checker/PathSensitive/ConstraintManager.h index c8292802ae..ce7d1b3817 100644 --- a/include/clang/Analysis/PathSensitive/ConstraintManager.h +++ b/include/clang/Checker/PathSensitive/ConstraintManager.h @@ -15,7 +15,7 @@ #define LLVM_CLANG_ANALYSIS_CONSTRAINT_MANAGER_H // FIXME: Typedef LiveSymbolsTy/DeadSymbolsTy at a more appropriate place. -#include "clang/Analysis/PathSensitive/Store.h" +#include "clang/Checker/PathSensitive/Store.h" namespace llvm { class APSInt; diff --git a/include/clang/Analysis/PathSensitive/Environment.h b/include/clang/Checker/PathSensitive/Environment.h similarity index 96% rename from include/clang/Analysis/PathSensitive/Environment.h rename to include/clang/Checker/PathSensitive/Environment.h index 6d5c5678e5..0852c31fae 100644 --- a/include/clang/Analysis/PathSensitive/Environment.h +++ b/include/clang/Checker/PathSensitive/Environment.h @@ -16,11 +16,11 @@ // For using typedefs in StoreManager. Should find a better place for these // typedefs. -#include "clang/Analysis/PathSensitive/Store.h" +#include "clang/Checker/PathSensitive/Store.h" #include "llvm/ADT/ImmutableMap.h" #include "llvm/ADT/SmallVector.h" -#include "clang/Analysis/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/SVals.h" #include "llvm/Support/Allocator.h" #include "llvm/ADT/FoldingSet.h" diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Checker/PathSensitive/ExplodedGraph.h similarity index 99% rename from include/clang/Analysis/PathSensitive/ExplodedGraph.h rename to include/clang/Checker/PathSensitive/ExplodedGraph.h index fb5e1b8a41..d6c4436c59 100644 --- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h +++ b/include/clang/Checker/PathSensitive/ExplodedGraph.h @@ -16,7 +16,7 @@ #define LLVM_CLANG_ANALYSIS_EXPLODEDGRAPH #include "clang/Analysis/ProgramPoint.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Analysis/AnalysisContext.h" #include "clang/AST/Decl.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/FoldingSet.h" diff --git a/include/clang/Analysis/PathSensitive/GRAuditor.h b/include/clang/Checker/PathSensitive/GRAuditor.h similarity index 100% rename from include/clang/Analysis/PathSensitive/GRAuditor.h rename to include/clang/Checker/PathSensitive/GRAuditor.h diff --git a/include/clang/Analysis/PathSensitive/GRBlockCounter.h b/include/clang/Checker/PathSensitive/GRBlockCounter.h similarity index 100% rename from include/clang/Analysis/PathSensitive/GRBlockCounter.h rename to include/clang/Checker/PathSensitive/GRBlockCounter.h diff --git a/include/clang/Analysis/PathSensitive/GRCoreEngine.h b/include/clang/Checker/PathSensitive/GRCoreEngine.h similarity index 97% rename from include/clang/Analysis/PathSensitive/GRCoreEngine.h rename to include/clang/Checker/PathSensitive/GRCoreEngine.h index 74f7a147b8..6da45815f9 100644 --- a/include/clang/Analysis/PathSensitive/GRCoreEngine.h +++ b/include/clang/Checker/PathSensitive/GRCoreEngine.h @@ -16,11 +16,11 @@ #define LLVM_CLANG_ANALYSIS_GRENGINE #include "clang/AST/Expr.h" -#include "clang/Analysis/PathSensitive/ExplodedGraph.h" -#include "clang/Analysis/PathSensitive/GRWorkList.h" -#include "clang/Analysis/PathSensitive/GRBlockCounter.h" -#include "clang/Analysis/PathSensitive/GRAuditor.h" -#include "clang/Analysis/PathSensitive/GRSubEngine.h" +#include "clang/Checker/PathSensitive/ExplodedGraph.h" +#include "clang/Checker/PathSensitive/GRWorkList.h" +#include "clang/Checker/PathSensitive/GRBlockCounter.h" +#include "clang/Checker/PathSensitive/GRAuditor.h" +#include "clang/Checker/PathSensitive/GRSubEngine.h" #include "llvm/ADT/OwningPtr.h" namespace clang { diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Checker/PathSensitive/GRExprEngine.h similarity index 97% rename from include/clang/Analysis/PathSensitive/GRExprEngine.h rename to include/clang/Checker/PathSensitive/GRExprEngine.h index df90ad9f7f..693d7cdb4f 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngine.h +++ b/include/clang/Checker/PathSensitive/GRExprEngine.h @@ -16,13 +16,13 @@ #ifndef LLVM_CLANG_ANALYSIS_GREXPRENGINE #define LLVM_CLANG_ANALYSIS_GREXPRENGINE -#include "clang/Analysis/PathSensitive/AnalysisManager.h" -#include "clang/Analysis/PathSensitive/GRSubEngine.h" -#include "clang/Analysis/PathSensitive/GRCoreEngine.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRSimpleAPICheck.h" -#include "clang/Analysis/PathSensitive/GRTransferFuncs.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/AnalysisManager.h" +#include "clang/Checker/PathSensitive/GRSubEngine.h" +#include "clang/Checker/PathSensitive/GRCoreEngine.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRSimpleAPICheck.h" +#include "clang/Checker/PathSensitive/GRTransferFuncs.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "clang/AST/Type.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/ExprCXX.h" diff --git a/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h b/include/clang/Checker/PathSensitive/GRExprEngineBuilders.h similarity index 97% rename from include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h rename to include/clang/Checker/PathSensitive/GRExprEngineBuilders.h index 60db406cd1..5503412f7e 100644 --- a/include/clang/Analysis/PathSensitive/GRExprEngineBuilders.h +++ b/include/clang/Checker/PathSensitive/GRExprEngineBuilders.h @@ -14,7 +14,7 @@ #ifndef LLVM_CLANG_ANALYSIS_GREXPRENGINE_BUILDERS #define LLVM_CLANG_ANALYSIS_GREXPRENGINE_BUILDERS -#include "clang/Analysis/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" #include "clang/Analysis/Support/SaveAndRestore.h" namespace clang { diff --git a/include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h b/include/clang/Checker/PathSensitive/GRSimpleAPICheck.h similarity index 90% rename from include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h rename to include/clang/Checker/PathSensitive/GRSimpleAPICheck.h index 978ff0889e..383463b822 100644 --- a/include/clang/Analysis/PathSensitive/GRSimpleAPICheck.h +++ b/include/clang/Checker/PathSensitive/GRSimpleAPICheck.h @@ -16,8 +16,8 @@ #ifndef LLVM_CLANG_ANALYSIS_GRAPICHECKS #define LLVM_CLANG_ANALYSIS_GRAPICHECKS -#include "clang/Analysis/PathSensitive/GRAuditor.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRAuditor.h" +#include "clang/Checker/PathSensitive/GRState.h" namespace clang { diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Checker/PathSensitive/GRState.h similarity index 98% rename from include/clang/Analysis/PathSensitive/GRState.h rename to include/clang/Checker/PathSensitive/GRState.h index 11cdac0e96..947db6e46c 100644 --- a/include/clang/Analysis/PathSensitive/GRState.h +++ b/include/clang/Checker/PathSensitive/GRState.h @@ -16,11 +16,11 @@ // FIXME: Reduce the number of includes. -#include "clang/Analysis/PathSensitive/Environment.h" -#include "clang/Analysis/PathSensitive/Store.h" -#include "clang/Analysis/PathSensitive/ConstraintManager.h" -#include "clang/Analysis/PathSensitive/ValueManager.h" -#include "clang/Analysis/PathSensitive/GRCoreEngine.h" +#include "clang/Checker/PathSensitive/Environment.h" +#include "clang/Checker/PathSensitive/Store.h" +#include "clang/Checker/PathSensitive/ConstraintManager.h" +#include "clang/Checker/PathSensitive/ValueManager.h" +#include "clang/Checker/PathSensitive/GRCoreEngine.h" #include "clang/AST/Expr.h" #include "clang/AST/Decl.h" #include "clang/AST/ASTContext.h" diff --git a/include/clang/Analysis/PathSensitive/GRStateTrait.h b/include/clang/Checker/PathSensitive/GRStateTrait.h similarity index 100% rename from include/clang/Analysis/PathSensitive/GRStateTrait.h rename to include/clang/Checker/PathSensitive/GRStateTrait.h diff --git a/include/clang/Analysis/PathSensitive/GRSubEngine.h b/include/clang/Checker/PathSensitive/GRSubEngine.h similarity index 98% rename from include/clang/Analysis/PathSensitive/GRSubEngine.h rename to include/clang/Checker/PathSensitive/GRSubEngine.h index 5b383fae9b..ce57c2c68b 100644 --- a/include/clang/Analysis/PathSensitive/GRSubEngine.h +++ b/include/clang/Checker/PathSensitive/GRSubEngine.h @@ -13,7 +13,7 @@ #ifndef LLVM_CLANG_ANALYSIS_GRSUBENGINE_H #define LLVM_CLANG_ANALYSIS_GRSUBENGINE_H -#include "clang/Analysis/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/SVals.h" namespace clang { diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Checker/PathSensitive/GRTransferFuncs.h similarity index 94% rename from include/clang/Analysis/PathSensitive/GRTransferFuncs.h rename to include/clang/Checker/PathSensitive/GRTransferFuncs.h index b058460a49..04634effd5 100644 --- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h +++ b/include/clang/Checker/PathSensitive/GRTransferFuncs.h @@ -15,9 +15,9 @@ #ifndef LLVM_CLANG_ANALYSIS_GRTF #define LLVM_CLANG_ANALYSIS_GRTF -#include "clang/Analysis/PathSensitive/SVals.h" -#include "clang/Analysis/PathSensitive/GRCoreEngine.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/GRCoreEngine.h" +#include "clang/Checker/PathSensitive/GRState.h" #include namespace clang { diff --git a/include/clang/Analysis/PathSensitive/GRWorkList.h b/include/clang/Checker/PathSensitive/GRWorkList.h similarity index 97% rename from include/clang/Analysis/PathSensitive/GRWorkList.h rename to include/clang/Checker/PathSensitive/GRWorkList.h index 857fa31691..b8f90fa1ee 100644 --- a/include/clang/Analysis/PathSensitive/GRWorkList.h +++ b/include/clang/Checker/PathSensitive/GRWorkList.h @@ -15,7 +15,7 @@ #ifndef LLVM_CLANG_ANALYSIS_GRWORKLIST #define LLVM_CLANG_ANALYSIS_GRWORKLIST -#include "clang/Analysis/PathSensitive/GRBlockCounter.h" +#include "clang/Checker/PathSensitive/GRBlockCounter.h" #include namespace clang { diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Checker/PathSensitive/MemRegion.h similarity index 99% rename from include/clang/Analysis/PathSensitive/MemRegion.h rename to include/clang/Checker/PathSensitive/MemRegion.h index 3bcedbefd6..e1b21b16e2 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Checker/PathSensitive/MemRegion.h @@ -18,8 +18,8 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" -#include "clang/Analysis/PathSensitive/SymbolManager.h" -#include "clang/Analysis/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/SVals.h" #include "clang/AST/ASTContext.h" #include "llvm/Support/Casting.h" #include "llvm/ADT/FoldingSet.h" diff --git a/include/clang/Analysis/PathSensitive/SVals.h b/include/clang/Checker/PathSensitive/SVals.h similarity index 99% rename from include/clang/Analysis/PathSensitive/SVals.h rename to include/clang/Checker/PathSensitive/SVals.h index 9206817989..e04f8dc999 100644 --- a/include/clang/Analysis/PathSensitive/SVals.h +++ b/include/clang/Checker/PathSensitive/SVals.h @@ -15,7 +15,7 @@ #ifndef LLVM_CLANG_ANALYSIS_RVALUE_H #define LLVM_CLANG_ANALYSIS_RVALUE_H -#include "clang/Analysis/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" #include "llvm/Support/Casting.h" #include "llvm/ADT/ImmutableList.h" diff --git a/include/clang/Analysis/PathSensitive/SValuator.h b/include/clang/Checker/PathSensitive/SValuator.h similarity index 98% rename from include/clang/Analysis/PathSensitive/SValuator.h rename to include/clang/Checker/PathSensitive/SValuator.h index 4a4b502c62..74abe67912 100644 --- a/include/clang/Analysis/PathSensitive/SValuator.h +++ b/include/clang/Checker/PathSensitive/SValuator.h @@ -16,7 +16,7 @@ #define LLVM_CLANG_ANALYSIS_SVALUATOR #include "clang/AST/Expr.h" -#include "clang/Analysis/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/SVals.h" namespace clang { diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Checker/PathSensitive/Store.h similarity index 98% rename from include/clang/Analysis/PathSensitive/Store.h rename to include/clang/Checker/PathSensitive/Store.h index 5606df0014..7966fed5fb 100644 --- a/include/clang/Analysis/PathSensitive/Store.h +++ b/include/clang/Checker/PathSensitive/Store.h @@ -14,9 +14,9 @@ #ifndef LLVM_CLANG_ANALYSIS_STORE_H #define LLVM_CLANG_ANALYSIS_STORE_H -#include "clang/Analysis/PathSensitive/MemRegion.h" -#include "clang/Analysis/PathSensitive/SVals.h" -#include "clang/Analysis/PathSensitive/ValueManager.h" +#include "clang/Checker/PathSensitive/MemRegion.h" +#include "clang/Checker/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/ValueManager.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" diff --git a/include/clang/Analysis/PathSensitive/SymbolManager.h b/include/clang/Checker/PathSensitive/SymbolManager.h similarity index 100% rename from include/clang/Analysis/PathSensitive/SymbolManager.h rename to include/clang/Checker/PathSensitive/SymbolManager.h diff --git a/include/clang/Analysis/PathSensitive/ValueManager.h b/include/clang/Checker/PathSensitive/ValueManager.h similarity index 96% rename from include/clang/Analysis/PathSensitive/ValueManager.h rename to include/clang/Checker/PathSensitive/ValueManager.h index 9cec3c421f..0141cefb01 100644 --- a/include/clang/Analysis/PathSensitive/ValueManager.h +++ b/include/clang/Checker/PathSensitive/ValueManager.h @@ -17,11 +17,11 @@ #define LLVM_CLANG_ANALYSIS_AGGREGATE_VALUE_MANAGER_H #include "llvm/ADT/OwningPtr.h" -#include "clang/Analysis/PathSensitive/MemRegion.h" -#include "clang/Analysis/PathSensitive/SVals.h" -#include "clang/Analysis/PathSensitive/BasicValueFactory.h" -#include "clang/Analysis/PathSensitive/SymbolManager.h" -#include "clang/Analysis/PathSensitive/SValuator.h" +#include "clang/Checker/PathSensitive/MemRegion.h" +#include "clang/Checker/PathSensitive/SVals.h" +#include "clang/Checker/PathSensitive/BasicValueFactory.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/SValuator.h" namespace llvm { class BumpPtrAllocator; } diff --git a/lib/Analysis/AnalysisContext.cpp b/lib/Analysis/AnalysisContext.cpp index ad9f6dd194..0c64610bea 100644 --- a/lib/Analysis/AnalysisContext.cpp +++ b/lib/Analysis/AnalysisContext.cpp @@ -12,10 +12,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/AnalysisContext.h" -#include "clang/Analysis/PathSensitive/MemRegion.h" -#include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/CFG.h" +#include "clang/Analysis/AnalysisContext.h" +#include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" @@ -87,12 +86,6 @@ AnalysisContext *AnalysisContextManager::getContext(const Decl *D) { return AC; } -const BlockDecl *BlockInvocationContext::getBlockDecl() const { - return Data.is() ? - Data.get()->getDecl() - : Data.get(); -} - //===----------------------------------------------------------------------===// // FoldingSet profiling. //===----------------------------------------------------------------------===// @@ -117,11 +110,7 @@ void ScopeContext::Profile(llvm::FoldingSetNodeID &ID) { } void BlockInvocationContext::Profile(llvm::FoldingSetNodeID &ID) { - if (const BlockDataRegion *BR = getBlockRegion()) - Profile(ID, getAnalysisContext(), getParent(), BR); - else - Profile(ID, getAnalysisContext(), getParent(), - Data.get()); + Profile(ID, getAnalysisContext(), getParent(), BD); } //===----------------------------------------------------------------------===// @@ -170,15 +159,6 @@ LocationContextManager::getScope(AnalysisContext *ctx, return getLocationContext(ctx, parent, s); } -const BlockInvocationContext * -LocationContextManager::getBlockInvocation(AnalysisContext *ctx, - const LocationContext *parent, - const BlockDataRegion *BR) { - return getLocationContext(ctx, - parent, - BR); -} - //===----------------------------------------------------------------------===// // LocationContext methods. //===----------------------------------------------------------------------===// diff --git a/lib/Analysis/CMakeLists.txt b/lib/Analysis/CMakeLists.txt index 521f1be6ec..0cadca5dc5 100644 --- a/lib/Analysis/CMakeLists.txt +++ b/lib/Analysis/CMakeLists.txt @@ -2,67 +2,9 @@ set(LLVM_NO_RTTI 1) add_clang_library(clangAnalysis AnalysisContext.cpp - ArrayBoundChecker.cpp - AttrNonNullChecker.cpp - BasicConstraintManager.cpp - BasicObjCFoundationChecks.cpp - BasicStore.cpp - BasicValueFactory.cpp - BugReporter.cpp - BugReporterVisitors.cpp - BuiltinFunctionChecker.cpp CFG.cpp - CFRefCount.cpp - CallAndMessageChecker.cpp - CallInliner.cpp - CastToStructChecker.cpp - CheckDeadStores.cpp - CheckObjCDealloc.cpp - CheckObjCInstMethSignature.cpp - CheckObjCUnusedIVars.cpp - CheckSecuritySyntaxOnly.cpp - CheckSizeofPointer.cpp - Checker.cpp - DereferenceChecker.cpp - DivZeroChecker.cpp - Environment.cpp - ExplodedGraph.cpp - FixedAddressChecker.cpp - GRBlockCounter.cpp - GRCoreEngine.cpp - GRExprEngine.cpp - GRExprEngineExperimentalChecks.cpp - GRState.cpp LiveVariables.cpp - MallocChecker.cpp - ManagerRegistry.cpp - MemRegion.cpp - NoReturnFunctionChecker.cpp - NSAutoreleasePoolChecker.cpp - NSErrorChecker.cpp - OSAtomicChecker.cpp - PathDiagnostic.cpp - PointerArithChecker.cpp - PointerSubChecker.cpp - PthreadLockChecker.cpp - RangeConstraintManager.cpp - RegionStore.cpp - ReturnPointerRangeChecker.cpp - ReturnStackAddressChecker.cpp - ReturnUndefChecker.cpp - SVals.cpp - SValuator.cpp - SimpleConstraintManager.cpp - SimpleSValuator.cpp - Store.cpp - SymbolManager.cpp - UndefBranchChecker.cpp - UndefResultChecker.cpp - UndefinedArraySubscriptChecker.cpp - UndefinedAssignmentChecker.cpp UninitializedValues.cpp - VLASizeChecker.cpp - ValueManager.cpp ) add_dependencies(clangAnalysis ClangDiagnosticAnalysis) diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 0b2620e609..94ed75286d 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -19,7 +19,7 @@ #include "clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h" #include "clang/Analysis/FlowSensitive/DataflowSolver.h" #include "clang/Analysis/Support/SaveAndRestore.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Analysis/AnalysisContext.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp index 6fa4b539dc..bdc0e7c621 100644 --- a/lib/Analysis/UninitializedValues.cpp +++ b/lib/Analysis/UninitializedValues.cpp @@ -13,7 +13,6 @@ #include "clang/Analysis/Analyses/UninitializedValues.h" #include "clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h" -#include "clang/Analysis/LocalCheckers.h" #include "clang/Analysis/AnalysisDiagnostic.h" #include "clang/AST/ASTContext.h" #include "clang/Analysis/FlowSensitive/DataflowSolver.h" diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 2bfaa445e5..bc2cd460d9 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -10,3 +10,4 @@ add_subdirectory(Rewrite) add_subdirectory(Driver) add_subdirectory(Frontend) add_subdirectory(Index) +add_subdirectory(Checker) diff --git a/lib/Analysis/ArrayBoundChecker.cpp b/lib/Checker/ArrayBoundChecker.cpp similarity index 94% rename from lib/Analysis/ArrayBoundChecker.cpp rename to lib/Checker/ArrayBoundChecker.cpp index 49c8606826..0c3e3e9df4 100644 --- a/lib/Analysis/ArrayBoundChecker.cpp +++ b/lib/Checker/ArrayBoundChecker.cpp @@ -13,9 +13,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" using namespace clang; diff --git a/lib/Analysis/AttrNonNullChecker.cpp b/lib/Checker/AttrNonNullChecker.cpp similarity index 96% rename from lib/Analysis/AttrNonNullChecker.cpp rename to lib/Checker/AttrNonNullChecker.cpp index aa21700c24..c9e0e40af7 100644 --- a/lib/Analysis/AttrNonNullChecker.cpp +++ b/lib/Checker/AttrNonNullChecker.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/BasicConstraintManager.cpp b/lib/Checker/BasicConstraintManager.cpp similarity index 98% rename from lib/Analysis/BasicConstraintManager.cpp rename to lib/Checker/BasicConstraintManager.cpp index 6dfc470530..e89546ecb0 100644 --- a/lib/Analysis/BasicConstraintManager.cpp +++ b/lib/Checker/BasicConstraintManager.cpp @@ -13,9 +13,9 @@ //===----------------------------------------------------------------------===// #include "SimpleConstraintManager.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRStateTrait.h" -#include "clang/Analysis/PathSensitive/GRTransferFuncs.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathSensitive/GRTransferFuncs.h" #include "llvm/Support/raw_ostream.h" using namespace clang; diff --git a/lib/Analysis/BasicObjCFoundationChecks.cpp b/lib/Checker/BasicObjCFoundationChecks.cpp similarity index 97% rename from lib/Analysis/BasicObjCFoundationChecks.cpp rename to lib/Checker/BasicObjCFoundationChecks.cpp index 67483d9792..f410767a66 100644 --- a/lib/Analysis/BasicObjCFoundationChecks.cpp +++ b/lib/Checker/BasicObjCFoundationChecks.cpp @@ -15,15 +15,15 @@ #include "BasicObjCFoundationChecks.h" -#include "clang/Analysis/PathSensitive/ExplodedGraph.h" -#include "clang/Analysis/PathSensitive/GRSimpleAPICheck.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/MemRegion.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/LocalCheckers.h" +#include "clang/Checker/PathSensitive/ExplodedGraph.h" +#include "clang/Checker/PathSensitive/GRSimpleAPICheck.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/MemRegion.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/LocalCheckers.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprObjC.h" diff --git a/lib/Analysis/BasicObjCFoundationChecks.h b/lib/Checker/BasicObjCFoundationChecks.h similarity index 100% rename from lib/Analysis/BasicObjCFoundationChecks.h rename to lib/Checker/BasicObjCFoundationChecks.h diff --git a/lib/Analysis/BasicStore.cpp b/lib/Checker/BasicStore.cpp similarity index 99% rename from lib/Analysis/BasicStore.cpp rename to lib/Checker/BasicStore.cpp index 224281b177..0c95940e03 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Checker/BasicStore.cpp @@ -13,8 +13,8 @@ #include "clang/AST/ExprObjC.h" #include "clang/Analysis/Analyses/LiveVariables.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Analysis/AnalysisContext.h" +#include "clang/Checker/PathSensitive/GRState.h" #include "llvm/ADT/ImmutableMap.h" using namespace clang; diff --git a/lib/Analysis/BasicValueFactory.cpp b/lib/Checker/BasicValueFactory.cpp similarity index 99% rename from lib/Analysis/BasicValueFactory.cpp rename to lib/Checker/BasicValueFactory.cpp index b33c277f86..3b01e23da1 100644 --- a/lib/Analysis/BasicValueFactory.cpp +++ b/lib/Checker/BasicValueFactory.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/BasicValueFactory.h" +#include "clang/Checker/PathSensitive/BasicValueFactory.h" using namespace clang; diff --git a/lib/Analysis/BugReporter.cpp b/lib/Checker/BugReporter.cpp similarity index 99% rename from lib/Analysis/BugReporter.cpp rename to lib/Checker/BugReporter.cpp index 2a9531df60..1afb8c76c0 100644 --- a/lib/Analysis/BugReporter.cpp +++ b/lib/Checker/BugReporter.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" #include "clang/AST/ASTContext.h" #include "clang/Analysis/CFG.h" #include "clang/AST/Expr.h" @@ -21,7 +21,7 @@ #include "clang/AST/StmtObjC.h" #include "clang/Basic/SourceManager.h" #include "clang/Analysis/ProgramPoint.h" -#include "clang/Analysis/PathDiagnostic.h" +#include "clang/Checker/PathDiagnostic.h" #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" diff --git a/lib/Analysis/BugReporterVisitors.cpp b/lib/Checker/BugReporterVisitors.cpp similarity index 98% rename from lib/Analysis/BugReporterVisitors.cpp rename to lib/Checker/BugReporterVisitors.cpp index 87de30ae7a..98261943a8 100644 --- a/lib/Analysis/BugReporterVisitors.cpp +++ b/lib/Checker/BugReporterVisitors.cpp @@ -14,9 +14,9 @@ #include "clang/AST/Expr.h" #include "clang/AST/ExprObjC.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/GRState.h" using namespace clang; diff --git a/lib/Analysis/BuiltinFunctionChecker.cpp b/lib/Checker/BuiltinFunctionChecker.cpp similarity index 97% rename from lib/Analysis/BuiltinFunctionChecker.cpp rename to lib/Checker/BuiltinFunctionChecker.cpp index a89ad2164b..8711492049 100644 --- a/lib/Analysis/BuiltinFunctionChecker.cpp +++ b/lib/Checker/BuiltinFunctionChecker.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/Checker.h" #include "clang/Basic/Builtins.h" #include "llvm/ADT/StringSwitch.h" diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Checker/CFRefCount.cpp similarity index 99% rename from lib/Analysis/CFRefCount.cpp rename to lib/Checker/CFRefCount.cpp index 5a15fbfb1f..a128f9048d 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Checker/CFRefCount.cpp @@ -14,15 +14,15 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceManager.h" -#include "clang/Analysis/PathSensitive/GRExprEngineBuilders.h" -#include "clang/Analysis/PathSensitive/GRStateTrait.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/LocalCheckers.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/SymbolManager.h" -#include "clang/Analysis/PathSensitive/GRTransferFuncs.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngineBuilders.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/LocalCheckers.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/GRTransferFuncs.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/StmtVisitor.h" #include "llvm/ADT/DenseMap.h" diff --git a/lib/Checker/CMakeLists.txt b/lib/Checker/CMakeLists.txt new file mode 100644 index 0000000000..a1cd99130a --- /dev/null +++ b/lib/Checker/CMakeLists.txt @@ -0,0 +1,62 @@ +set(LLVM_NO_RTTI 1) + +add_clang_library(clangChecker + ArrayBoundChecker.cpp + AttrNonNullChecker.cpp + BasicConstraintManager.cpp + BasicObjCFoundationChecks.cpp + BasicStore.cpp + BasicValueFactory.cpp + BugReporter.cpp + BugReporterVisitors.cpp + BuiltinFunctionChecker.cpp + CFRefCount.cpp + CallAndMessageChecker.cpp + CallInliner.cpp + CastToStructChecker.cpp + CheckDeadStores.cpp + CheckObjCDealloc.cpp + CheckObjCInstMethSignature.cpp + CheckObjCUnusedIVars.cpp + CheckSecuritySyntaxOnly.cpp + CheckSizeofPointer.cpp + Checker.cpp + DereferenceChecker.cpp + DivZeroChecker.cpp + Environment.cpp + ExplodedGraph.cpp + FixedAddressChecker.cpp + GRBlockCounter.cpp + GRCoreEngine.cpp + GRExprEngine.cpp + GRExprEngineExperimentalChecks.cpp + GRState.cpp + MallocChecker.cpp + ManagerRegistry.cpp + MemRegion.cpp + NSAutoreleasePoolChecker.cpp + NSErrorChecker.cpp + NoReturnFunctionChecker.cpp + OSAtomicChecker.cpp + PathDiagnostic.cpp + PointerArithChecker.cpp + PointerSubChecker.cpp + PthreadLockChecker.cpp + RangeConstraintManager.cpp + RegionStore.cpp + ReturnPointerRangeChecker.cpp + ReturnStackAddressChecker.cpp + ReturnUndefChecker.cpp + SVals.cpp + SValuator.cpp + SimpleConstraintManager.cpp + SimpleSValuator.cpp + Store.cpp + SymbolManager.cpp + UndefBranchChecker.cpp + UndefResultChecker.cpp + UndefinedArraySubscriptChecker.cpp + UndefinedAssignmentChecker.cpp + VLASizeChecker.cpp + ValueManager.cpp + ) diff --git a/lib/Analysis/CallAndMessageChecker.cpp b/lib/Checker/CallAndMessageChecker.cpp similarity index 98% rename from lib/Analysis/CallAndMessageChecker.cpp rename to lib/Checker/CallAndMessageChecker.cpp index c287354650..c8739fdb5d 100644 --- a/lib/Analysis/CallAndMessageChecker.cpp +++ b/lib/Checker/CallAndMessageChecker.cpp @@ -13,8 +13,8 @@ //===----------------------------------------------------------------------===// #include "clang/Basic/TargetInfo.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "clang/AST/ParentMap.h" #include "GRExprEngineInternalChecks.h" diff --git a/lib/Analysis/CallInliner.cpp b/lib/Checker/CallInliner.cpp similarity index 95% rename from lib/Analysis/CallInliner.cpp rename to lib/Checker/CallInliner.cpp index d18bbcc017..8d4596d85e 100644 --- a/lib/Analysis/CallInliner.cpp +++ b/lib/Checker/CallInliner.cpp @@ -11,9 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/LocalCheckers.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/LocalCheckers.h" using namespace clang; diff --git a/lib/Analysis/CastToStructChecker.cpp b/lib/Checker/CastToStructChecker.cpp similarity index 97% rename from lib/Analysis/CastToStructChecker.cpp rename to lib/Checker/CastToStructChecker.cpp index 219c09f6ab..bef5bc285e 100644 --- a/lib/Analysis/CastToStructChecker.cpp +++ b/lib/Checker/CastToStructChecker.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/CheckDeadStores.cpp b/lib/Checker/CheckDeadStores.cpp similarity index 98% rename from lib/Analysis/CheckDeadStores.cpp rename to lib/Checker/CheckDeadStores.cpp index 6e4d899862..91c9bb30ad 100644 --- a/lib/Analysis/CheckDeadStores.cpp +++ b/lib/Checker/CheckDeadStores.cpp @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/LocalCheckers.h" +#include "clang/Checker/LocalCheckers.h" #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/Visitors/CFGRecStmtVisitor.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" #include "clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h" #include "clang/Basic/Diagnostic.h" #include "clang/AST/ASTContext.h" diff --git a/lib/Analysis/CheckObjCDealloc.cpp b/lib/Checker/CheckObjCDealloc.cpp similarity index 98% rename from lib/Analysis/CheckObjCDealloc.cpp rename to lib/Checker/CheckObjCDealloc.cpp index 87c1f270a6..7888c7aa2f 100644 --- a/lib/Analysis/CheckObjCDealloc.cpp +++ b/lib/Checker/CheckObjCDealloc.cpp @@ -13,9 +13,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/LocalCheckers.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/LocalCheckers.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/Expr.h" #include "clang/AST/DeclObjC.h" diff --git a/lib/Analysis/CheckObjCInstMethSignature.cpp b/lib/Checker/CheckObjCInstMethSignature.cpp similarity index 96% rename from lib/Analysis/CheckObjCInstMethSignature.cpp rename to lib/Checker/CheckObjCInstMethSignature.cpp index 10ba896557..67485c6480 100644 --- a/lib/Analysis/CheckObjCInstMethSignature.cpp +++ b/lib/Checker/CheckObjCInstMethSignature.cpp @@ -13,9 +13,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/LocalCheckers.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/LocalCheckers.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Type.h" #include "clang/AST/ASTContext.h" diff --git a/lib/Analysis/CheckObjCUnusedIVars.cpp b/lib/Checker/CheckObjCUnusedIVars.cpp similarity index 97% rename from lib/Analysis/CheckObjCUnusedIVars.cpp rename to lib/Checker/CheckObjCUnusedIVars.cpp index d4067c900f..27dc45f2f4 100644 --- a/lib/Analysis/CheckObjCUnusedIVars.cpp +++ b/lib/Checker/CheckObjCUnusedIVars.cpp @@ -13,9 +13,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/LocalCheckers.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/LocalCheckers.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/Expr.h" #include "clang/AST/DeclObjC.h" diff --git a/lib/Analysis/CheckSecuritySyntaxOnly.cpp b/lib/Checker/CheckSecuritySyntaxOnly.cpp similarity index 99% rename from lib/Analysis/CheckSecuritySyntaxOnly.cpp rename to lib/Checker/CheckSecuritySyntaxOnly.cpp index f4874a5dfe..3bf7a60202 100644 --- a/lib/Analysis/CheckSecuritySyntaxOnly.cpp +++ b/lib/Checker/CheckSecuritySyntaxOnly.cpp @@ -12,8 +12,8 @@ //===----------------------------------------------------------------------===// #include "clang/Basic/TargetInfo.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/LocalCheckers.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/LocalCheckers.h" #include "clang/AST/StmtVisitor.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/Analysis/CheckSizeofPointer.cpp b/lib/Checker/CheckSizeofPointer.cpp similarity index 95% rename from lib/Analysis/CheckSizeofPointer.cpp rename to lib/Checker/CheckSizeofPointer.cpp index 4f5da9f5a7..3f40235e0b 100644 --- a/lib/Analysis/CheckSizeofPointer.cpp +++ b/lib/Checker/CheckSizeofPointer.cpp @@ -12,9 +12,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "clang/AST/StmtVisitor.h" -#include "clang/Analysis/LocalCheckers.h" +#include "clang/Checker/LocalCheckers.h" using namespace clang; diff --git a/lib/Analysis/Checker.cpp b/lib/Checker/Checker.cpp similarity index 95% rename from lib/Analysis/Checker.cpp rename to lib/Checker/Checker.cpp index fb9d04d947..36323b9efb 100644 --- a/lib/Analysis/Checker.cpp +++ b/lib/Checker/Checker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/Checker.h" using namespace clang; Checker::~Checker() {} diff --git a/lib/Analysis/DereferenceChecker.cpp b/lib/Checker/DereferenceChecker.cpp similarity index 95% rename from lib/Analysis/DereferenceChecker.cpp rename to lib/Checker/DereferenceChecker.cpp index 98243874d7..623aed2143 100644 --- a/lib/Analysis/DereferenceChecker.cpp +++ b/lib/Checker/DereferenceChecker.cpp @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/Checkers/DereferenceChecker.h" -#include "clang/Analysis/PathSensitive/Checker.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/Checkers/DereferenceChecker.h" +#include "clang/Checker/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/DivZeroChecker.cpp b/lib/Checker/DivZeroChecker.cpp similarity index 97% rename from lib/Analysis/DivZeroChecker.cpp rename to lib/Checker/DivZeroChecker.cpp index 266c236094..e1346e11b6 100644 --- a/lib/Analysis/DivZeroChecker.cpp +++ b/lib/Checker/DivZeroChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/Environment.cpp b/lib/Checker/Environment.cpp similarity index 99% rename from lib/Analysis/Environment.cpp rename to lib/Checker/Environment.cpp index f04cf7b05f..c2c9190fc9 100644 --- a/lib/Analysis/Environment.cpp +++ b/lib/Checker/Environment.cpp @@ -10,7 +10,7 @@ // This file defined the Environment and EnvironmentManager classes. // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRState.h" #include "clang/Analysis/Analyses/LiveVariables.h" #include "llvm/ADT/ImmutableMap.h" diff --git a/lib/Analysis/ExplodedGraph.cpp b/lib/Checker/ExplodedGraph.cpp similarity index 98% rename from lib/Analysis/ExplodedGraph.cpp rename to lib/Checker/ExplodedGraph.cpp index 3b339ffc0d..20429b9519 100644 --- a/lib/Analysis/ExplodedGraph.cpp +++ b/lib/Checker/ExplodedGraph.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/ExplodedGraph.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/ExplodedGraph.h" +#include "clang/Checker/PathSensitive/GRState.h" #include "clang/AST/Stmt.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseMap.h" diff --git a/lib/Analysis/FixedAddressChecker.cpp b/lib/Checker/FixedAddressChecker.cpp similarity index 97% rename from lib/Analysis/FixedAddressChecker.cpp rename to lib/Checker/FixedAddressChecker.cpp index 031ca44b60..04c17d6d7a 100644 --- a/lib/Analysis/FixedAddressChecker.cpp +++ b/lib/Checker/FixedAddressChecker.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/GRBlockCounter.cpp b/lib/Checker/GRBlockCounter.cpp similarity index 96% rename from lib/Analysis/GRBlockCounter.cpp rename to lib/Checker/GRBlockCounter.cpp index 4f4103ac45..3fa3e1ebb9 100644 --- a/lib/Analysis/GRBlockCounter.cpp +++ b/lib/Checker/GRBlockCounter.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/GRBlockCounter.h" +#include "clang/Checker/PathSensitive/GRBlockCounter.h" #include "llvm/ADT/ImmutableMap.h" using namespace clang; diff --git a/lib/Analysis/GRCoreEngine.cpp b/lib/Checker/GRCoreEngine.cpp similarity index 99% rename from lib/Analysis/GRCoreEngine.cpp rename to lib/Checker/GRCoreEngine.cpp index 209452a392..d54b0777ed 100644 --- a/lib/Analysis/GRCoreEngine.cpp +++ b/lib/Checker/GRCoreEngine.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/GRCoreEngine.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRCoreEngine.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" #include "clang/AST/Expr.h" #include "llvm/Support/Casting.h" #include "llvm/ADT/DenseMap.h" diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp similarity index 99% rename from lib/Analysis/GRExprEngine.cpp rename to lib/Checker/GRExprEngine.cpp index 8f8d859e0c..458c0f4736 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -14,9 +14,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/GRExprEngineBuilders.h" -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRExprEngineBuilders.h" +#include "clang/Checker/PathSensitive/Checker.h" #include "clang/AST/CharUnits.h" #include "clang/AST/ParentMap.h" #include "clang/AST/StmtObjC.h" diff --git a/lib/Analysis/GRExprEngineExperimentalChecks.cpp b/lib/Checker/GRExprEngineExperimentalChecks.cpp similarity index 96% rename from lib/Analysis/GRExprEngineExperimentalChecks.cpp rename to lib/Checker/GRExprEngineExperimentalChecks.cpp index 33479b0cb7..1e94c93a75 100644 --- a/lib/Analysis/GRExprEngineExperimentalChecks.cpp +++ b/lib/Checker/GRExprEngineExperimentalChecks.cpp @@ -14,7 +14,7 @@ #include "GRExprEngineInternalChecks.h" #include "GRExprEngineExperimentalChecks.h" -#include "clang/Analysis/LocalCheckers.h" +#include "clang/Checker/LocalCheckers.h" using namespace clang; diff --git a/lib/Analysis/GRExprEngineExperimentalChecks.h b/lib/Checker/GRExprEngineExperimentalChecks.h similarity index 100% rename from lib/Analysis/GRExprEngineExperimentalChecks.h rename to lib/Checker/GRExprEngineExperimentalChecks.h diff --git a/lib/Analysis/GRExprEngineInternalChecks.h b/lib/Checker/GRExprEngineInternalChecks.h similarity index 100% rename from lib/Analysis/GRExprEngineInternalChecks.h rename to lib/Checker/GRExprEngineInternalChecks.h diff --git a/lib/Analysis/GRState.cpp b/lib/Checker/GRState.cpp similarity index 98% rename from lib/Analysis/GRState.cpp rename to lib/Checker/GRState.cpp index 051d465f41..2e952068fb 100644 --- a/lib/Analysis/GRState.cpp +++ b/lib/Checker/GRState.cpp @@ -11,9 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/GRStateTrait.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRTransferFuncs.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRTransferFuncs.h" #include "llvm/ADT/SmallSet.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/Analysis/MallocChecker.cpp b/lib/Checker/MallocChecker.cpp similarity index 98% rename from lib/Analysis/MallocChecker.cpp rename to lib/Checker/MallocChecker.cpp index 28f4db7880..3be2e0299b 100644 --- a/lib/Analysis/MallocChecker.cpp +++ b/lib/Checker/MallocChecker.cpp @@ -13,10 +13,10 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineExperimentalChecks.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRStateTrait.h" -#include "clang/Analysis/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" #include "llvm/ADT/ImmutableMap.h" using namespace clang; diff --git a/lib/Analysis/ManagerRegistry.cpp b/lib/Checker/ManagerRegistry.cpp similarity index 93% rename from lib/Analysis/ManagerRegistry.cpp rename to lib/Checker/ManagerRegistry.cpp index 8943db2a23..d11a997cc0 100644 --- a/lib/Analysis/ManagerRegistry.cpp +++ b/lib/Checker/ManagerRegistry.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/ManagerRegistry.h" +#include "clang/Checker/ManagerRegistry.h" using namespace clang; diff --git a/lib/Analysis/MemRegion.cpp b/lib/Checker/MemRegion.cpp similarity index 99% rename from lib/Analysis/MemRegion.cpp rename to lib/Checker/MemRegion.cpp index 87d60d3409..1e82883a68 100644 --- a/lib/Analysis/MemRegion.cpp +++ b/lib/Checker/MemRegion.cpp @@ -13,12 +13,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/raw_ostream.h" -#include "clang/Analysis/PathSensitive/MemRegion.h" -#include "clang/Analysis/PathSensitive/ValueManager.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Analysis/AnalysisContext.h" +#include "clang/Checker/PathSensitive/MemRegion.h" #include "clang/AST/CharUnits.h" #include "clang/AST/StmtVisitor.h" +#include "llvm/Support/raw_ostream.h" using namespace clang; diff --git a/lib/Analysis/NSAutoreleasePoolChecker.cpp b/lib/Checker/NSAutoreleasePoolChecker.cpp similarity index 94% rename from lib/Analysis/NSAutoreleasePoolChecker.cpp rename to lib/Checker/NSAutoreleasePoolChecker.cpp index 2ff04878f7..c6530ec3ed 100644 --- a/lib/Analysis/NSAutoreleasePoolChecker.cpp +++ b/lib/Checker/NSAutoreleasePoolChecker.cpp @@ -15,9 +15,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "BasicObjCFoundationChecks.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Decl.h" diff --git a/lib/Analysis/NSErrorChecker.cpp b/lib/Checker/NSErrorChecker.cpp similarity index 97% rename from lib/Analysis/NSErrorChecker.cpp rename to lib/Checker/NSErrorChecker.cpp index e3cf57fd0c..dd20e7a8c0 100644 --- a/lib/Analysis/NSErrorChecker.cpp +++ b/lib/Checker/NSErrorChecker.cpp @@ -15,10 +15,10 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/LocalCheckers.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/Checkers/DereferenceChecker.h" +#include "clang/Checker/LocalCheckers.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/Checkers/DereferenceChecker.h" #include "BasicObjCFoundationChecks.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/Decl.h" diff --git a/lib/Analysis/NoReturnFunctionChecker.cpp b/lib/Checker/NoReturnFunctionChecker.cpp similarity index 98% rename from lib/Analysis/NoReturnFunctionChecker.cpp rename to lib/Checker/NoReturnFunctionChecker.cpp index 5cfd9acd5f..1455d87665 100644 --- a/lib/Analysis/NoReturnFunctionChecker.cpp +++ b/lib/Checker/NoReturnFunctionChecker.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/Checker.h" #include "llvm/ADT/StringSwitch.h" using namespace clang; diff --git a/lib/Analysis/OSAtomicChecker.cpp b/lib/Checker/OSAtomicChecker.cpp similarity index 99% rename from lib/Analysis/OSAtomicChecker.cpp rename to lib/Checker/OSAtomicChecker.cpp index 9d34e9ec5c..f84388a755 100644 --- a/lib/Analysis/OSAtomicChecker.cpp +++ b/lib/Checker/OSAtomicChecker.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/Checker.h" #include "clang/Basic/Builtins.h" #include "llvm/ADT/StringSwitch.h" diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Checker/PathDiagnostic.cpp similarity index 99% rename from lib/Analysis/PathDiagnostic.cpp rename to lib/Checker/PathDiagnostic.cpp index 734570a21e..e95fcc2720 100644 --- a/lib/Analysis/PathDiagnostic.cpp +++ b/lib/Checker/PathDiagnostic.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathDiagnostic.h" +#include "clang/Checker/PathDiagnostic.h" #include "clang/AST/Expr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" diff --git a/lib/Analysis/PointerArithChecker.cpp b/lib/Checker/PointerArithChecker.cpp similarity index 97% rename from lib/Analysis/PointerArithChecker.cpp rename to lib/Checker/PointerArithChecker.cpp index 370233ce38..3d62d0c7b9 100644 --- a/lib/Analysis/PointerArithChecker.cpp +++ b/lib/Checker/PointerArithChecker.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/PointerSubChecker.cpp b/lib/Checker/PointerSubChecker.cpp similarity index 97% rename from lib/Analysis/PointerSubChecker.cpp rename to lib/Checker/PointerSubChecker.cpp index c597a25807..acc848ac8e 100644 --- a/lib/Analysis/PointerSubChecker.cpp +++ b/lib/Checker/PointerSubChecker.cpp @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/PthreadLockChecker.cpp b/lib/Checker/PthreadLockChecker.cpp similarity index 96% rename from lib/Analysis/PthreadLockChecker.cpp rename to lib/Checker/PthreadLockChecker.cpp index e95095c797..da1f7f30f2 100644 --- a/lib/Analysis/PthreadLockChecker.cpp +++ b/lib/Checker/PthreadLockChecker.cpp @@ -12,9 +12,9 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" #include "GRExprEngineExperimentalChecks.h" #include "llvm/ADT/ImmutableSet.h" diff --git a/lib/Analysis/RangeConstraintManager.cpp b/lib/Checker/RangeConstraintManager.cpp similarity index 98% rename from lib/Analysis/RangeConstraintManager.cpp rename to lib/Checker/RangeConstraintManager.cpp index 2cf3dfb6d0..c904c33e08 100644 --- a/lib/Analysis/RangeConstraintManager.cpp +++ b/lib/Checker/RangeConstraintManager.cpp @@ -13,10 +13,10 @@ //===----------------------------------------------------------------------===// #include "SimpleConstraintManager.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRStateTrait.h" -#include "clang/Analysis/PathSensitive/GRTransferFuncs.h" -#include "clang/Analysis/ManagerRegistry.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathSensitive/GRTransferFuncs.h" +#include "clang/Checker/ManagerRegistry.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/ImmutableSet.h" diff --git a/lib/Analysis/RegionStore.cpp b/lib/Checker/RegionStore.cpp similarity index 99% rename from lib/Analysis/RegionStore.cpp rename to lib/Checker/RegionStore.cpp index a735ed9457..39686c22df 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -14,10 +14,10 @@ // parameters are created lazily. // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/MemRegion.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/GRStateTrait.h" +#include "clang/Checker/PathSensitive/MemRegion.h" +#include "clang/Analysis/AnalysisContext.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRStateTrait.h" #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/Support/Optional.h" #include "clang/Basic/TargetInfo.h" diff --git a/lib/Analysis/ReturnPointerRangeChecker.cpp b/lib/Checker/ReturnPointerRangeChecker.cpp similarity index 94% rename from lib/Analysis/ReturnPointerRangeChecker.cpp rename to lib/Checker/ReturnPointerRangeChecker.cpp index b0350cb576..0a19254528 100644 --- a/lib/Analysis/ReturnPointerRangeChecker.cpp +++ b/lib/Checker/ReturnPointerRangeChecker.cpp @@ -13,9 +13,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" using namespace clang; diff --git a/lib/Analysis/ReturnStackAddressChecker.cpp b/lib/Checker/ReturnStackAddressChecker.cpp similarity index 95% rename from lib/Analysis/ReturnStackAddressChecker.cpp rename to lib/Checker/ReturnStackAddressChecker.cpp index 4d7e8ade98..3f40bc3472 100644 --- a/lib/Analysis/ReturnStackAddressChecker.cpp +++ b/lib/Checker/ReturnStackAddressChecker.cpp @@ -14,9 +14,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/SmallString.h" diff --git a/lib/Analysis/ReturnUndefChecker.cpp b/lib/Checker/ReturnUndefChecker.cpp similarity index 91% rename from lib/Analysis/ReturnUndefChecker.cpp rename to lib/Checker/ReturnUndefChecker.cpp index 7cd7126580..7180bd5371 100644 --- a/lib/Analysis/ReturnUndefChecker.cpp +++ b/lib/Checker/ReturnUndefChecker.cpp @@ -14,9 +14,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" #include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/Analysis/SVals.cpp b/lib/Checker/SVals.cpp similarity index 99% rename from lib/Analysis/SVals.cpp rename to lib/Checker/SVals.cpp index fbdb73b0ef..efa5521ebd 100644 --- a/lib/Analysis/SVals.cpp +++ b/lib/Checker/SVals.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/GRState.h" #include "clang/Basic/IdentifierTable.h" using namespace clang; diff --git a/lib/Analysis/SValuator.cpp b/lib/Checker/SValuator.cpp similarity index 98% rename from lib/Analysis/SValuator.cpp rename to lib/Checker/SValuator.cpp index 8392fcf65a..66cd3193b1 100644 --- a/lib/Analysis/SValuator.cpp +++ b/lib/Checker/SValuator.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/SValuator.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/SValuator.h" +#include "clang/Checker/PathSensitive/GRState.h" using namespace clang; diff --git a/lib/Analysis/SimpleConstraintManager.cpp b/lib/Checker/SimpleConstraintManager.cpp similarity index 98% rename from lib/Analysis/SimpleConstraintManager.cpp rename to lib/Checker/SimpleConstraintManager.cpp index eca20d574d..8c423a9977 100644 --- a/lib/Analysis/SimpleConstraintManager.cpp +++ b/lib/Checker/SimpleConstraintManager.cpp @@ -13,9 +13,9 @@ //===----------------------------------------------------------------------===// #include "SimpleConstraintManager.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/GRState.h" -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/Checker.h" namespace clang { diff --git a/lib/Analysis/SimpleConstraintManager.h b/lib/Checker/SimpleConstraintManager.h similarity index 96% rename from lib/Analysis/SimpleConstraintManager.h rename to lib/Checker/SimpleConstraintManager.h index 8182398319..5f20e0072b 100644 --- a/lib/Analysis/SimpleConstraintManager.h +++ b/lib/Checker/SimpleConstraintManager.h @@ -14,8 +14,8 @@ #ifndef LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H #define LLVM_CLANG_ANALYSIS_SIMPLE_CONSTRAINT_MANAGER_H -#include "clang/Analysis/PathSensitive/ConstraintManager.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/ConstraintManager.h" +#include "clang/Checker/PathSensitive/GRState.h" namespace clang { diff --git a/lib/Analysis/SimpleSValuator.cpp b/lib/Checker/SimpleSValuator.cpp similarity index 99% rename from lib/Analysis/SimpleSValuator.cpp rename to lib/Checker/SimpleSValuator.cpp index 8f2f5a1b13..7c6e0902ca 100644 --- a/lib/Analysis/SimpleSValuator.cpp +++ b/lib/Checker/SimpleSValuator.cpp @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/SValuator.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/SValuator.h" +#include "clang/Checker/PathSensitive/GRState.h" using namespace clang; diff --git a/lib/Analysis/Store.cpp b/lib/Checker/Store.cpp similarity index 98% rename from lib/Analysis/Store.cpp rename to lib/Checker/Store.cpp index 1724a9250c..98b86a9f46 100644 --- a/lib/Analysis/Store.cpp +++ b/lib/Checker/Store.cpp @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/Store.h" -#include "clang/Analysis/PathSensitive/GRState.h" +#include "clang/Checker/PathSensitive/Store.h" +#include "clang/Checker/PathSensitive/GRState.h" #include "clang/AST/CharUnits.h" using namespace clang; diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Checker/SymbolManager.cpp similarity index 98% rename from lib/Analysis/SymbolManager.cpp rename to lib/Checker/SymbolManager.cpp index 3fe36b064e..40bdcf65bc 100644 --- a/lib/Analysis/SymbolManager.cpp +++ b/lib/Checker/SymbolManager.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/SymbolManager.h" -#include "clang/Analysis/PathSensitive/MemRegion.h" +#include "clang/Checker/PathSensitive/SymbolManager.h" +#include "clang/Checker/PathSensitive/MemRegion.h" #include "llvm/Support/raw_ostream.h" using namespace clang; diff --git a/lib/Analysis/UndefBranchChecker.cpp b/lib/Checker/UndefBranchChecker.cpp similarity index 98% rename from lib/Analysis/UndefBranchChecker.cpp rename to lib/Checker/UndefBranchChecker.cpp index c739d1ac4b..e047b187b1 100644 --- a/lib/Analysis/UndefBranchChecker.cpp +++ b/lib/Checker/UndefBranchChecker.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/Checker.h" +#include "clang/Checker/PathSensitive/Checker.h" using namespace clang; diff --git a/lib/Analysis/UndefResultChecker.cpp b/lib/Checker/UndefResultChecker.cpp similarity index 94% rename from lib/Analysis/UndefResultChecker.cpp rename to lib/Checker/UndefResultChecker.cpp index acc86dda5a..4408c471d2 100644 --- a/lib/Analysis/UndefResultChecker.cpp +++ b/lib/Checker/UndefResultChecker.cpp @@ -13,9 +13,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" using namespace clang; diff --git a/lib/Analysis/UndefinedArraySubscriptChecker.cpp b/lib/Checker/UndefinedArraySubscriptChecker.cpp similarity index 94% rename from lib/Analysis/UndefinedArraySubscriptChecker.cpp rename to lib/Checker/UndefinedArraySubscriptChecker.cpp index d6aacaf1f8..b20154df33 100644 --- a/lib/Analysis/UndefinedArraySubscriptChecker.cpp +++ b/lib/Checker/UndefinedArraySubscriptChecker.cpp @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/BugReporter.h" #include "GRExprEngineInternalChecks.h" using namespace clang; diff --git a/lib/Analysis/UndefinedAssignmentChecker.cpp b/lib/Checker/UndefinedAssignmentChecker.cpp similarity index 95% rename from lib/Analysis/UndefinedAssignmentChecker.cpp rename to lib/Checker/UndefinedAssignmentChecker.cpp index 4630b823a9..6edc3d8150 100644 --- a/lib/Analysis/UndefinedAssignmentChecker.cpp +++ b/lib/Checker/UndefinedAssignmentChecker.cpp @@ -13,8 +13,8 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/BugReporter.h" using namespace clang; diff --git a/lib/Analysis/VLASizeChecker.cpp b/lib/Checker/VLASizeChecker.cpp similarity index 94% rename from lib/Analysis/VLASizeChecker.cpp rename to lib/Checker/VLASizeChecker.cpp index 2690d6f0cf..b41126c5e7 100644 --- a/lib/Analysis/VLASizeChecker.cpp +++ b/lib/Checker/VLASizeChecker.cpp @@ -13,9 +13,9 @@ //===----------------------------------------------------------------------===// #include "GRExprEngineInternalChecks.h" -#include "clang/Analysis/PathSensitive/CheckerVisitor.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/CheckerVisitor.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/BugReporter.h" using namespace clang; diff --git a/lib/Analysis/ValueManager.cpp b/lib/Checker/ValueManager.cpp similarity index 97% rename from lib/Analysis/ValueManager.cpp rename to lib/Checker/ValueManager.cpp index d09137330c..5359489a22 100644 --- a/lib/Analysis/ValueManager.cpp +++ b/lib/Checker/ValueManager.cpp @@ -13,8 +13,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/Analysis/PathSensitive/ValueManager.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Checker/PathSensitive/ValueManager.h" +#include "clang/Analysis/AnalysisContext.h" using namespace clang; using namespace llvm; diff --git a/lib/Frontend/AnalysisConsumer.cpp b/lib/Frontend/AnalysisConsumer.cpp index 45a3b15cae..d73114eaf2 100644 --- a/lib/Frontend/AnalysisConsumer.cpp +++ b/lib/Frontend/AnalysisConsumer.cpp @@ -18,14 +18,15 @@ #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/Analysis/LocalCheckers.h" -#include "clang/Analysis/ManagerRegistry.h" -#include "clang/Analysis/PathDiagnostic.h" -#include "clang/Analysis/PathSensitive/AnalysisManager.h" -#include "clang/Analysis/PathSensitive/BugReporter.h" -#include "clang/Analysis/PathSensitive/GRExprEngine.h" -#include "clang/Analysis/PathSensitive/GRTransferFuncs.h" +#include "clang/Checker/LocalCheckers.h" +#include "clang/Checker/ManagerRegistry.h" +#include "clang/Checker/PathDiagnostic.h" +#include "clang/Checker/PathSensitive/AnalysisManager.h" +#include "clang/Checker/PathSensitive/BugReporter.h" +#include "clang/Checker/PathSensitive/GRExprEngine.h" +#include "clang/Checker/PathSensitive/GRTransferFuncs.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Frontend/PathDiagnosticClients.h" diff --git a/lib/Frontend/HTMLDiagnostics.cpp b/lib/Frontend/HTMLDiagnostics.cpp index b163e267b0..b5975c27df 100644 --- a/lib/Frontend/HTMLDiagnostics.cpp +++ b/lib/Frontend/HTMLDiagnostics.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/Frontend/PathDiagnosticClients.h" -#include "clang/Analysis/PathDiagnostic.h" +#include "clang/Checker/PathDiagnostic.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/Basic/SourceManager.h" diff --git a/lib/Frontend/PlistDiagnostics.cpp b/lib/Frontend/PlistDiagnostics.cpp index 98be869d26..3c204fb5f1 100644 --- a/lib/Frontend/PlistDiagnostics.cpp +++ b/lib/Frontend/PlistDiagnostics.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "clang/Frontend/PathDiagnosticClients.h" -#include "clang/Analysis/PathDiagnostic.h" +#include "clang/Checker/PathDiagnostic.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/FileManager.h" #include "clang/Lex/Preprocessor.h" diff --git a/lib/Makefile b/lib/Makefile index d499ee555a..538bf43940 100755 --- a/lib/Makefile +++ b/lib/Makefile @@ -9,7 +9,7 @@ LEVEL = ../../.. PARALLEL_DIRS = Headers Runtime Basic Lex Parse AST Sema CodeGen Analysis \ - Rewrite Frontend Index Driver + Checker Rewrite Frontend Index Driver include $(LEVEL)/Makefile.common diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 6ff8b1d753..0a7b7f0911 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -14,7 +14,7 @@ #include "Sema.h" #include "clang/Analysis/CFG.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Analysis/AnalysisContext.h" #include "clang/AST/ASTContext.h" #include "clang/AST/CharUnits.h" #include "clang/AST/DeclObjC.h" diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 938c41efbe..876fcb32ba 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -14,7 +14,7 @@ #include "Sema.h" #include "SemaInit.h" #include "Lookup.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Analysis/AnalysisContext.h" #include "clang/AST/APValue.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 50976f7b70..e55fbe3d09 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -14,7 +14,7 @@ #include "Sema.h" #include "SemaInit.h" #include "Lookup.h" -#include "clang/Analysis/PathSensitive/AnalysisContext.h" +#include "clang/Analysis/AnalysisContext.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index 90fb09c0d9..cfd9b68955 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -4,6 +4,7 @@ set( LLVM_USED_LIBS clangDriver clangFrontend clangCodeGen + clangChecker clangAnalysis clangRewrite clangSema diff --git a/tools/driver/Makefile b/tools/driver/Makefile index b86a5309be..6610e1f68a 100644 --- a/tools/driver/Makefile +++ b/tools/driver/Makefile @@ -23,9 +23,9 @@ TOOL_NO_EXPORTS = 1 include $(LEVEL)/Makefile.config LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader bitwriter codegen ipo selectiondag -USEDLIBS = clangFrontend.a clangDriver.a clangCodeGen.a clangAnalysis.a \ - clangRewrite.a clangSema.a clangAST.a clangParse.a \ - clangLex.a clangBasic.a +USEDLIBS = clangFrontend.a clangDriver.a clangCodeGen.a clangChecker.a\ + clangAnalysis.a clangRewrite.a clangSema.a clangAST.a\ + clangParse.a clangLex.a clangBasic.a include $(LLVM_SRC_ROOT)/Makefile.rules