clang  10.0.0svn
Public Member Functions | List of all members
clang::ento::retaincountchecker::RefLeakReport Class Reference

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h"

Inheritance diagram for clang::ento::retaincountchecker::RefLeakReport:
Inheritance graph
Collaboration diagram for clang::ento::retaincountchecker::RefLeakReport:
Collaboration graph

Public Member Functions

 RefLeakReport (const RefCountBug &D, const LangOptions &LOpts, ExplodedNode *n, SymbolRef sym, CheckerContext &Ctx)
PathDiagnosticLocation getLocation () const override
 The primary location of the bug report that points at the undesirable behavior in the code. More...
PathDiagnosticLocation getEndOfPath () const
- Public Member Functions inherited from clang::ento::retaincountchecker::RefCountReport
 RefCountReport (const RefCountBug &D, const LangOptions &LOpts, ExplodedNode *n, SymbolRef sym, bool isLeak=false)
 RefCountReport (const RefCountBug &D, const LangOptions &LOpts, ExplodedNode *n, SymbolRef sym, StringRef endText)
ArrayRef< SourceRangegetRanges () const override
 Get the SourceRanges associated with the report. More...
- Public Member Functions inherited from clang::ento::PathSensitiveBugReport
 PathSensitiveBugReport (const BugType &bt, StringRef desc, const ExplodedNode *errorNode)
 PathSensitiveBugReport (const BugType &bt, StringRef shortDesc, StringRef desc, const ExplodedNode *errorNode)
 PathSensitiveBugReport (BugType &bt, StringRef desc, const ExplodedNode *errorNode, PathDiagnosticLocation LocationToUnique, const Decl *DeclToUnique)
 Create a PathSensitiveBugReport with a custom uniqueing location. More...
const ExplodedNodegetErrorNode () const
bool shouldPrunePath () const
 Indicates whether or not any path pruning should take place when generating a PathDiagnostic from this BugReport. More...
void disablePathPruning ()
 Disable all path pruning when generating a PathDiagnostic. More...
PathDiagnosticLocation getUniqueingLocation () const override
 Get the location on which the report should be uniqued. More...
const DeclgetUniqueingDecl () const override
 Get the declaration containing the uniqueing location. More...
const DeclgetDeclWithIssue () const override
 The smallest declaration that contains the bug location. More...
void markInteresting (SymbolRef sym, bugreporter::TrackingKind TKind=bugreporter::TrackingKind::Thorough)
 Marks a symbol as interesting. More...
void markInteresting (const MemRegion *R, bugreporter::TrackingKind TKind=bugreporter::TrackingKind::Thorough)
 Marks a region as interesting. More...
void markInteresting (SVal V, bugreporter::TrackingKind TKind=bugreporter::TrackingKind::Thorough)
 Marks a symbolic value as interesting. More...
void markInteresting (const LocationContext *LC)
bool isInteresting (SymbolRef sym) const
bool isInteresting (const MemRegion *R) const
bool isInteresting (SVal V) const
bool isInteresting (const LocationContext *LC) const
Optional< bugreporter::TrackingKind > getInterestingnessKind (SymbolRef sym) const
Optional< bugreporter::TrackingKind > getInterestingnessKind (const MemRegion *R) const
Optional< bugreporter::TrackingKind > getInterestingnessKind (SVal V) const
bool isValid () const
 Returns whether or not this report should be considered valid. More...
void markInvalid (const void *Tag, const void *Data)
 Marks the current report as invalid, meaning that it is probably a false positive and should not be reported to the user. More...
void Profile (llvm::FoldingSetNodeID &hash) const override
 Profile to identify equivalent bug reports for error report coalescing. More...
void addVisitor (std::unique_ptr< BugReporterVisitor > visitor)
 Add custom or predefined bug report visitors to this report. More...
void clearVisitors ()
 Remove all visitors attached to this bug report. More...
visitor_iterator visitor_begin ()
 Iterators through the custom diagnostic visitors. More...
visitor_iterator visitor_end ()
visitor_range visitors ()
bool addTrackedCondition (const ExplodedNode *Cond)
 Notes that the condition of the CFGBlock associated with Cond is being tracked. More...
void addCallStackHint (PathDiagnosticPieceRef Piece, std::unique_ptr< StackHintGenerator > StackHint)
bool hasCallStackHint (PathDiagnosticPieceRef Piece) const
std::string getCallStackMessage (PathDiagnosticPieceRef Piece, const ExplodedNode *N) const
 Produce the hint for the given node. More...
- Public Member Functions inherited from clang::ento::BugReport
virtual ~BugReport ()=default
Kind getKind () const
const BugTypegetBugType () const
StringRef getDescription () const
 A verbose warning message that is appropriate for displaying next to the source code that introduces the problem. More...
StringRef getShortDescription (bool UseFallback=true) const
 A short general warning message that is appropriate for displaying in the list of all reported bugs. More...
