summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-04-05 20:43:28 +0000
committerTed Kremenek <kremenek@apple.com>2012-04-05 20:43:28 +0000
commit6fd4505ad67a186da8cc26fdb493c93fe4937555 (patch)
tree43c5d7ef5184a071f8bc3b2d86152131b473ab4f /include
parent9091389771f46e531c9c42012f8e0ab5c072e336 (diff)
Require that all static analyzer issues have a category. As part of this change,
consolidate some commonly used category strings into global references (more of this can be done, I just did a few). Fixes <rdar://problem/11191537>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h24
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h19
2 files changed, 24 insertions, 19 deletions
diff --git a/include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h b/include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h
new file mode 100644
index 0000000000..9d4251b1a7
--- /dev/null
+++ b/include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h
@@ -0,0 +1,24 @@
+//=--- CommonBugCategories.h - Provides common issue categories -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_STATIC_ANALYZER_CHECKER_CATEGORIES_H
+#define LLVM_CLANG_STATIC_ANALYZER_CHECKER_CATEGORIES_H
+
+// Common strings used for the "category" of many static analyzer issues.
+namespace clang {
+ namespace ento {
+ namespace categories {
+ extern const char *CoreFoundationObjectiveC;
+ extern const char *MemoryCoreFoundationObjectiveC;
+ extern const char *UnixAPI;
+ }
+ }
+}
+#endif
+
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
index 9890a808ad..2b699a85f8 100644
--- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -358,22 +358,10 @@ public:
void EmitReport(BugReport *R);
void EmitBasicReport(const Decl *DeclWithIssue,
- StringRef BugName, StringRef BugStr,
- PathDiagnosticLocation Loc,
- SourceRange* RangeBeg, unsigned NumRanges);
-
- void EmitBasicReport(const Decl *DeclWithIssue,
StringRef BugName, StringRef BugCategory,
StringRef BugStr, PathDiagnosticLocation Loc,
SourceRange* RangeBeg, unsigned NumRanges);
-
- void EmitBasicReport(const Decl *DeclWithIssue,
- StringRef BugName, StringRef BugStr,
- PathDiagnosticLocation Loc) {
- EmitBasicReport(DeclWithIssue, BugName, BugStr, Loc, 0, 0);
- }
-
void EmitBasicReport(const Decl *DeclWithIssue,
StringRef BugName, StringRef BugCategory,
StringRef BugStr, PathDiagnosticLocation Loc) {
@@ -381,13 +369,6 @@ public:
}
void EmitBasicReport(const Decl *DeclWithIssue,
- StringRef BugName, StringRef BugStr,
- PathDiagnosticLocation Loc,
- SourceRange R) {
- EmitBasicReport(DeclWithIssue, BugName, BugStr, Loc, &R, 1);
- }
-
- void EmitBasicReport(const Decl *DeclWithIssue,
StringRef BugName, StringRef Category,
StringRef BugStr, PathDiagnosticLocation Loc,
SourceRange R) {