[analyzer] Turn on C++ constructor inlining by default.
This enables constructor inlining for types with non-trivial destructors.
The plan is to enable destructor inlining within the next month, but that
needs further verification.
<rdar://problem/12295329>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176200 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/docs/analyzer/IPA.txt b/docs/analyzer/IPA.txt
index ac75ee1..4cffcb7 100644
--- a/docs/analyzer/IPA.txt
+++ b/docs/analyzer/IPA.txt
@@ -46,9 +46,10 @@
inlined as well; it doesn't make sense to inline destructors without inlining
constructors, for example.
-The default c++-inlining mode is 'methods', meaning only regular member
-functions and overloaded operators will be inlined. Note that no C++ member
-functions will be inlined under -analyzer-config ipa=none or
+The default c++-inlining mode is 'constructors', meaning that member functions,
+overloaded operators, and some constructors will be inlined. If a type has a
+non-trivial destructor, however, its constructor will not be inlined. Note that
+no C++ member functions will be inlined under -analyzer-config ipa=none or
-analyzer-config ipa=basic-inlining.
### c++-template-inlining ###
diff --git a/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index 2d6246e..5198f49 100644
--- a/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -74,7 +74,7 @@
static const char *ModeKey = "c++-inlining";
StringRef ModeStr(Config.GetOrCreateValue(ModeKey,
- "methods").getValue());
+ "constructors").getValue());
CXXInlineableMemberKind &MutableMode =
const_cast<CXXInlineableMemberKind &>(CXXMemberInliningMode);
diff --git a/test/Analysis/analyzer-config.cpp b/test/Analysis/analyzer-config.cpp
index 5270017..59587f6 100644
--- a/test/Analysis/analyzer-config.cpp
+++ b/test/Analysis/analyzer-config.cpp
@@ -11,7 +11,7 @@
};
// CHECK: [config]
-// CHECK-NEXT: c++-inlining = methods
+// CHECK-NEXT: c++-inlining = constructors
// CHECK-NEXT: c++-stdlib-inlining = true
// CHECK-NEXT: c++-template-inlining = true
// CHECK-NEXT: cfg-temporary-dtors = false