16 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H 17 #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;
137 unsigned int currStmtIdx = 0;
206 const Stmt *getStmt()
const;
213 void ViewGraph(
bool trim =
false);
253 const Stmt *DiagnosticStmt =
nullptr,
283 void processCFGBlockEntrance(
const BlockEdge &L,
289 void processBranch(
const Stmt *Condition,
const Stmt *Term,
307 void processStaticInitializer(
const DeclStmt *DS,
348 void processEndWorklist(
bool hasWorkRemaining)
override;
353 bool assumption)
override;
438 void VisitCommonDeclRefExpr(
const Expr *DR,
const NamedDecl *D,
446 void VisitGuardedExpr(
const Expr *Ex,
const Expr *L,
const Expr *R,
515 const Stmt *S,
bool IsBaseDtor,
519 void VisitCXXNewAllocatorCall(
const CXXNewExpr *CNE,
540 static std::pair<const ProgramPointTag *, const ProgramPointTag *>
541 geteagerlyAssumeBinOpBifurcationTags();
570 return svalBuilder.
evalBinOpNN(state, op, L, R, T);
581 return svalBuilder.
evalBinOp(ST, Op, LHS, RHS, T);
596 SVal location,
SVal Val,
bool atDeclInit =
false,
629 const Expr *BoundExpr,
645 return (*currBldrCtx->
getBlock())[currStmtIdx];
685 bool &IsRecursive,
unsigned &StackDepth);
687 enum CallInlinePolicy {
695 CallInlinePolicy mayInlineCallKind(
const CallEvent &Call,
715 void BifurcateCall(
const MemRegion *BifurReg,
734 const Expr *InitWithAdjustments,
735 const Expr *Result =
nullptr);
761 std::pair<ProgramStateRef, SVal> prepareForObjectConstruction(
821 static void *
GDMIndex() {
static int index = 0;
return &index; }
828 #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H
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.
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 ...
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
Describes an C or C++ initializer list.
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.
Expr - 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.
const SymbolManager & getSymbolManager() const
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.
Represents Objective-C's collection statement.
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.