Pol Marcet =?utf-8?q?Sardà ?= <polmarcetsa...@gmail.com>, Pol Marcet =?utf-8?q?Sardà ?= <polmarcetsa...@gmail.com>,Pol M <polmarcetsa...@gmail.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/76...@github.com>
================ @@ -10895,6 +10899,132 @@ bool VectorExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) { return Success(APValue(ResultElements.data(), ResultElements.size()), E); } +static bool EvaluateVectorOrLValue(APValue &Result, EvalInfo &Info, + const Expr *E, const QualType &Type) { + if (!Evaluate(Result, Info, E)) + return false; + + if (Result.isLValue()) { + // Source of the data is an lvalue; Manually handle the lvalue as if + // it was an rvalue to get the current APValue. + LValue LValueFound; + LValueFound.setFrom(Info.Ctx, Result); + if (!handleLValueToRValueConversion(Info, E, Type, LValueFound, Result)) + return false; + } + + return Result.isVector(); +} + +static bool handleVectorConversion(EvalInfo &Info, const FPOptions FPO, ---------------- sethp wrote: This is more or less the same thing as an cast expression for a single element, right? Maybe it would be better named `handleVectorElementCast` or `handleScalarConversion`? https://github.com/llvm/llvm-project/pull/76615 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits