]> granicus.if.org Git - clang/commit
[analyzer] Enable destructor inlining by default (c++-inlining=destructors).
authorJordan Rose <jordan_rose@apple.com>
Thu, 4 Apr 2013 23:10:29 +0000 (23:10 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 4 Apr 2013 23:10:29 +0000 (23:10 +0000)
commitb11a9086ebaf8e081daa8a6cd94ea99c97c027d2
tree1e26f33282f636908eda121e01e10d654246dd8d
parente45dfd15d9d821b0f2066bc0cad525eef2e307c3
[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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178805 91177308-0d34-0410-b5e6-96231b3b80d8
docs/analyzer/IPA.txt
lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
test/Analysis/alloc-match-dealloc.mm
test/Analysis/analyzer-config.cpp