clang API Documentation
#include <BugReporter.h>


Classes | |
| class | NodeResolver |
Public Types | |
| typedef const SourceRange * | ranges_iterator |
| typedef SmallVector < BugReporterVisitor *, 8 > | VisitorList |
| typedef VisitorList::iterator | visitor_iterator |
| typedef SmallVector< StringRef, 2 > | ExtraTextList |
Public Member Functions | |
| BugReport (BugType &bt, StringRef desc, const ExplodedNode *errornode) | |
| BugReport (BugType &bt, StringRef shortDesc, StringRef desc, const ExplodedNode *errornode) | |
| BugReport (BugType &bt, StringRef desc, PathDiagnosticLocation l) | |
| BugReport (BugType &bt, StringRef desc, const ExplodedNode *errornode, PathDiagnosticLocation LocationToUnique) | |
| Create a BugReport with a custom uniqueing location. | |
| virtual | ~BugReport () |
| const BugType & | getBugType () const |
| BugType & | getBugType () |
| const ExplodedNode * | getErrorNode () const |
| const StringRef | getDescription () const |
| const StringRef | getShortDescription () const |
| void | markInteresting (SymbolRef sym) |
| void | markInteresting (const MemRegion *R) |
| void | markInteresting (SVal V) |
| bool | isInteresting (SymbolRef sym) const |
| bool | isInteresting (const MemRegion *R) const |
| bool | isInteresting (SVal V) const |
| unsigned | getConfigurationChangeToken () const |
| const Decl * | getDeclWithIssue () const |
| void | setDeclWithIssue (const Decl *declWithIssue) |
| void | addExtraText (StringRef S) |
| This allows for addition of meta data to the diagnostic. | |
| virtual const ExtraTextList & | getExtraText () |
| virtual PathDiagnosticLocation | getLocation (const SourceManager &SM) const |
| Return the "definitive" location of the reported bug. | |
| const Stmt * | getStmt () const |
| void | addRange (SourceRange R) |
| Add a range to a bug report. | |
| virtual std::pair < ranges_iterator, ranges_iterator > | getRanges () |
| Get the SourceRanges associated with the report. | |
| void | addVisitor (BugReporterVisitor *visitor) |
| Add custom or predefined bug report visitors to this report. | |
| visitor_iterator | visitor_begin () |
| Iterators through the custom diagnostic visitors. | |
| visitor_iterator | visitor_end () |
| virtual void | Profile (llvm::FoldingSetNodeID &hash) const |
Protected Types | |
| typedef llvm::DenseSet< SymbolRef > | Symbols |
| typedef llvm::DenseSet< const MemRegion * > | Regions |
Protected Attributes | |
| BugType & | BT |
| const Decl * | DeclWithIssue |
| std::string | ShortDescription |
| std::string | Description |
| PathDiagnosticLocation | Location |
| PathDiagnosticLocation | UniqueingLocation |
| const ExplodedNode * | ErrorNode |
| SmallVector< SourceRange, 4 > | Ranges |
| ExtraTextList | ExtraText |
| Symbols | interestingSymbols |
| Regions | interestingRegions |
| VisitorList | Callbacks |
| llvm::FoldingSet < BugReporterVisitor > | CallbacksSet |
| Used for ensuring the visitors are only added once. | |
| unsigned | ConfigurationChangeToken |
Friends | |
| class | BugReporter |
| class | BugReportEquivClass |
This class provides an interface through which checkers can create individual bug reports.
Definition at line 52 of file BugReporter.h.
| typedef SmallVector<StringRef, 2> clang::ento::BugReport::ExtraTextList |
Definition at line 65 of file BugReporter.h.
| typedef const SourceRange* clang::ento::BugReport::ranges_iterator |
Definition at line 62 of file BugReporter.h.
typedef llvm::DenseSet<const MemRegion *> clang::ento::BugReport::Regions [protected] |
Definition at line 82 of file BugReporter.h.
typedef llvm::DenseSet<SymbolRef> clang::ento::BugReport::Symbols [protected] |
Definition at line 81 of file BugReporter.h.
| typedef VisitorList::iterator clang::ento::BugReport::visitor_iterator |
Definition at line 64 of file BugReporter.h.
| typedef SmallVector<BugReporterVisitor *, 8> clang::ento::BugReport::VisitorList |
Definition at line 63 of file BugReporter.h.
| clang::ento::BugReport::BugReport | ( | BugType & | bt, |
| StringRef | desc, | ||
| const ExplodedNode * | errornode | ||
| ) | [inline] |
Definition at line 106 of file BugReporter.h.
Referenced by FindReportInEquivalenceClass().
| clang::ento::BugReport::BugReport | ( | BugType & | bt, |
| StringRef | shortDesc, | ||
| StringRef | desc, | ||
| const ExplodedNode * | errornode | ||
| ) | [inline] |
Definition at line 110 of file BugReporter.h.
| clang::ento::BugReport::BugReport | ( | BugType & | bt, |
| StringRef | desc, | ||
| PathDiagnosticLocation | l | ||
| ) | [inline] |
Definition at line 115 of file BugReporter.h.
| clang::ento::BugReport::BugReport | ( | BugType & | bt, |
| StringRef | desc, | ||
| const ExplodedNode * | errornode, | ||
| PathDiagnosticLocation | LocationToUnique | ||
| ) | [inline] |
Create a BugReport with a custom uniqueing location.
The reports that have the same report location, description, bug type, and ranges are uniqued - only one of the equivalent reports will be presented to the user. This method allows to rest the location which should be used for uniquing reports. For example, memory leaks checker, could set this to the allocation site, rather then the location where the bug is reported.
Definition at line 126 of file BugReporter.h.
| BugReport::~BugReport | ( | ) | [virtual] |
Definition at line 1331 of file BugReporter.cpp.
References visitor_begin(), and visitor_end().
| void clang::ento::BugReport::addExtraText | ( | StringRef | S | ) | [inline] |
This allows for addition of meta data to the diagnostic.
Currently, only the HTMLDiagnosticClient knows how to display it.
Definition at line 170 of file BugReporter.h.
References ExtraText.
| void clang::ento::BugReport::addRange | ( | SourceRange | R | ) | [inline] |
Add a range to a bug report.
Ranges are used to highlight regions of interest in the source code. They should be at the same source code line as the BugReport location. By default, the source range of the statement corresponding to the error node will be used; add a single invalid range to specify absence of ranges.
Definition at line 194 of file BugReporter.h.
References clang::SourceRange::isValid(), and Ranges.
Referenced by getRanges().
| void BugReport::addVisitor | ( | BugReporterVisitor * | visitor | ) |
Add custom or predefined bug report visitors to this report.
The visitors should be used when the default trace is not sufficient. For example, they allow constructing a more elaborate trace.
Definition at line 1313 of file BugReporter.cpp.
References Callbacks, CallbacksSet, ConfigurationChangeToken, and clang::ento::BugReporterVisitor::Profile().
Referenced by clang::ento::FindLastStoreBRVisitor::registerStatementVarDecls().
| const BugType& clang::ento::BugReport::getBugType | ( | ) | const [inline] |
Definition at line 134 of file BugReporter.h.
References BT.
| BugType& clang::ento::BugReport::getBugType | ( | ) | [inline] |
Definition at line 135 of file BugReporter.h.
References BT.
| unsigned clang::ento::BugReport::getConfigurationChangeToken | ( | ) | const [inline] |
Definition at line 153 of file BugReporter.h.
References ConfigurationChangeToken.
| const Decl* clang::ento::BugReport::getDeclWithIssue | ( | ) | const |
Return the canonical declaration, be it a method or class, where this issue semantically occurred.
| const StringRef clang::ento::BugReport::getDescription | ( | ) | const [inline] |
Definition at line 139 of file BugReporter.h.
References Description.
Referenced by clang::ento::BugReporterVisitor::getDefaultEndPath().
| const ExplodedNode* clang::ento::BugReport::getErrorNode | ( | ) | const [inline] |
Definition at line 137 of file BugReporter.h.
References ErrorNode.
Referenced by clang::ento::FindLastStoreBRVisitor::registerStatementVarDecls().
| virtual const ExtraTextList& clang::ento::BugReport::getExtraText | ( | ) | [inline, virtual] |
Definition at line 174 of file BugReporter.h.
References ExtraText.
| virtual PathDiagnosticLocation clang::ento::BugReport::getLocation | ( | const SourceManager & | SM | ) | const [virtual] |
Return the "definitive" location of the reported bug.
While a bug can span an entire path, usually there is a specific location that can be used to identify where the key issue occurred. This location is used by clients rendering diagnostics.
| std::pair< BugReport::ranges_iterator, BugReport::ranges_iterator > BugReport::getRanges | ( | ) | [virtual] |
Get the SourceRanges associated with the report.
Definition at line 1445 of file BugReporter.cpp.
References addRange(), getStmt(), and Ranges.
Referenced by clang::ento::BugReporterVisitor::getDefaultEndPath().
| const StringRef clang::ento::BugReport::getShortDescription | ( | ) | const [inline] |
Definition at line 141 of file BugReporter.h.
References Description, and ShortDescription.
| const Stmt* clang::ento::BugReport::getStmt | ( | ) | const |
Referenced by getRanges().
| bool clang::ento::BugReport::isInteresting | ( | SymbolRef | sym | ) | const |
| bool clang::ento::BugReport::isInteresting | ( | const MemRegion * | R | ) | const |
| bool clang::ento::BugReport::isInteresting | ( | SVal | V | ) | const |
| void BugReport::markInteresting | ( | SymbolRef | sym | ) |
Definition at line 1371 of file BugReporter.cpp.
References ConfigurationChangeToken, interestingRegions, and interestingSymbols.
Referenced by markInteresting().
| void BugReport::markInteresting | ( | const MemRegion * | R | ) |
Definition at line 1383 of file BugReporter.cpp.
References ConfigurationChangeToken, clang::ento::MemRegion::getBaseRegion(), interestingRegions, and interestingSymbols.
| void BugReport::markInteresting | ( | SVal | V | ) |
Definition at line 1396 of file BugReporter.cpp.
References clang::ento::SVal::getAsRegion(), clang::ento::SVal::getAsSymbol(), and markInteresting().
| virtual void clang::ento::BugReport::Profile | ( | llvm::FoldingSetNodeID & | hash | ) | const [virtual] |
Profile to identify equivalent bug reports for error report coalescing. Reports are uniqued to ensure that we do not emit multiple diagnostics for each bug.
| void clang::ento::BugReport::setDeclWithIssue | ( | const Decl * | declWithIssue | ) | [inline] |
Specifically set the Decl where an issue occurred. This isn't necessary for BugReports that cover a path as it will be automatically inferred.
Definition at line 163 of file BugReporter.h.
References DeclWithIssue.
| visitor_iterator clang::ento::BugReport::visitor_begin | ( | ) | [inline] |
Iterators through the custom diagnostic visitors.
Definition at line 213 of file BugReporter.h.
References Callbacks.
Referenced by ~BugReport().
| visitor_iterator clang::ento::BugReport::visitor_end | ( | ) | [inline] |
friend class BugReportEquivClass [friend] |
Definition at line 69 of file BugReporter.h.
friend class BugReporter [friend] |
Definition at line 68 of file BugReporter.h.
BugType& clang::ento::BugReport::BT [protected] |
Definition at line 71 of file BugReporter.h.
Referenced by getBugType().
VisitorList clang::ento::BugReport::Callbacks [protected] |
A set of custom visitors which generate "event" diagnostics at interesting points in the path.
Definition at line 96 of file BugReporter.h.
Referenced by addVisitor(), visitor_begin(), and visitor_end().
llvm::FoldingSet<BugReporterVisitor> clang::ento::BugReport::CallbacksSet [protected] |
Used for ensuring the visitors are only added once.
Definition at line 99 of file BugReporter.h.
Referenced by addVisitor().
unsigned clang::ento::BugReport::ConfigurationChangeToken [protected] |
Used for clients to tell if the report's configuration has changed since the last time they checked.
Definition at line 103 of file BugReporter.h.
Referenced by addVisitor(), getConfigurationChangeToken(), and markInteresting().
const Decl* clang::ento::BugReport::DeclWithIssue [protected] |
Definition at line 72 of file BugReporter.h.
Referenced by setDeclWithIssue().
std::string clang::ento::BugReport::Description [protected] |
Definition at line 74 of file BugReporter.h.
Referenced by getDescription(), and getShortDescription().
const ExplodedNode* clang::ento::BugReport::ErrorNode [protected] |
Definition at line 77 of file BugReporter.h.
Referenced by getErrorNode().
ExtraTextList clang::ento::BugReport::ExtraText [protected] |
Definition at line 79 of file BugReporter.h.
Referenced by addExtraText(), and getExtraText().
Regions clang::ento::BugReport::interestingRegions [protected] |
A 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.
Definition at line 92 of file BugReporter.h.
Referenced by markInteresting().
Symbols clang::ento::BugReport::interestingSymbols [protected] |
A set of symbols 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.
Definition at line 87 of file BugReporter.h.
Referenced by markInteresting().
Definition at line 75 of file BugReporter.h.
SmallVector<SourceRange, 4> clang::ento::BugReport::Ranges [protected] |
Definition at line 78 of file BugReporter.h.
Referenced by addRange(), and getRanges().
std::string clang::ento::BugReport::ShortDescription [protected] |
Definition at line 73 of file BugReporter.h.
Referenced by getShortDescription().
Definition at line 76 of file BugReporter.h.