summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-04-16 21:44:22 +0000
committerTed Kremenek <kremenek@apple.com>2013-04-16 21:44:22 +0000
commit8671acba9563e2fbf8627c6b9f58d022fee78458 (patch)
treea19b3030b6f4a47ac0e6b084cf53822c62dc37e8 /clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
parentc9cb7d2462d9e849cd6bc80889637ce2b7b31706 (diff)
downloadbcm5719-llvm-8671acba9563e2fbf8627c6b9f58d022fee78458.tar.gz
bcm5719-llvm-8671acba9563e2fbf8627c6b9f58d022fee78458.zip
[analyzer] Add experimental option "leak-diagnostics-reference-allocation".
This is an opt-in tweak for leak diagnostics to reference the allocation site if the diagnostic consumer only wants a pithy amount of information, and not the entire path. This is a strawman enhancement that I expect to see some experimentation with over the next week, and can go away if we don't want it. Currently it is only used by RetainCountChecker, but could be used by MallocChecker if and when we decide this should stay in. llvm-svn: 179634
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
new file mode 100644
index 00000000000..3dec8a58c92
--- /dev/null
+++ b/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp
@@ -0,0 +1,24 @@
+//=- AllocationDiagnostics.cpp - Config options for allocation diags *- C++ -*-//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Declares the configuration functions for leaks/allocation diagnostics.
+//
+//===--------------------------
+
+#include "AllocationDiagnostics.h"
+
+namespace clang {
+namespace ento {
+
+bool shouldIncludeAllocationSiteInLeakDiagnostics(AnalyzerOptions &AOpts) {
+ return AOpts.getBooleanOption("leak-diagnostics-reference-allocation",
+ false);
+}
+
+}}
OpenPOWER on IntegriCloud