NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Looks great, thank you!



================
Comment at: lib/Analysis/CFG.cpp:1118
+    Expr::EvalResult Result;
+    if (!Constant->EvaluateAsInt(Result, *Context))
+      return {};
----------------
rtrieu wrote:
> NoQ wrote:
> > It's kinda strange to me that we first confirm that it's a constant by 
> > doing `tryTransformToIntOrEnumConstant`, but then fire up the heavy 
> > machinery of `EvaluateAsInt` anyway. Did you consider using only 
> > `EvaluateAsInt()` to begin with? I guess you're trying to make sure that 
> > "the user's intent is clear" as other similar warnings do, right? Could you 
> > comment on that?
> A new function has been created to check the zero-ness of the Expr.  Since we 
> know it the Expr comes from tryTransformToIntOrEnumConstant, this function 
> doesn't have to handle the full Expr sub-classes.
Whoa!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66046/new/

https://reviews.llvm.org/D66046



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to