15 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H 16 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H 36 #include "llvm/ADT/ArrayRef.h" 42 class AnalysisDeclContextManager;
43 class AnalyzerOptions;
45 class ConstructionContext;
46 class CXXBindTemporaryExpr;
48 class CXXConstructExpr;
56 class LocationContext;
57 class MaterializeTemporaryExpr;
60 class ObjCAtSynchronizedStmt;
61 class ObjCForCollectionStmt;
62 class ObjCIvarRefExpr;
63 class ObjCMessageExpr;
69 class CrossTranslationUnitContext;
75 class BasicValueFactory;
78 class ConstraintManager;
79 class CXXTempObjectRegion;
81 class RegionAndSymbolInvalidationTraits;
99 bool IsCtorOrDtorWithImproperlyModeledTargetRegion =
false;
103 bool IsArrayCtorOrDtor =
false;
106 bool IsTemporaryCtorOrDtor =
false;
111 bool IsTemporaryLifetimeExtendedViaAggregate =
false;
140 unsigned int currStmtIdx = 0;
208 const Stmt *getStmt()
const;
218 std::string DumpGraph(
bool trim =
false, StringRef
Filename=
"");
227 void ViewGraph(
bool trim =
false);
267 const Stmt *DiagnosticStmt =
nullptr,
297 void processCFGBlockEntrance(
const BlockEdge &L,
303 void processBranch(
const Stmt *Condition,
321 void processStaticInitializer(
const DeclStmt *DS,
362 void processEndWorklist()
override;
367 bool assumption)
override;
382 unsigned int Space,
bool IsDot)
const override;
454 void VisitCommonDeclRefExpr(
const Expr *DR,
const NamedDecl *D,
462 void VisitGuardedExpr(
const Expr *Ex,
const Expr *L,
const Expr *R,
531 const Stmt *S,
bool IsBaseDtor,
535 void VisitCXXNewAllocatorCall(
const CXXNewExpr *CNE,
556 static std::pair<const ProgramPointTag *, const ProgramPointTag *>
557 geteagerlyAssumeBinOpBifurcationTags();
586 return svalBuilder.
evalBinOpNN(state, op, L, R, T);
597 return svalBuilder.
evalBinOp(ST, Op, LHS, RHS, T);
612 SVal location,
SVal Val,
bool atDeclInit =
false,
644 const Expr *BoundExpr,
660 return (*currBldrCtx->
getBlock())[currStmtIdx];
704 bool &IsRecursive,
unsigned &StackDepth);
706 enum CallInlinePolicy {
714 CallInlinePolicy mayInlineCallKind(
const CallEvent &Call,
753 void BifurcateCall(
const MemRegion *BifurReg,
776 const Expr *InitWithAdjustments,
const Expr *Result =
nullptr,
777 const SubRegion **OutRegionWithAdjustments =
nullptr);
803 std::pair<ProgramStateRef, SVal> prepareForObjectConstruction(
863 static void *GDMIndex();
870 #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H MemRegionManager & getRegionManager()
AnalysisDeclContextManager & getAnalysisDeclContextManager()
This represents a GCC inline-assembly statement extension.
A (possibly-)qualified type.
MemRegion - The root abstract class for all memory regions.
CheckerManager * getCheckerManager() const
ImplTy::iterator iterator
bool ExecuteWorkList(const LocationContext *L, unsigned Steps, ProgramStateRef InitState)
ExecuteWorkList - Run the worklist algorithm for a maximum number of steps.
Stmt - This represents one statement.
Information about invalidation for a particular region/symbol.
BasicValueFactory & getBasicVals()
This builder class is useful for generating nodes that resulted from visiting a statement.
C Language Family Type Representation.
Decl - This represents one declaration (or definition), e.g.
Represents a point when we begin processing an inlined call.
bool ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps, ProgramStateRef InitState, ExplodedNodeSet &Dst)
Execute the work list with an initial state.
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T)
Represents C++ object destructor generated from a call to delete.
NoteTag::Factory & getNoteTags()
Hints for figuring out of a call should be inlined during evalCall().
Represents a call to a C++ constructor.
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
cross_tu::CrossTranslationUnitContext * getCrossTranslationUnitContext() override
CompoundLiteralExpr - [C99 6.5.2.5].
const NodeBuilderContext & getBuilderContext()
bool ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps, ProgramStateRef InitState, ExplodedNodeSet &Dst)
Returns true if there is still simulation state on the worklist.
BoundNodesTreeBuilder Nodes
bool hasWorkRemaining() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
AnalysisDeclContext contains the context data for the function or method under analysis.
Represents C++ object destructor implicitly generated for automatic object or temporary bound to cons...
bool hasEmptyWorkList() const
bool wasBlocksExhausted() const
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
AnalysisDeclContextManager & getAnalysisDeclContextManager()
Describes an C or C++ initializer list.
NoteTag::Factory & getNoteTags()
WorkList * getWorkList() const
CFGElement getCurrentCFGElement()
Return the CFG element corresponding to the worklist element that is currently being processed by Exp...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
A builtin binary operation expression such as "x + y" or "x <= y".
const CoreEngine & getCoreEngine() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents binding an expression to a temporary.
SVal evalComplement(SVal X)
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
ASTContext & getASTContext() override
Represents the this expression in C++.
CheckerManager & getCheckerManager() const
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, SVal LHS, SVal RHS, QualType T)
Represents a single basic block in a source-level CFG.
InliningModes
The modes of inlining, which override the default analysis-wide settings.
This represents one expression.
virtual SVal evalMinus(NonLoc val)=0
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
This is the simplest builder which generates nodes in the ExplodedGraph.
Represents Objective-C's @synchronized statement.
ASTContext & getContext() const
getContext - Return the ASTContext associated with this analysis.
Traits for storing the call processing policy inside GDM.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, SVal lhs, SVal rhs, QualType type)
An expression that sends a message to the given Objective-C object or class.
This represents a Microsoft inline-assembly statement extension.
StoreManager & getStoreManager()
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Represents C++ object destructor implicitly generated for base object in destructor.
SymbolManager & getSymbolManager()
BugReporter is a utility class for generating PathDiagnostics for analysis.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity...
AnalysisManager & getAnalysisManager() override
bool wasBlocksExhausted() const
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
virtual bool hasWork() const =0
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
BugReporter & getBugReporter()
BasicValueFactory & getBasicVals()
virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs, QualType resultTy)=0
Create a new value which represents a binary expression with two non- location operands.
bool ExecuteWorkList(const LocationContext *L, unsigned Steps=150000)
Returns true if there is still simulation state on the worklist.
ast_type_traits::DynTypedNode Node
CoreEngine - Implements the core logic of the graph-reachability analysis.
Dataflow Directional Tag Classes.
SValBuilder & getSValBuilder()
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
StoreManager & getStoreManager()
bool hasWorkRemaining() const
This node builder keeps track of the generated sink nodes.
const ExplodedGraph & getGraph() const
Represents an abstract call to a function or method along a particular path.
ProgramStateManager & getStateManager() override
This class is used for tools that requires cross translation unit capability.
Represents a single point (AST node) in the program that requires attention during construction of an...
PointerEscapeKind
Describes the different reasons a pointer escapes during analysis.
ConstraintManager & getConstraintManager()
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
SubRegion - A region that subsets another larger region.
Represents Objective-C's collection statement.
Stores options for the analyzer from the command line.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
ConstructionContext's subclasses describe different ways of constructing an object in C++...
virtual SVal evalComplement(NonLoc val)=0
Represents C++ object destructor implicitly generated by compiler on various occasions.
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T)
CXXCatchStmt - This represents a C++ catch block.
Represents a top-level expression in a basic block.
GRBugReporter is used for generating path-sensitive reports.
Represents C++ object destructor implicitly generated for member object in destructor.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Represents C++ base or member initializer from constructor's initialization list. ...
ExplodedGraph & getGraph()
This represents a decl that may have a name.
ConstraintManager & getConstraintManager()
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Represents C++ object destructor implicitly generated at the end of full expression for temporary obj...
const CFGBlock * getBlock() const
Return the CFGBlock associated with this builder.