]> granicus.if.org Git - clang/commitdiff
[analyzer] Control C++ inlining with a macro in ExprEngineCallAndReturn.cpp.
authorJordan Rose <jordan_rose@apple.com>
Tue, 31 Jul 2012 18:22:40 +0000 (18:22 +0000)
committerJordan Rose <jordan_rose@apple.com>
Tue, 31 Jul 2012 18:22:40 +0000 (18:22 +0000)
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

lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

index 00ea6daf4f10601ad14a8db9fef4650df37af95c..c1e010073c4e697eb4ac84d00b078e21bfaaafae 100644 (file)
@@ -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;