[clang] [Clang][Interp] Implement constexpr vector unary operators +, -, ~, ! (PR #105996)

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 05:08:08 PDT 2024


================
@@ -5312,6 +5314,149 @@ bool Compiler<Emitter>::VisitComplexUnaryOperator(const UnaryOperator *E) {
   return true;
 }
 
+template <class Emitter>
+bool Compiler<Emitter>::VisitVectorUnaryOp(const UnaryOperator *E) {
+  const Expr *SubExpr = E->getSubExpr();
+  assert(SubExpr->getType()->isVectorType());
+
+  if (DiscardResult)
+    return this->discard(SubExpr);
+
+  std::optional<PrimType> ResT = classify(E);
----------------
yronglin wrote:

Yeah, `ResT` is unused.

https://github.com/llvm/llvm-project/pull/105996


More information about the cfe-commits mailing list