[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 09:07:23 PDT 2022
    
    
  
aaron.ballman added a comment.
Sema bits look pretty reasonable to me (I don't feel qualified to review the codegen bits).
================
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();
----------------
No need for the parens, but should that `&&` have been `||`?
================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:6099
+  assert(!EltTy->isEnumeralType() && "Vectors cant be enum types");
+  return EltTy->isIntegralType(Ctx) || EltTy->isBooleanType();
 }
----------------
`bool` is already covered by `isIntegralType()`.
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