diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-04-29 21:58:13 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-04-29 21:58:13 +0000 |
commit | d49967f8764135ae65658e354b6d38e3637c9de3 (patch) | |
tree | d1845d72b378da782b4cf5da22a0880841c301cc /include/clang/Analysis/PathSensitive/BugReporter.h | |
parent | 6e5201b71dcf5e98d2ac4e14bebf5b4080120bb6 (diff) |
BugReporter/PathDiagnostics:
- Add an (optional) short description for BugReports for clients that want
to distinguish between long and short descriptions for bugs
- Make the bug report for VLA less obscene for Plist diagnostics by using
the short description
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive/BugReporter.h')
-rw-r--r-- | include/clang/Analysis/PathSensitive/BugReporter.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index 85430e366e..f941a7a570 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -48,6 +48,7 @@ class ParentMap; class BugReport { protected: BugType& BT; + std::string ShortDescription; std::string Description; const ExplodedNode<GRState> *EndNode; SourceRange R; @@ -70,6 +71,11 @@ public: BugReport(BugType& bt, const char* desc, const ExplodedNode<GRState> *n) : BT(bt), Description(desc), EndNode(n) {} + + BugReport(BugType& bt, const char* shortDesc, const char* desc, + const ExplodedNode<GRState> *n) + : BT(bt), ShortDescription(shortDesc), Description(desc), EndNode(n) {} + virtual ~BugReport(); @@ -84,6 +90,10 @@ public: Stmt* getStmt(BugReporter& BR) const; const std::string& getDescription() const { return Description; } + + const std::string& getShortDescription() const { + return ShortDescription.empty() ? Description : ShortDescription; + } // FIXME: Is this needed? virtual std::pair<const char**,const char**> getExtraDescriptiveText() { @@ -197,6 +207,10 @@ public: RangedBugReport(BugType& D, const char* description, ExplodedNode<GRState> *n) : BugReport(D, description, n) {} + RangedBugReport(BugType& D, const char *shortDescription, + const char *description, ExplodedNode<GRState> *n) + : BugReport(D, shortDescription, description, n) {} + ~RangedBugReport(); // FIXME: Move this out of line. |