summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2014-06-27 01:03:05 +0000
committerAnna Zaks <ganna@apple.com>2014-06-27 01:03:05 +0000
commitb8de0c4278b638163f6b5103b2eadcb6590f8dfd (patch)
tree04eb77aa35d53924bd503ebdc313d55a60606c0b /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
parent25dadfd2a84ca787f64196a826fc7114626a63b2 (diff)
downloadbcm5719-llvm-b8de0c4278b638163f6b5103b2eadcb6590f8dfd.tar.gz
bcm5719-llvm-b8de0c4278b638163f6b5103b2eadcb6590f8dfd.zip
Do not inline methods of C++ containers (coming from headers).
This silences false positives (leaks, use of uninitialized value) in simple code that uses containers such as std::vector and std::list. The analyzer cannot reason about the internal invariances of those data structures which leads to false positives. Until we come up with a better solution to that problem, let's just not inline the methods of the containers and allow objects to escape whenever such methods are called. This just extends an already existing flag "c++-container-inlining" and applies the heuristic not only to constructors and destructors of the containers, but to all of their methods. We have a bunch of distinct user reports all related to this issue (radar://16058651, radar://16580751, radar://16384286, radar://16795491 [PR19637]). llvm-svn: 211832
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index 85d66ba600f..7944c7eb000 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -140,8 +140,8 @@ bool AnalyzerOptions::mayInlineCXXAllocator() {
/*Default=*/false);
}
-bool AnalyzerOptions::mayInlineCXXContainerCtorsAndDtors() {
- return getBooleanOption(InlineCXXContainerCtorsAndDtors,
+bool AnalyzerOptions::mayInlineCXXContainerMethods() {
+ return getBooleanOption(InlineCXXContainerMethods,
"c++-container-inlining",
/*Default=*/false);
}
OpenPOWER on IntegriCloud