summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-29 21:58:13 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-29 21:58:13 +0000
commit47187c6ad22b5498459b3a0562443feeed260887 (patch)
tree2b61d3f4d17112fbd6a2795159c82c9a9648fbda /clang/lib/Analysis/BugReporter.cpp
parentbff0167a0bb6b60f1002d420c03242e97707ca21 (diff)
downloadbcm5719-llvm-47187c6ad22b5498459b3a0562443feeed260887.tar.gz
bcm5719-llvm-47187c6ad22b5498459b3a0562443feeed260887.zip
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 llvm-svn: 70415
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r--clang/lib/Analysis/BugReporter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index 3c814dbb67b..4e88baab574 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/lib/Analysis/BugReporter.cpp
@@ -1667,14 +1667,18 @@ void BugReporter::EmitReport(BugReport* R) {
void BugReporter::FlushReport(BugReportEquivClass& EQ) {
assert(!EQ.Reports.empty());
BugReport &R = **EQ.begin();
+ PathDiagnosticClient* PD = getPathDiagnosticClient();
// FIXME: Make sure we use the 'R' for the path that was actually used.
// Probably doesn't make a difference in practice.
BugType& BT = R.getBugType();
- llvm::OwningPtr<PathDiagnostic> D(new PathDiagnostic(R.getBugType().getName(),
- R.getDescription(),
- BT.getCategory()));
+ llvm::OwningPtr<PathDiagnostic>
+ D(new PathDiagnostic(R.getBugType().getName(),
+ PD->useVerboseDescription()
+ ? R.getDescription() : R.getShortDescription(),
+ BT.getCategory()));
+
GeneratePathDiagnostic(*D.get(), EQ);
// Get the meta data.
@@ -1682,7 +1686,6 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) {
for (const char** s = Meta.first; s != Meta.second; ++s) D->addMeta(*s);
// Emit a summary diagnostic to the regular Diagnostics engine.
- PathDiagnosticClient* PD = getPathDiagnosticClient();
const SourceRange *Beg = 0, *End = 0;
R.getRanges(*this, Beg, End);
Diagnostic& Diag = getDiagnostic();
OpenPOWER on IntegriCloud