[PATCH] D88905: [Clang] Allow "ext_vector_type" applied to Booleans

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 14 11:14:58 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:10244-10245
+  // This operation may not be performed on boolean vectors.
+  if (!AllowBoolOperation && (isBoolOrExtVectorBoolType(LHSType) &&
+                              isBoolOrExtVectorBoolType(RHSType)))
+    return ReportInvalid ? InvalidOperands(Loc, LHS, RHS) : QualType();
----------------
simoll wrote:
> aaron.ballman wrote:
> > No need for the parens, but should that `&&` have been `||`?
> The `&&` is intentional. We cannot step into this if `AllowBoolOperation` is true.
Yes, but don't we want to step into it if *either* operand is a vector boolean type when bool operations are not allowed? (I'm confused by the `!AllowBoolOperations` but then allowing them anyway if only one operand is a vector bool.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88905



More information about the cfe-commits mailing list