================ @@ -4772,6 +4788,76 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, llvm_unreachable("Improper second standard conversion"); } + if (SCS.Element != ICK_Identity) { + // If SCS.Element is not ICK_Identity the To and From types must be HLSL + // vectors or matrices. HLSL matrices aren't yet supported so this code only + // handles vectors for now. + + assert(From->getType()->isVectorType() && ToType->isVectorType() && + "Element conversion is only supported for vector types."); + assert(From->getType()->getAs<VectorType>()->getNumElements() == + ToType->getAs<VectorType>()->getNumElements() && + "Element conversion is only supported for vectors with the same " + "element counts."); + QualType FromElTy = From->getType()->getAs<VectorType>()->getElementType(); + unsigned NumElts = ToType->getAs<VectorType>()->getNumElements(); + switch (SCS.Element) { + case ICK_Identity: + // Nothing to do. + break; ---------------- bogner wrote:
`SCS.Element == ICK_Identity` is unreachable - we checked above https://github.com/llvm/llvm-project/pull/71098 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits