26#include "llvm/ADT/SmallVector.h"
27#include "llvm/Support/ErrorHandling.h"
28#include "llvm/Support/FormatVariadic.h"
29#include "llvm/Support/TimeProfiler.h"
38 const auto IfAnyAreNonEmpty = [](
const auto &... Callbacks) ->
bool {
39 return (!Callbacks.empty() || ...);
41 return IfAnyAreNonEmpty(
42 StmtCheckers, PreObjCMessageCheckers, ObjCMessageNilCheckers,
43 PostObjCMessageCheckers, PreCallCheckers, PostCallCheckers,
44 LocationCheckers, BindCheckers, BlockEntranceCheckers,
45 EndAnalysisCheckers, BeginFunctionCheckers, EndFunctionCheckers,
46 BranchConditionCheckers, NewAllocatorCheckers, LiveSymbolsCheckers,
47 DeadSymbolsCheckers, RegionChangesCheckers, PointerEscapeCheckers,
48 EvalAssumeCheckers, EvalCallCheckers, EndOfTranslationUnitCheckers);
53 StringRef ExpectedValueDesc)
const {
69 auto [CCI, Inserted] = CachedDeclCheckersMap.try_emplace(DeclKind);
73 for (
const auto &info : DeclCheckers)
74 if (info.IsForDeclFn(
D))
75 checkers->push_back(info.CheckFn);
79 for (
const auto &checker : *checkers)
87 for (
const auto &BodyChecker : BodyCheckers)
88 BodyChecker(
D, mgr, BR);
95template <
typename CHECK_CTX>
103 typename CHECK_CTX::CheckersTy::const_iterator
104 I = checkCtx.checkers_begin(),
E = checkCtx.checkers_end();
113 for (; I !=
E; ++I) {
118 CurrSet = (PrevSet == &Tmp1) ? &Tmp2 : &Tmp1;
123 for (
const auto &NI : *PrevSet)
124 checkCtx.runChecker(*I, B, NI);
127 if (CurrSet->
empty())
138 if (!llvm::timeTraceProfilerEnabled())
141 return (Name +
":" + CheckerTag).str();
144 struct CheckStmtContext {
148 const CheckersTy &Checkers;
153 CheckStmtContext(
bool isPreVisit,
const CheckersTy &checkers,
155 : IsPreVisit(isPreVisit), Checkers(checkers), S(
s), Eng(eng),
156 WasInlined(wasInlined) {}
158 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
159 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
163 llvm::TimeTraceScope TimeScope(checkerScopeName(
"Stmt", checkFn.Checker));
183 CheckStmtContext
C(isPreVisit, getCachedStmtCheckersFor(S, isPreVisit),
185 llvm::TimeTraceScope TimeScope(
186 isPreVisit ?
"CheckerManager::runCheckersForStmt (Pre)"
187 :
"CheckerManager::runCheckersForStmt (Post)");
193 struct CheckObjCMessageContext {
194 using CheckersTy = std::vector<CheckerManager::CheckObjCMessageFunc>;
198 const CheckersTy &Checkers;
203 const CheckersTy &checkers,
206 :
Kind(visitKind), WasInlined(wasInlined), Checkers(checkers), Msg(msg),
209 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
210 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
214 llvm::TimeTraceScope TimeScope(
215 checkerScopeName(
"ObjCMsg", checkFn.Checker));
219 case ObjCMessageVisitKind::Pre:
222 case ObjCMessageVisitKind::MessageNil:
223 case ObjCMessageVisitKind::Post:
244 const auto &checkers = getObjCMessageCheckers(visitKind);
245 CheckObjCMessageContext
C(visitKind, checkers, msg, Eng, WasInlined);
246 llvm::TimeTraceScope TimeScope(
"CheckerManager::runCheckersForObjCMessage");
250const std::vector<CheckerManager::CheckObjCMessageFunc> &
254 return PreObjCMessageCheckers;
257 return PostObjCMessageCheckers;
259 return ObjCMessageNilCheckers;
261 llvm_unreachable(
"Unknown Kind");
268 struct CheckCallContext {
269 using CheckersTy = std::vector<CheckerManager::CheckCallFunc>;
271 bool IsPreVisit, WasInlined;
272 const CheckersTy &Checkers;
276 CheckCallContext(
bool isPreVisit,
const CheckersTy &checkers,
279 : IsPreVisit(isPreVisit), WasInlined(wasInlined), Checkers(checkers),
280 Call(call), Eng(eng) {}
282 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
283 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
287 llvm::TimeTraceScope TimeScope(checkerScopeName(
"Call", checkFn.Checker));
304 CheckCallContext
C(isPreVisit,
305 isPreVisit ? PreCallCheckers
307 Call, Eng, WasInlined);
308 llvm::TimeTraceScope TimeScope(
309 isPreVisit ?
"CheckerManager::runCheckersForCallEvent (Pre)"
310 :
"CheckerManager::runCheckersForCallEvent (Post)");
316 struct CheckLocationContext {
317 using CheckersTy = std::vector<CheckerManager::CheckLocationFunc>;
319 const CheckersTy &Checkers;
326 CheckLocationContext(
const CheckersTy &checkers,
327 SVal loc,
bool isLoad,
const Stmt *NodeEx,
330 : Checkers(checkers),
Loc(loc), IsLoad(isLoad), NodeEx(NodeEx),
331 BoundEx(BoundEx), Eng(eng) {}
333 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
334 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
338 llvm::TimeTraceScope TimeScope(checkerScopeName(
"Loc", checkFn.Checker));
346 checkFn(
Loc, IsLoad, BoundEx,
C);
356 SVal location,
bool isLoad,
360 CheckLocationContext
C(LocationCheckers, location, isLoad, NodeEx,
362 llvm::TimeTraceScope TimeScope(
363 isLoad ?
"CheckerManager::runCheckersForLocation (Load)"
364 :
"CheckerManager::runCheckersForLocation (Store)");
370 struct CheckBindContext {
371 using CheckersTy = std::vector<CheckerManager::CheckBindFunc>;
373 const CheckersTy &Checkers;
381 CheckBindContext(
const CheckersTy &checkers,
SVal loc,
SVal val,
384 : Checkers(checkers),
Loc(loc), Val(val), S(
s), Eng(eng), PP(pp),
385 AtDeclInit(AtDeclInit) {}
387 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
388 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
392 llvm::TimeTraceScope TimeScope(checkerScopeName(
"Bind", checkFn.Checker));
396 checkFn(
Loc, Val, S, AtDeclInit,
C);
400 llvm::TimeTraceMetadata getTimeTraceBindMetadata(
SVal Val) {
401 assert(llvm::timeTraceProfilerEnabled());
403 llvm::raw_string_ostream
OS(Name);
405 return llvm::TimeTraceMetadata{
OS.str(),
""};
416 CheckBindContext
C(BindCheckers, location, val, S, AtDeclInit, Eng, PP);
417 llvm::TimeTraceScope TimeScope{
418 "CheckerManager::runCheckersForBind",
419 [&val]() {
return getTimeTraceBindMetadata(val); }};
424struct CheckBlockEntranceContext {
426 using CheckersTy = std::vector<CheckBlockEntranceFunc>;
428 const CheckersTy &Checkers;
432 CheckBlockEntranceContext(
const CheckersTy &Checkers,
434 : Checkers(Checkers), Entrance(Entrance), Eng(Eng) {}
436 auto checkers_begin()
const {
return Checkers.begin(); }
437 auto checkers_end()
const {
return Checkers.end(); }
439 void runChecker(CheckBlockEntranceFunc CheckFn,
NodeBuilder &Bldr,
441 llvm::TimeTraceScope TimeScope(
442 checkerScopeName(
"BlockEntrance", CheckFn.Checker));
444 CheckFn(Entrance,
C);
454 CheckBlockEntranceContext
C(BlockEntranceCheckers, Entrance, Eng);
455 llvm::TimeTraceScope TimeScope{
"CheckerManager::runCheckersForBlockEntrance"};
462 for (
const auto &EndAnalysisChecker : EndAnalysisCheckers)
463 EndAnalysisChecker(G, BR, Eng);
468struct CheckBeginFunctionContext {
469 using CheckersTy = std::vector<CheckerManager::CheckBeginFunctionFunc>;
471 const CheckersTy &Checkers;
475 CheckBeginFunctionContext(
const CheckersTy &Checkers,
ExprEngine &Eng,
477 : Checkers(Checkers), Eng(Eng), PP(PP) {}
479 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
480 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
484 llvm::TimeTraceScope TimeScope(checkerScopeName(
"Begin", checkFn.Checker));
500 CheckBeginFunctionContext
C(BeginFunctionCheckers, Eng, L);
501 llvm::TimeTraceScope TimeScope(
"CheckerManager::runCheckersForBeginFunction");
517 for (
const auto &checkFn : EndFunctionCheckers) {
521 llvm::TimeTraceScope TimeScope(checkerScopeName(
"End", checkFn.Checker));
528 struct CheckBranchConditionContext {
529 using CheckersTy = std::vector<CheckerManager::CheckBranchConditionFunc>;
531 const CheckersTy &Checkers;
535 CheckBranchConditionContext(
const CheckersTy &checkers,
537 : Checkers(checkers),
Condition(Cond), Eng(eng) {}
539 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
540 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
544 llvm::TimeTraceScope TimeScope(
545 checkerScopeName(
"BranchCond", checkFn.Checker));
562 CheckBranchConditionContext
C(BranchConditionCheckers,
Condition, Eng);
563 llvm::TimeTraceScope TimeScope(
564 "CheckerManager::runCheckersForBranchCondition");
570 struct CheckNewAllocatorContext {
571 using CheckersTy = std::vector<CheckerManager::CheckNewAllocatorFunc>;
573 const CheckersTy &Checkers;
578 CheckNewAllocatorContext(
const CheckersTy &Checkers,
581 : Checkers(Checkers),
Call(
Call), WasInlined(WasInlined), Eng(Eng) {}
583 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
584 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
588 llvm::TimeTraceScope TimeScope(
589 checkerScopeName(
"Allocator", checkFn.Checker));
593 checkFn(cast<CXXAllocatorCall>(*
Call.cloneWithState(Pred->
getState())),
607 CheckNewAllocatorContext
C(NewAllocatorCheckers,
Call, WasInlined, Eng);
608 llvm::TimeTraceScope TimeScope(
"CheckerManager::runCheckersForNewAllocator");
615 for (
const auto &LiveSymbolsChecker : LiveSymbolsCheckers)
616 LiveSymbolsChecker(state, SymReaper);
621 struct CheckDeadSymbolsContext {
622 using CheckersTy = std::vector<CheckerManager::CheckDeadSymbolsFunc>;
624 const CheckersTy &Checkers;
630 CheckDeadSymbolsContext(
const CheckersTy &checkers,
SymbolReaper &sr,
633 : Checkers(checkers), SR(sr), S(
s), Eng(eng), ProgarmPointKind(K) {}
635 CheckersTy::const_iterator checkers_begin() {
return Checkers.begin(); }
636 CheckersTy::const_iterator checkers_end() {
return Checkers.end(); }
640 llvm::TimeTraceScope TimeScope(
641 checkerScopeName(
"DeadSymbols", checkFn.Checker));
662 CheckDeadSymbolsContext
C(DeadSymbolsCheckers, SymReaper, S, Eng, K);
663 llvm::TimeTraceScope TimeScope(
"CheckerManager::runCheckersForDeadSymbols");
675 for (
const auto &RegionChangesChecker : RegionChangesCheckers) {
680 state = RegionChangesChecker(state, invalidated, ExplicitRegions, Regions,
693 assert((
Call !=
nullptr ||
696 "Call must not be NULL when escaping on call");
697 for (
const auto &PointerEscapeChecker : PointerEscapeCheckers) {
702 State = PointerEscapeChecker(State, Escaped,
Call, Kind, ETraits);
710 SVal Cond,
bool Assumption) {
711 for (
const auto &EvalAssumeChecker : EvalAssumeCheckers) {
716 state = EvalAssumeChecker(state, Cond, Assumption);
728 for (
auto *
const Pred : Src) {
729 std::optional<StringRef> evaluatorChecker;
735 for (
const auto &EvalCallChecker : EvalCallCheckers) {
741 bool evaluated =
false;
746 evaluated = EvalCallChecker(
Call,
C);
749 if (evaluated && evaluatorChecker) {
752 llvm::raw_string_ostream
OS(Buf);
756 std::string AssertionMessage = llvm::formatv(
757 "The '{0}' call has been already evaluated by the {1} checker, "
758 "while the {2} checker also tried to evaluate the same call. At "
759 "most one checker supposed to evaluate a call.",
761 EvalCallChecker.Checker->getDebugTag());
762 llvm_unreachable(AssertionMessage.c_str());
766 evaluatorChecker = EvalCallChecker.Checker->getDebugTag();
775 if (!evaluatorChecker) {
787 for (
const auto &EndOfTranslationUnitChecker : EndOfTranslationUnitCheckers)
788 EndOfTranslationUnitChecker(TU, mgr, BR);
796 Indent(Out, Space, IsDot) <<
"\"checker_messages\": ";
800 llvm::raw_svector_ostream TempOut(TempBuf);
801 unsigned int InnerSpace = Space + 2;
805 llvm::raw_svector_ostream NLOut(
NewLine);
806 NLOut <<
"\", " << NL;
807 Indent(NLOut, InnerSpace, IsDot) <<
"\"";
810 bool HasMessage =
false;
813 const void *LastCT =
nullptr;
814 for (
const auto &CT : CheckerTags) {
816 CT.second->printState(TempOut, State,
NewLine.c_str(),
"");
830 for (
const auto &CT : CheckerTags) {
832 CT.second->printState(TempOut, State,
NewLine.c_str(),
"");
837 Indent(Out, Space, IsDot) <<
"{ \"checker\": \"" << CT.second->getDebugTag()
838 <<
"\", \"messages\": [" << NL;
839 Indent(Out, InnerSpace, IsDot)
840 <<
'\"' << TempBuf.str().trim() <<
'\"' << NL;
841 Indent(Out, Space, IsDot) <<
"]}";
852 Indent(Out, --Space, IsDot) <<
"]";
865 DeclCheckerInfo info = { checkfn, isForDeclFn };
866 DeclCheckers.push_back(info);
870 BodyCheckers.push_back(checkfn);
879 StmtCheckerInfo info = { checkfn, isForStmtFn,
true };
880 StmtCheckers.push_back(info);
885 StmtCheckerInfo info = { checkfn, isForStmtFn,
false };
886 StmtCheckers.push_back(info);
890 PreObjCMessageCheckers.push_back(checkfn);
894 ObjCMessageNilCheckers.push_back(checkfn);
898 PostObjCMessageCheckers.push_back(checkfn);
902 PreCallCheckers.push_back(checkfn);
905 PostCallCheckers.push_back(checkfn);
909 LocationCheckers.push_back(checkfn);
913 BindCheckers.push_back(checkfn);
917 BlockEntranceCheckers.push_back(checkfn);
921 EndAnalysisCheckers.push_back(checkfn);
925 BeginFunctionCheckers.push_back(checkfn);
929 EndFunctionCheckers.push_back(checkfn);
934 BranchConditionCheckers.push_back(checkfn);
938 NewAllocatorCheckers.push_back(checkfn);
942 LiveSymbolsCheckers.push_back(checkfn);
946 DeadSymbolsCheckers.push_back(checkfn);
950 RegionChangesCheckers.push_back(checkfn);
954 PointerEscapeCheckers.push_back(checkfn);
959 PointerEscapeCheckers.push_back(checkfn);
963 EvalAssumeCheckers.push_back(checkfn);
967 EvalCallCheckers.push_back(checkfn);
972 EndOfTranslationUnitCheckers.push_back(checkfn);
980CheckerManager::getCachedStmtCheckersFor(
const Stmt *S,
bool isPreVisit) {
983 unsigned Key = (S->getStmtClass() << 1) |
unsigned(isPreVisit);
984 auto [CCI, Inserted] = CachedStmtCheckersMap.try_emplace(Key);
985 CachedStmtCheckers &Checkers = CCI->second;
988 for (
const auto &Info : StmtCheckers)
989 if (Info.IsPreVisit == isPreVisit && Info.IsForStmtFn(S))
990 Checkers.push_back(Info.CheckFn);
enum clang::sema::@1840::IndirectLocalPathEntry::EntryKind Kind
static void expandGraphWithCheckers(CHECK_CTX checkCtx, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
__device__ __2f16 float __ockl_bool s
Decl - This represents one declaration (or definition), e.g.
virtual bool hasBody() const
Returns true if this Decl represents a declaration for a body of code, such as a function or method d...
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
static ProgramPoint getProgramPoint(const Stmt *S, ProgramPoint::Kind K, const LocationContext *LC, const ProgramPointTag *tag)
ProgramPoint withTag(const ProgramPointTag *tag) const
Create a new ProgramPoint object that is the same as the original except for using the specified tag ...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Stmt - This represents one statement.
The top declaration context.
BugReporter is a utility class for generating PathDiagnostics for analysis.
Represents the memory allocation call in a C++ new-expression.
Represents an abstract call to a function or method along a particular path.
CallEventRef< T > cloneWithState(ProgramStateRef NewState) const
Returns a copy of this CallEvent, but using the given state.
ProgramPoint getProgramPoint(bool IsPreVisit=false, const ProgramPointTag *Tag=nullptr) const
Returns an appropriate ProgramPoint for this call.
CheckerBackend is an abstract base class that serves as the common ancestor of all the Checker<....
StringRef getDebugTag() const override
Attached to nodes created by this checker class when the ExplodedGraph is dumped for debugging.
A CheckerFrontend instance is what the user recognizes as "one checker": it has a public canonical na...
CheckerNameRef getName() const
void _registerForLiveSymbols(CheckLiveSymbolsFunc checkfn)
void _registerForEndOfTranslationUnit(CheckEndOfTranslationUnit checkfn)
void _registerForBeginFunction(CheckBeginFunctionFunc checkfn)
void _registerForNewAllocator(CheckNewAllocatorFunc checkfn)
void _registerForPreCall(CheckCallFunc checkfn)
void _registerForObjCMessageNil(CheckObjCMessageFunc checkfn)
bool(*)(const Decl *D) HandlesDeclFunc
void runCheckersForObjCMessage(ObjCMessageVisitKind visitKind, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng, bool wasInlined=false)
Run checkers for visiting obj-c messages.
void runCheckersOnASTDecl(const Decl *D, AnalysisManager &mgr, BugReporter &BR)
Run checkers handling Decls.
void _registerForDecl(CheckDeclFunc checkfn, HandlesDeclFunc isForDeclFn)
void _registerForPreObjCMessage(CheckObjCMessageFunc checkfn)
void runCheckersOnEndOfTranslationUnit(const TranslationUnitDecl *TU, AnalysisManager &mgr, BugReporter &BR)
Run checkers for the entire Translation Unit.
void runCheckersForEndFunction(NodeBuilderContext &BC, ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng, const ReturnStmt *RS)
Run checkers on end of function.
void _registerForEvalAssume(EvalAssumeFunc checkfn)
void _registerForEndAnalysis(CheckEndAnalysisFunc checkfn)
void _registerForBody(CheckDeclFunc checkfn)
DiagnosticsEngine & getDiagnostics() const
void runCheckersForLocation(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, SVal location, bool isLoad, const Stmt *NodeEx, const Stmt *BoundEx, ExprEngine &Eng)
Run checkers for load/store of a location.
void runCheckersForBind(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, SVal location, SVal val, const Stmt *S, bool AtDeclInit, ExprEngine &Eng, const ProgramPoint &PP)
Run checkers for binding of a value to a location.
void reportInvalidCheckerOptionValue(const CheckerFrontend *Checker, StringRef OptionName, StringRef ExpectedValueDesc) const
Emits an error through a DiagnosticsEngine about an invalid user supplied checker option value.
void runCheckersForEndAnalysis(ExplodedGraph &G, BugReporter &BR, ExprEngine &Eng)
Run checkers for end of analysis.
void runCheckersForPrintStateJson(raw_ostream &Out, ProgramStateRef State, const char *NL="\n", unsigned int Space=0, bool IsDot=false) const
Run checkers for debug-printing a ProgramState.
void _registerForDeadSymbols(CheckDeadSymbolsFunc checkfn)
void runCheckersForDeadSymbols(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, SymbolReaper &SymReaper, const Stmt *S, ExprEngine &Eng, ProgramPoint::Kind K)
Run checkers for dead symbols.
ProgramStateRef runCheckersForRegionChanges(ProgramStateRef state, const InvalidatedSymbols *invalidated, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const LocationContext *LCtx, const CallEvent *Call)
Run checkers for region changes.
void _registerForPostObjCMessage(CheckObjCMessageFunc checkfn)
void _registerForRegionChanges(CheckRegionChangesFunc checkfn)
bool hasPathSensitiveCheckers() const
void _registerForBind(CheckBindFunc checkfn)
void runCheckersForLiveSymbols(ProgramStateRef state, SymbolReaper &SymReaper)
Run checkers for live symbols.
void _registerForPointerEscape(CheckPointerEscapeFunc checkfn)
void _registerForPreStmt(CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn)
void runCheckersForEvalCall(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &CE, ExprEngine &Eng, const EvalCallOptions &CallOpts)
Run checkers for evaluating a call.
void _registerForPostStmt(CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn)
void runCheckersForBeginFunction(ExplodedNodeSet &Dst, const BlockEdge &L, ExplodedNode *Pred, ExprEngine &Eng)
Run checkers on beginning of function.
void runCheckersForNewAllocator(const CXXAllocatorCall &Call, ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng, bool wasInlined=false)
Run checkers between C++ operator new and constructor calls.
void _registerForBranchCondition(CheckBranchConditionFunc checkfn)
void runCheckersForBlockEntrance(ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const BlockEntrance &Entrance, ExprEngine &Eng) const
Run checkers after taking a control flow edge.
void runCheckersForStmt(bool isPreVisit, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng, bool wasInlined=false)
Run checkers for visiting Stmts.
CheckerFn< void(const BlockEntrance &, CheckerContext &)> CheckBlockEntranceFunc
void _registerForEvalCall(EvalCallFunc checkfn)
void _registerForEndFunction(CheckEndFunctionFunc checkfn)
void _registerForBlockEntrance(CheckBlockEntranceFunc checkfn)
void runCheckersForBranchCondition(const Stmt *condition, ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng)
Run checkers for branch condition.
void _registerForLocation(CheckLocationFunc checkfn)
ProgramStateRef runCheckersForPointerEscape(ProgramStateRef State, const InvalidatedSymbols &Escaped, const CallEvent *Call, PointerEscapeKind Kind, RegionAndSymbolInvalidationTraits *ITraits)
Run checkers when pointers escape.
void _registerForConstPointerEscape(CheckPointerEscapeFunc checkfn)
void runCheckersForCallEvent(bool isPreVisit, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false)
Run checkers for visiting obj-c messages.
bool(*)(const Stmt *D) HandlesStmtFunc
void _registerForPostCall(CheckCallFunc checkfn)
void runCheckersOnASTBody(const Decl *D, AnalysisManager &mgr, BugReporter &BR)
Run checkers handling Decls containing a Stmt body.
ProgramStateRef runCheckersForEvalAssume(ProgramStateRef state, SVal Cond, bool Assumption)
Run checkers for handling assumptions on symbolic values.
Simple checker classes that implement one frontend (i.e.
void insert(const ExplodedNodeSet &S)
const ProgramStateRef & getState() const
const LocationContext * getLocationContext() const
void defaultEvalCall(NodeBuilder &B, ExplodedNode *Pred, const CallEvent &Call, const EvalCallOptions &CallOpts={})
Default implementation of call evaluation.
const NodeBuilderContext & getBuilderContext()
This is the simplest builder which generates nodes in the ExplodedGraph.
Represents any expression that calls an Objective-C method.
Information about invalidation for a particular region/symbol.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
void dumpToStream(raw_ostream &OS) const
A class responsible for cleaning up unused symbols.
PointerEscapeKind
Describes the different reasons a pointer escapes during analysis.
@ PSK_DirectEscapeOnCall
The pointer has been passed to a function call directly.
@ PSK_IndirectEscapeOnCall
The pointer has been passed to a function indirectly.
@ OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject,...
llvm::DenseSet< SymbolRef > InvalidatedSymbols
The JSON file list parser is used to communicate input to InstallAPI.
Hints for figuring out of a call should be inlined during evalCall().