14#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_RETAINCOUNTCHECKER_DIAGNOSTICS_H
15#define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_RETAINCOUNTCHECKER_DIAGNOSTICS_H
25namespace retaincountchecker {
28 StringRef ReportMessage;
32 bool SuppressOnSink =
false)
33 :
BugType(
CF, Desc, categories::MemoryRefCount, SuppressOnSink),
34 ReportMessage(ReportMsg) {}
41 this,
"Use-after-release",
42 "Reference-counted object is used after it is released"};
45 "Incorrect decrement of the reference count of an object that is not "
46 "owned at this point by the caller"};
48 this,
"-dealloc sent to non-exclusively owned object",
49 "-dealloc sent to object that may be referenced elsewhere"};
51 this,
"freeing non-exclusively owned object",
52 "'free' called on an object that may be referenced elsewhere"};
54 "Object autoreleased too many times"};
56 this,
"Method should return an owned object",
57 "Object with a +0 retain count returned to caller where a +1 (owning) "
58 "retain count is expected"};
76 bool IsReleaseUnowned =
false);
90 const MemRegion *AllocFirstBinding =
nullptr;
91 const MemRegion *AllocBindingToReport =
nullptr;
92 const Stmt *AllocStmt =
nullptr;
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Stmt - This represents one statement.
A CheckerFrontend instance is what the user recognizes as "one checker": it has a public canonical na...
MemRegion - The root abstract class for all memory regions.
PathDiagnosticLocation getLocation() const override
The primary location of the bug report that points at the undesirable behavior in the code.
ArrayRef< SourceRange > getRanges() const override
Get the SourceRanges associated with the report.
RefCountBug(const CheckerFrontend *CF, StringRef Desc, StringRef ReportMsg, bool SuppressOnSink=false)
StringRef getReportMessage() const
const RefCountBug DeallocNotOwned
const RefCountBug ReturnNotOwnedForOwned
const RefCountBug LeakWithinFunction
const RefCountBug ReleaseNotOwned
const RefCountBug OverAutorelease
const RefCountBug FreeNotOwned
const RefCountBug LeakAtReturn
const RefCountBug UseAfterRelease
ArrayRef< SourceRange > getRanges() const override
Get the SourceRanges associated with the report.
PathDiagnosticLocation getLocation() const override
The primary location of the bug report that points at the undesirable behavior in the code.
PathDiagnosticLocation getEndOfPath() const
@ CF
Indicates that the tracked object is a CF object.
The JSON file list parser is used to communicate input to InstallAPI.