[PATCH] [analyzer] Refactor conditional expression evaluating code

Pavel Labath labath at google.com
Tue Aug 20 10:19:09 PDT 2013

  I have a reservation about one of the comments. I will fix the rest of the issues in a new version of the patch (probably tomorrow).

Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:534
@@ +533,3 @@
+  SValBuilder &SVB = State->getStateManager().getSValBuilder();
+  return State->BindExpr(E, LC, SVB.evalCast(X, B->getType(), XType));
Jordan Rose wrote:
> Rather than have this bind anything, why not just return the properly-casted value?
For this patch, I could indeed just return the correct SVal. However, here I am also preparing the ground for the second patch. For that, I need the value to be stored in the state, so that I can later query them when I run through the temporary destructor branches. So, in theory I could do the binding only when cfg-temporary-dtors is true, but I'm not sure if that's worth the increased code complexity.


More information about the cfe-commits mailing list