[clang] [clang] Implement constexpr bit_cast for vectors (PR #66894)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 21 13:16:47 PDT 2023
================
@@ -7095,6 +7096,21 @@ class APValueToBufferConverter {
return true;
}
+ bool visitVector(const APValue &Val, QualType Ty, CharUnits Offset) {
+ const auto *VT = Ty->castAs<VectorType>();
+
+ CharUnits ElemWidth = Info.Ctx.getTypeSizeInChars(VT->getElementType());
+ unsigned VectorLength = Val.getVectorLength();
+ // Visit each of the vector elements
+ for (unsigned I = 0; I != VectorLength; ++I) {
+ const APValue &SubObj = Val.getVectorElt(I);
+ if (!visit(SubObj, VT->getElementType(), Offset + I * ElemWidth))
----------------
DaMatrix wrote:
Ah right, I forgot about those :) The most recent revision should implement that.
https://github.com/llvm/llvm-project/pull/66894
More information about the cfe-commits
mailing list