Add a bug category for NSError** checks.

llvm-svn: 56394
This commit is contained in:
Ted Kremenek 2008-09-21 06:57:40 +00:00
parent ebb4245b84
commit 33663885c3
2 changed files with 7 additions and 0 deletions

View 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);

View 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());