[PATCH] [analyzer] Enable limited support for temporary destructors

Pavel Labath labath at google.com
Mon Sep 2 02:12:58 PDT 2013



================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:1362
@@ +1361,3 @@
+  // If the value is already available, we don't need to do anything.
+  if(Pred->getState()->getSVal(Condition, Pred->getLocationContext()).isUnknownOrUndef()) {
+    // Resolve the condition in the presence of nested '||' and '&&'.
----------------
Jordan Rose wrote:
> Please split this up into multiple lines, then. An `LCtx` local would go a long way. (Also, missing space after `if`.)
Done.

================
Comment at: lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:813-814
@@ +812,4 @@
+  // FIXME: Remove this once temp destructors are working.
+  if ((*currBldrCtx->getBlock())[currStmtIdx].getAs<CFGTemporaryDtor>())
+    return false;
+
----------------
Jordan Rose wrote:
> All I meant for this was add `if (isa<CXXDestructorDecl>(Call))` around the current check. Do you think that would be an improvement?
I don't know, I have no intuition about low-level optimizations such as this. But I have added it nonetheless. (Presumably, you meant   CXXDestructorCall).


http://llvm-reviews.chandlerc.com/D1259

COMMIT
  http://llvm-reviews.chandlerc.com/rL189746



More information about the cfe-commits mailing list