[PATCH] D115670: Correct behavior of Vector boolean-operations, implement vector operator-

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 15 08:15:53 PST 2021


erichkeane added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:10389
+    return false;
+  case UO_Minus: {
+    for (unsigned EltNum = 0; EltNum < VD->getNumElements(); ++EltNum) {
----------------
aaron.ballman wrote:
> Would it be worth handling ~ and ! as well given that they seem pretty trivial to support? I don't insist, but I'm trying to reason whether the `for` loop should be hoisted out of the `switch` because it seems like it'll be needed for all of the cases.
Yep, I can take a look at that.  Note the rest of the unary operators are all either already handled (real/imag), or require switching this over to an LValueBase/etc as they are modifying, which I don't understand.  But those two should be pretty easy to do.


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

https://reviews.llvm.org/D115670



More information about the cfe-commits mailing list