//===- AnalysisDeclContext.h - Context for path sensitivity -----*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // /// \file /// This file defines AnalysisDeclContext, a class that manages the analysis /// context data for context sensitive and path sensitive analysis. /// It also defines the helper classes to model entering, leaving or inlining /// function calls. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ANALYSIS_ANALYSISDECLCONTEXT_H #define LLVM_CLANG_ANALYSIS_ANALYSISDECLCONTEXT_H #include "clang/AST/DeclBase.h" #include "clang/Analysis/BodyFarm.h" #include "clang/Analysis/CFG.h" #include "clang/Analysis/CodeInjector.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Support/Allocator.h" #include <functional> #include <memory> namespace clang { class AnalysisDeclContextManager; class ASTContext; class BlockDecl; class BlockInvocationContext; class CFGReverseBlockReachabilityAnalysis; class CFGStmtMap; class ImplicitParamDecl; class LocationContext; class LocationContextManager; class ParentMap; class StackFrameContext; class Stmt; class VarDecl; /// The base class of a hierarchy of objects representing analyses tied /// to AnalysisDeclContext. class ManagedAnalysis { … }; /// AnalysisDeclContext contains the context data for the function, method /// or block under analysis. class AnalysisDeclContext { … }; /// It wraps the AnalysisDeclContext to represent both the call stack with /// the help of StackFrameContext and inside the function calls the /// BlockInvocationContext. It is needed for context sensitive analysis to /// model entering, leaving or inlining function calls. class LocationContext : public llvm::FoldingSetNode { … }; /// It represents a stack frame of the call stack (based on CallEvent). class StackFrameContext : public LocationContext { … }; /// It represents a block invocation (based on BlockCall). class BlockInvocationContext : public LocationContext { … }; class LocationContextManager { … }; class AnalysisDeclContextManager { … }; } // namespace clang #endif // LLVM_CLANG_ANALYSIS_ANALYSISDECLCONTEXT_H