]> granicus.if.org Git - clang/commitdiff
Add a bug category for NSError** checks.
authorTed Kremenek <kremenek@apple.com>
Sun, 21 Sep 2008 06:57:40 +0000 (06:57 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 21 Sep 2008 06:57:40 +0000 (06:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56394 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/BugReporter.h
lib/Analysis/CheckNSError.cpp

index 7f2511f435dfc284e9412dbe6307d1933504ad73..bf9aa00fdb11efa81d878eae3e5199d26a43493f 100644 (file)
@@ -215,6 +215,11 @@ public:
     EmitBasicReport(BugName, BugStr, Loc, 0, 0);
   }
   
+  void EmitBasicReport(const char* BugName, const char* BugCategory,
+                       const char* BugStr, SourceLocation Loc) {
+    EmitBasicReport(BugName, BugCategory, BugStr, Loc, 0, 0);
+  }
+  
   void EmitBasicReport(const char* BugName, const char* BugStr,
                        SourceLocation Loc, SourceRange R) {
     EmitBasicReport(BugName, BugStr, Loc, &R, 1);
index 25f610e8331d746ffe5070ed2b31d4a8b0df4589..d4697aa7cd07f84a0a57de56f32c5f29991849df 100644 (file)
@@ -47,6 +47,7 @@ public:
   void EmitWarnings(BugReporter& BR) { EmitGRWarnings(cast<GRBugReporter>(BR));}
   const char* getName() const { return "NSError** null dereference"; }
   const char* getDescription() const { return desc; }
+  const char* getCategory() const { return "Coding Conventions (Apple)"; }
 };  
   
 } // end anonymous namespace
@@ -79,6 +80,7 @@ void NSErrorCheck::EmitGRWarnings(GRBugReporter& BR) {
   
   if (ResultTy == Ctx.VoidTy) {
     BR.EmitBasicReport("Bad return type when passing NSError**",
+              getCategory(),
               "Method accepting NSError** argument should have "
               "non-void return value to indicate that an error occurred.",
               CodeDecl.getLocation());