[cfe-commits] r161064 - /cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

Jordan Rose jordan_rose at apple.com
Tue Jul 31 11:22:40 PDT 2012


Author: jrose
Date: Tue Jul 31 13:22:40 2012
New Revision: 161064

URL: http://llvm.org/viewvc/llvm-project?rev=161064&view=rev
Log:
[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.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp?rev=161064&r1=161063&r2=161064&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp Tue Jul 31 13:22:40 2012
@@ -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 @@
   // 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 @@
     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 @@
     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;





More information about the cfe-commits mailing list