diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-04-04 23:10:29 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-04-04 23:10:29 +0000 |
commit | 2de3daa0a288936154215d96fa106d5728b78164 (patch) | |
tree | b774744f017e736dc6613c5681defe3cd0d26302 /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | |
parent | 322f41d09546bd50134e705f8db15c9768a97c01 (diff) | |
download | bcm5719-llvm-2de3daa0a288936154215d96fa106d5728b78164.tar.gz bcm5719-llvm-2de3daa0a288936154215d96fa106d5728b78164.zip |
[analyzer] Enable destructor inlining by default (c++-inlining=destructors).
This turns on not only destructor inlining, but inlining of constructors
for types with non-trivial destructors. Per r178516, we will still not
inline the constructor or destructor of anything that looks like a
container unless the analyzer-config option 'c++-container-inlining' is
set to 'true'.
In addition to the more precise path-sensitive model, this allows us to
catch simple smart pointer issues:
#include <memory>
void test() {
std::auto_ptr<int> releaser(new int[4]);
} // memory allocated with 'new[]' should not be deleted with 'delete'
<rdar://problem/12295363>
llvm-svn: 178805
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp index 64e1bae8b95..ae707395fc5 100644 --- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -74,7 +74,7 @@ AnalyzerOptions::mayInlineCXXMemberFunction(CXXInlineableMemberKind K) { static const char *ModeKey = "c++-inlining"; StringRef ModeStr(Config.GetOrCreateValue(ModeKey, - "constructors").getValue()); + "destructors").getValue()); CXXInlineableMemberKind &MutableMode = const_cast<CXXInlineableMemberKind &>(CXXMemberInliningMode); |