15#include "llvm/ADT/SetOperations.h"
30 : Sym(Sym), Owners(Owners) {}
35 Owners.insert(Region);
39 LLVM_DUMP_METHOD
void dump()
const { dumpToStream(llvm::errs()); }
40 LLVM_DUMP_METHOD
void dumpToStream(llvm::raw_ostream &out)
const {
44 Owner->dumpToStream(out);
56 OwnershipBindingsHandler Handler{
Sym,
Ret};
57 State->getStateManager().getStoreManager().iterBindings(State->getStore(),
62LLVM_DUMP_METHOD std::string
64 if (
const CallExpr *CE = llvm::dyn_cast_or_null<CallExpr>(
67 return FD->getQualifiedNameAsString();
77 CallExitEndN->
getState()->getAnalysisManager().getASTContext()))
83 OwnerSet CurrOwners = getOwnersAtNode(CallEnterN);
84 OwnerSet ExitOwners = getOwnersAtNode(CallExitEndN);
92 return !llvm::set_is_subset(ExitOwners, CurrOwners);
102 for (
unsigned I = 0; I <
Call.getNumArgs() && I < Parameters.size(); ++I) {
104 if (
V.getAsSymbol() ==
Sym)
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
Represents a point when we begin processing an inlined call.
const Stmt * getCallExpr() const
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Decl - This represents one declaration (or definition), e.g.
Represents a function declaration or definition.
const Decl * getDecl() const
Represents an abstract call to a function or method along a particular path.
const ProgramStateRef & getState() const
const LocationContext * getLocationContext() const
std::optional< T > getLocationAs() const &
ExplodedNode * getFirstPred()
MemRegion - The root abstract class for all memory regions.
static LLVM_DUMP_METHOD std::string getFunctionName(const ExplodedNode *CallEnterN)
virtual bool doesFnIntendToHandleOwnership(const Decl *Callee, ASTContext &ACtx)=0
Heuristically guess whether the callee intended to free the resource.
llvm::SmallPtrSet< const MemRegion *, 8 > OwnerSet
bool wasModifiedInFunction(const ExplodedNode *CallEnterN, const ExplodedNode *CallExitEndN) final
PathDiagnosticPieceRef maybeEmitNoteForParameters(PathSensitiveBugReport &R, const CallEvent &Call, const ExplodedNode *N) final
Consume the information on the non-modifying stack frame in order to either emit a note or not.
virtual PathDiagnosticPieceRef emitNote(const ExplodedNode *N)=0
virtual bool hasResourceStateChanged(ProgramStateRef CallEnterState, ProgramStateRef CallExitEndState)=0
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
SymbolRef getAsSymbol(bool IncludeBaseRegions=false) const
If this SVal wraps a symbol return that SymbolRef.
virtual bool HandleBinding(StoreManager &SMgr, Store store, const MemRegion *region, SVal val)=0
const void * Store
Store - This opaque type encapsulates an immutable mapping from locations to values.
std::shared_ptr< PathDiagnosticPiece > PathDiagnosticPieceRef
bool Ret(InterpState &S, CodePtr &PC, APValue &Result)
The JSON file list parser is used to communicate input to InstallAPI.