@@ -407,9 +407,11 @@ class TypeEncoder final : public TypeVisitor<TypeEncoder> {
407407 // built-in to normal vector types.
408408 case BuiltinType::Float16: return TagHalf;
409409 case BuiltinType::Half: return TagHalf;
410+
410411#if CLANG_VERSION_MAJOR >= 11
411412 case BuiltinType::BFloat16: return TagBFloat16;
412413#endif
414+
413415 case BuiltinType::Float: return TagFloat;
414416 case BuiltinType::Double: return TagDouble;
415417 case BuiltinType::LongDouble: return TagLongDouble;
@@ -421,13 +423,75 @@ class TypeEncoder final : public TypeVisitor<TypeEncoder> {
421423 case BuiltinType::Bool: return TagBool;
422424 case BuiltinType::WChar_S: return TagSWChar;
423425 case BuiltinType::WChar_U: return TagUWChar;
426+
424427#if CLANG_VERSION_MAJOR >= 17
425- case BuiltinType::SveCount: return TagSveCount;
426- case BuiltinType::SveBool: return TagSveBool;
427- case BuiltinType::SveBoolx2: return TagSveBoolx2;
428- case BuiltinType::SveBoolx4: return TagSveBoolx4;
429428 case BuiltinType::Float128: return TagFloat128;
430- #endif
429+
430+ // From `clang/include/clang/Basic/AArch64ACLETypes.def`,
431+ // but we can't `#include` it in an external clang tool.
432+ case BuiltinType::SveInt8:
433+ case BuiltinType::SveInt16:
434+ case BuiltinType::SveInt32:
435+ case BuiltinType::SveInt64:
436+ case BuiltinType::SveUint8:
437+ case BuiltinType::SveUint16:
438+ case BuiltinType::SveUint32:
439+ case BuiltinType::SveUint64:
440+ case BuiltinType::SveFloat16:
441+ case BuiltinType::SveFloat32:
442+ case BuiltinType::SveFloat64:
443+ case BuiltinType::SveBFloat16:
444+ case BuiltinType::SveInt8x2:
445+ case BuiltinType::SveInt16x2:
446+ case BuiltinType::SveInt32x2:
447+ case BuiltinType::SveInt64x2:
448+ case BuiltinType::SveUint8x2:
449+ case BuiltinType::SveUint16x2:
450+ case BuiltinType::SveUint32x2:
451+ case BuiltinType::SveUint64x2:
452+ case BuiltinType::SveFloat16x2:
453+ case BuiltinType::SveFloat32x2:
454+ case BuiltinType::SveFloat64x2:
455+ case BuiltinType::SveBFloat16x2:
456+ case BuiltinType::SveInt8x3:
457+ case BuiltinType::SveInt16x3:
458+ case BuiltinType::SveInt32x3:
459+ case BuiltinType::SveInt64x3:
460+ case BuiltinType::SveUint8x3:
461+ case BuiltinType::SveUint16x3:
462+ case BuiltinType::SveUint32x3:
463+ case BuiltinType::SveUint64x3:
464+ case BuiltinType::SveFloat16x3:
465+ case BuiltinType::SveFloat32x3:
466+ case BuiltinType::SveFloat64x3:
467+ case BuiltinType::SveBFloat16x3:
468+ case BuiltinType::SveInt8x4:
469+ case BuiltinType::SveInt16x4:
470+ case BuiltinType::SveInt32x4:
471+ case BuiltinType::SveInt64x4:
472+ case BuiltinType::SveUint8x4:
473+ case BuiltinType::SveUint16x4:
474+ case BuiltinType::SveUint32x4:
475+ case BuiltinType::SveUint64x4:
476+ case BuiltinType::SveFloat16x4:
477+ case BuiltinType::SveFloat32x4:
478+ case BuiltinType::SveFloat64x4:
479+ case BuiltinType::SveBFloat16x4:
480+ case BuiltinType::SveBool:
481+ case BuiltinType::SveBoolx2:
482+ case BuiltinType::SveBoolx4:
483+ case BuiltinType::SveCount:
484+ #endif // CLANG_VERSION_MAJOR >= 17
485+
486+ #if CLANG_VERSION_MAJOR >= 20
487+ case BuiltinType::MFloat8:
488+ case BuiltinType::SveMFloat8:
489+ case BuiltinType::SveMFloat8x2:
490+ case BuiltinType::SveMFloat8x3:
491+ case BuiltinType::SveMFloat8x4:
492+ #endif // CLANG_VERSION_MAJOR >= 20
493+ return TagSve;
494+
431495 default :
432496 auto pol = clang::PrintingPolicy (Context->getLangOpts ());
433497 auto warning = std::string (" Encountered unsupported BuiltinType kind " ) +
0 commit comments