aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-20 04:23:38 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-20 04:23:38 +0000
commit8c036c7f77d69f96df49219ed0bdbade200d52eb (patch)
tree42a60273cdaf9151779429a5e169ecd21a06afd5 /lib/Analysis/BugReporter.cpp
parent82bae3f6bf7bc4733d9c87659b266e23ad55f420 (diff)
Add "category" to BugTypes, allowing bugs to be grouped.
Changed casing of many bug names. The convention will be to have bug names (mostly) lower cased, and categories use some capitalization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index b163eea1b8..6a1478a9cb 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -701,7 +701,8 @@ void BugReporter::EmitWarning(BugReport& R) {
if (R.getBugType().isCached(R))
return;
- llvm::OwningPtr<PathDiagnostic> D(new PathDiagnostic(R.getName()));
+ llvm::OwningPtr<PathDiagnostic> D(new PathDiagnostic(R.getName(),
+ R.getCategory()));
GeneratePathDiagnostic(*D.get(), R);
// Get the meta data.
@@ -764,12 +765,17 @@ void BugReporter::EmitWarning(BugReport& R) {
}
}
-void
-BugReporter::EmitBasicReport(const char* name, const char* str,
- SourceLocation Loc,
- SourceRange* RBeg, unsigned NumRanges) {
+void BugReporter::EmitBasicReport(const char* name, const char* str,
+ SourceLocation Loc,
+ SourceRange* RBeg, unsigned NumRanges) {
+ EmitBasicReport(name, "", str, Loc, RBeg, NumRanges);
+}
+
+void BugReporter::EmitBasicReport(const char* name, const char* category,
+ const char* str, SourceLocation Loc,
+ SourceRange* RBeg, unsigned NumRanges) {
- SimpleBugType BT(name);
+ SimpleBugType BT(name, category, 0);
DiagCollector C(BT);
Diagnostic& Diag = getDiagnostic();
Diag.Report(&C, getContext().getFullLoc(Loc),