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
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index b163eea..6a1478a 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -701,7 +701,8 @@
   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::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);
+}
   
-  SimpleBugType BT(name);
+void BugReporter::EmitBasicReport(const char* name, const char* category,
+                                  const char* str, SourceLocation Loc,
+                                  SourceRange* RBeg, unsigned NumRanges) {
+  
+  SimpleBugType BT(name, category, 0);
   DiagCollector C(BT);
   Diagnostic& Diag = getDiagnostic();
   Diag.Report(&C, getContext().getFullLoc(Loc),