void addNote (StringRef Msg, const PathDiagnosticLocation &Pos, ArrayRef< SourceRange > Ranges={})
 Add new item to the list of additional notes that need to be attached to this report. More...
ArrayRef< std::shared_ptr< PathDiagnosticNotePiece > > getNotes ()
void addRange (SourceRange R)
 Add a range to a bug report. More...
void addFixItHint (const FixItHint &F)
 Add a fix-it hint to the bug report. More...
llvm::ArrayRef< FixItHintgetFixits () const

Additional Inherited Members

- Public Types inherited from clang::ento::PathSensitiveBugReport
using VisitorList = SmallVector< std::unique_ptr< BugReporterVisitor >, 8 >
using visitor_iterator = VisitorList::iterator
using visitor_range = llvm::iterator_range< visitor_iterator >
- Public Types inherited from clang::ento::BugReport
enum  Kind { Kind::Basic, Kind::PathSensitive }
- Static Public Member Functions inherited from clang::ento::PathSensitiveBugReport
static bool classof (const BugReport *R)
- Protected Types inherited from clang::ento::PathSensitiveBugReport
using InvalidationRecord = std::pair< const void *, const void * >
 Used to track unique reasons why a bug report might be invalid. More...
- Protected Member Functions inherited from clang::ento::PathSensitiveBugReport
const StmtgetStmt () const
- Protected Member Functions inherited from clang::ento::BugReport
 BugReport (Kind kind, const BugType &bt, StringRef desc)
 BugReport (Kind K, const BugType &BT, StringRef ShortDescription, StringRef Description)
- Protected Attributes inherited from clang::ento::retaincountchecker::RefCountReport
SymbolRef Sym
bool isLeak = false
- Protected Attributes inherited from clang::ento::PathSensitiveBugReport
const ExplodedNodeErrorNode = nullptr
 The ExplodedGraph node against which the report was thrown. More...
const SourceRange ErrorNodeRange
 The range that corresponds to ErrorNode's program point. More...
llvm::DenseMap< SymbolRef, bugreporter::TrackingKind > InterestingSymbols
 Profile to identify equivalent bug reports for error report coalescing. More...
llvm::DenseMap< const MemRegion *, bugreporter::TrackingKind > InterestingRegions
 A (stack of) set of regions that are registered with this report as being "interesting", and thus used to help decide which diagnostics to include when constructing the final path diagnostic. More...
llvm::SmallSet< const LocationContext *, 2 > InterestingLocationContexts
 A set of location contexts that correspoind to call sites which should be considered "interesting". More...
VisitorList Callbacks
 A set of custom visitors which generate "event" diagnostics at interesting points in the path. More...
llvm::FoldingSet< BugReporterVisitorCallbacksSet
 Used for ensuring the visitors are only added once. More...
bool DoNotPrunePath = false
 When set, this flag disables all callstack pruning from a diagnostic path. More...
llvm::SmallSet< InvalidationRecord, 4 > Invalidations
 If non-empty, this bug report is likely a false positive and should not be shown to the user. More...
llvm::SmallSet< const ExplodedNode *, 4 > TrackedConditions
 Conditions we're already tracking. More...
PathDiagnosticLocation UniqueingLocation
 Reports with different uniqueing locations are considered to be different for the purposes of deduplication. More...
const DeclUniqueingDecl
std::map< PathDiagnosticPieceRef, std::unique_ptr< StackHintGenerator > > StackHints
 If an event occurs in a different frame than the final diagnostic, supply a message that will be used to construct an extra hint on the returns from all the calls on the stack from this event to the final diagnostic. More...
- Protected Attributes inherited from clang::ento::BugReport
Kind K
const BugTypeBT
std::string ShortDescription
std::string Description
SmallVector< SourceRange, 4 > Ranges
SmallVector< std::shared_ptr< PathDiagnosticNotePiece >, 4 > Notes
SmallVector< FixItHint, 4 > Fixits

Detailed Description

Definition at line 77 of file RetainCountDiagnostics.h.

Constructor & Destructor Documentation

◆ RefLeakReport()

clang::ento::retaincountchecker::RefLeakReport::RefLeakReport ( const RefCountBug D,
const LangOptions LOpts,
ExplodedNode n,
SymbolRef  sym,
CheckerContext Ctx 

Member Function Documentation

◆ getEndOfPath()

PathDiagnosticLocation clang::ento::retaincountchecker::RefLeakReport::getEndOfPath ( ) const

◆ getLocation()

PathDiagnosticLocation clang::ento::retaincountchecker::RefLeakReport::getLocation ( ) const

The primary location of the bug report that points at the undesirable behavior in the code.

UIs should attach the warning description to this location. The warning description should describe the bad behavior at this location.

Reimplemented from clang::ento::PathSensitiveBugReport.

Definition at line 93 of file RetainCountDiagnostics.h.

References clang::ento::PathDiagnosticLocation::isValid().

The documentation for this class was generated from the following file: