]> granicus.if.org Git - clang/commitdiff
[analyzer] Enable temporary object destructor inlining by default.
authorArtem Dergachev <artem.dergachev@gmail.com>
Thu, 22 Mar 2018 22:05:53 +0000 (22:05 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Thu, 22 Mar 2018 22:05:53 +0000 (22:05 +0000)
When a temporary is constructed with a proper construction context, it should
be safe to inline the destructor. We have added suppressions for some of the
common false positives caused by such inlining, so there should be - and from my
observations there indeed is - more benefit than harm from enabling destructor
inlining.

Differential Revision: https://reviews.llvm.org/D44721

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328258 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
test/Analysis/analyzer-config.cpp

index d73bab4fe72dc57051b9b1729e7bdf59d5bdc97f..65231ea8ce7880b941d9e3278ea84dc8e4b5e2b5 100644 (file)
@@ -263,7 +263,7 @@ bool AnalyzerOptions::mayInlineCXXSharedPtrDtor() {
 bool AnalyzerOptions::mayInlineCXXTemporaryDtors() {
   return getBooleanOption(InlineCXXTemporaryDtors,
                           "c++-temp-dtor-inlining",
-                          /*Default=*/false);
+                          /*Default=*/true);
 }
 
 bool AnalyzerOptions::mayInlineObjCMethod() {
index 72a79b21a603f5a9e9c99ee505a4961dd83b9282..888cd77eef05434b6e116f7598e22728a296e11b 100644 (file)
@@ -23,7 +23,7 @@ public:
 // CHECK-NEXT: c++-inlining = destructors
 // CHECK-NEXT: c++-shared_ptr-inlining = false
 // CHECK-NEXT: c++-stdlib-inlining = true
-// CHECK-NEXT: c++-temp-dtor-inlining = false
+// CHECK-NEXT: c++-temp-dtor-inlining = true
 // CHECK-NEXT: c++-template-inlining = true
 // CHECK-NEXT: cfg-conditional-static-initializers = true
 // CHECK-NEXT: cfg-implicit-dtors = true