|
clang 22.0.0git
|
Public Types | |
| using | OwnerSet = llvm::SmallPtrSet<const MemRegion *, 8> |
Public Member Functions | |
| NoOwnershipChangeVisitor (SymbolRef Sym, const CheckerBackend *Checker) | |
| void | Profile (llvm::FoldingSetNodeID &ID) const override |
| Public Member Functions inherited from clang::ento::NoStateChangeFuncVisitor | |
| NoStateChangeFuncVisitor (bugreporter::TrackingKind TKind) | |
| PathDiagnosticPieceRef | VisitNode (const ExplodedNode *N, BugReporterContext &BR, PathSensitiveBugReport &R) final |
| Return a diagnostic piece which should be associated with the given node. | |
| Public Member Functions inherited from clang::ento::BugReporterVisitor | |
| BugReporterVisitor ()=default | |
| BugReporterVisitor (const BugReporterVisitor &)=default | |
| BugReporterVisitor (BugReporterVisitor &&) | |
| BugReporterVisitor & | operator= (const BugReporterVisitor &)=delete |
| BugReporterVisitor & | operator= (BugReporterVisitor &&)=delete |
| virtual | ~BugReporterVisitor () |
| virtual void | finalizeVisitor (BugReporterContext &BRC, const ExplodedNode *EndPathNode, PathSensitiveBugReport &BR) |
| Last function called on the visitor, no further calls to VisitNode would follow. | |
| virtual PathDiagnosticPieceRef | getEndPath (BugReporterContext &BRC, const ExplodedNode *N, PathSensitiveBugReport &BR) |
| Provide custom definition for the final diagnostic piece on the path - the piece, which is displayed before the path is expanded. | |
Protected Member Functions | |
| virtual bool | doesFnIntendToHandleOwnership (const Decl *Callee, ASTContext &ACtx)=0 |
| Heuristically guess whether the callee intended to free the resource. | |
| virtual bool | hasResourceStateChanged (ProgramStateRef CallEnterState, ProgramStateRef CallExitEndState)=0 |
| bool | wasModifiedInFunction (const ExplodedNode *CallEnterN, const ExplodedNode *CallExitEndN) final |
| virtual PathDiagnosticPieceRef | emitNote (const ExplodedNode *N)=0 |
| PathDiagnosticPieceRef | maybeEmitNoteForObjCSelf (PathSensitiveBugReport &R, const ObjCMethodCall &Call, const ExplodedNode *N) final |
| Consume the information on the non-modifying stack frame in order to either emit a note or not. | |
| PathDiagnosticPieceRef | maybeEmitNoteForCXXThis (PathSensitiveBugReport &R, const CXXConstructorCall &Call, const ExplodedNode *N) final |
| Consume the information on the non-modifying stack frame in order to either emit a note or not. | |
| 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. | |
| Protected Member Functions inherited from clang::ento::NoStateChangeFuncVisitor | |
| virtual bool | wasModifiedBeforeCallExit (const ExplodedNode *CurrN, const ExplodedNode *CallExitBeginN) |
Static Protected Member Functions | |
| static LLVM_DUMP_METHOD std::string | getFunctionName (const ExplodedNode *CallEnterN) |
Protected Attributes | |
| SymbolRef | Sym |
| const CheckerBackend & | Checker |
| Protected Attributes inherited from clang::ento::NoStateChangeFuncVisitor | |
| bugreporter::TrackingKind | TKind |
Additional Inherited Members | |
| Static Public Member Functions inherited from clang::ento::BugReporterVisitor | |
| static PathDiagnosticPieceRef | getDefaultEndPath (const BugReporterContext &BRC, const ExplodedNode *N, const PathSensitiveBugReport &BR) |
| Generates the default final diagnostic piece. | |
Definition at line 16 of file NoOwnershipChangeVisitor.h.
| using clang::ento::NoOwnershipChangeVisitor::OwnerSet = llvm::SmallPtrSet<const MemRegion *, 8> |
Definition at line 60 of file NoOwnershipChangeVisitor.h.
|
inline |
Definition at line 66 of file NoOwnershipChangeVisitor.h.
References Checker, clang::ento::NoStateChangeFuncVisitor::NoStateChangeFuncVisitor(), and Sym.
|
protectedpure virtual |
Heuristically guess whether the callee intended to free the resource.
This is done syntactically, because we are trying to argue about alternative paths of execution, and as a consequence we don't have path-sensitive information.
Referenced by wasModifiedInFunction().
|
protectedpure virtual |
Referenced by maybeEmitNoteForParameters().
|
staticprotected |
Definition at line 63 of file NoOwnershipChangeVisitor.cpp.
References clang::CallEnter::getCallExpr(), and clang::ento::ExplodedNode::getLocationAs().
|
protectedpure virtual |
Referenced by wasModifiedInFunction().
|
inlinefinalprotectedvirtual |
Consume the information on the non-modifying stack frame in order to either emit a note or not.
May suppress the report entirely.
Implements clang::ento::NoStateChangeFuncVisitor.
Definition at line 47 of file NoOwnershipChangeVisitor.h.
References clang::Call.
|
inlinefinalprotectedvirtual |
Consume the information on the non-modifying stack frame in order to either emit a note or not.
May suppress the report entirely.
Implements clang::ento::NoStateChangeFuncVisitor.
Definition at line 40 of file NoOwnershipChangeVisitor.h.
References clang::Call.
|
finalprotectedvirtual |
Consume the information on the non-modifying stack frame in order to either emit a note or not.
May suppress the report entirely.
Implements clang::ento::NoStateChangeFuncVisitor.
Definition at line 95 of file NoOwnershipChangeVisitor.cpp.
References clang::Call, emitNote(), Sym, and V.
|
inlineoverridevirtual |
Implements clang::ento::BugReporterVisitor.
Definition at line 70 of file NoOwnershipChangeVisitor.h.
References Sym.
|
finalprotectedvirtual |
CallEnterN and CallExitEndN. Mind that the stack frame retrieved from a CallEnterN and CallExitEndN is the caller's stack frame! The inlined function's stack should be retrieved from either the immediate successor to CallEnterN or immediate predecessor to CallExitEndN. Clients should override this function if a state changes local to the inlined function are not interesting, only the change occuring as a result of it. Example: we want to leave a not about a leaked resource object not being deallocated / its ownership changed inside a function, and we don't care if it was assigned to a local variable (its change in ownership is inconsequential). Reimplemented from clang::ento::NoStateChangeFuncVisitor.
Definition at line 71 of file NoOwnershipChangeVisitor.cpp.
References doesFnIntendToHandleOwnership(), clang::LocationContext::getDecl(), clang::ento::ExplodedNode::getFirstPred(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ExplodedNode::getState(), and hasResourceStateChanged().
|
protected |
Definition at line 20 of file NoOwnershipChangeVisitor.h.
Referenced by NoOwnershipChangeVisitor().
|
protected |
Definition at line 19 of file NoOwnershipChangeVisitor.h.
Referenced by maybeEmitNoteForParameters(), NoOwnershipChangeVisitor(), and Profile().