diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-31 18:22:40 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-31 18:22:40 +0000 |
commit | 2f9c40a915593849f6b0f5c4de516e2f597d0d66 (patch) | |
tree | fc58085b0281f0317f92f775b50e2e03d25ebb96 /lib | |
parent | e1ce783708b65eaa832ffad03d239264046dd0eb (diff) |
[analyzer] Control C++ inlining with a macro in ExprEngineCallAndReturn.cpp.
For now this will stay on, but this way it's easy to switch off if we need
to pull back our support for a while.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index 00ea6daf4f..c1e010073c 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -19,6 +19,8 @@ #include "llvm/ADT/SmallSet.h" #include "llvm/Support/SaveAndRestore.h" +#define CXX_INLINING_ENABLED 1 + using namespace clang; using namespace ento; @@ -287,11 +289,16 @@ bool ExprEngine::inlineCall(const CallEvent &Call, // FIXME: Refactor this check into a hypothetical CallEvent::canInline. switch (Call.getKind()) { case CE_Function: + break; case CE_CXXMember: case CE_CXXMemberOperator: - // These are always at least possible to inline. + if (!CXX_INLINING_ENABLED) + return false; break; case CE_CXXConstructor: { + if (!CXX_INLINING_ENABLED) + return false; + // Only inline constructors and destructors if we built the CFGs for them // properly. const AnalysisDeclContext *ADC = CallerSFC->getAnalysisDeclContext(); @@ -316,6 +323,9 @@ bool ExprEngine::inlineCall(const CallEvent &Call, break; } case CE_CXXDestructor: { + if (!CXX_INLINING_ENABLED) + return false; + // Only inline constructors and destructors if we built the CFGs for them // properly. const AnalysisDeclContext *ADC = CallerSFC->getAnalysisDeclContext(); @@ -333,6 +343,9 @@ bool ExprEngine::inlineCall(const CallEvent &Call, break; } case CE_CXXAllocator: + if (!CXX_INLINING_ENABLED) + return false; + // Do not inline allocators until we model deallocators. // This is unfortunate, but basically necessary for smart pointers and such. return false; |