From: Artem Dergachev Date: Thu, 22 Mar 2018 22:05:53 +0000 (+0000) Subject: [analyzer] Enable temporary object destructor inlining by default. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df9f4af6265b805641eff4104feea9e5984d5371;p=clang [analyzer] Enable temporary object destructor inlining by default. 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 --- diff --git a/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp index d73bab4fe7..65231ea8ce 100644 --- a/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ b/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -263,7 +263,7 @@ bool AnalyzerOptions::mayInlineCXXSharedPtrDtor() { bool AnalyzerOptions::mayInlineCXXTemporaryDtors() { return getBooleanOption(InlineCXXTemporaryDtors, "c++-temp-dtor-inlining", - /*Default=*/false); + /*Default=*/true); } bool AnalyzerOptions::mayInlineObjCMethod() { diff --git a/test/Analysis/analyzer-config.cpp b/test/Analysis/analyzer-config.cpp index 72a79b21a6..888cd77eef 100644 --- a/test/Analysis/analyzer-config.cpp +++ b/test/Analysis/analyzer-config.cpp @@ -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