@@ -353,10 +353,10 @@ class TypeEncoder final : public TypeVisitor<TypeEncoder> {
353
353
// Copy-pasted from Type::getSveEltType introduced after Clang 10:
354
354
// (Not extended for RISCV types
355
355
// as they are not available in that version anyway).
356
+ #if CLANG_VERSION_MAJOR >= 10
356
357
auto ElemType = [&] {
357
358
switch (kind) {
358
359
default : llvm_unreachable (" Unknown builtin SVE type!" );
359
- #if CLANG_VERSION_MAJOR >= 10
360
360
case BuiltinType::SveInt8: return Ctx.SignedCharTy ;
361
361
case BuiltinType::SveUint8: return Ctx.UnsignedCharTy ;
362
362
case BuiltinType::SveBool: return Ctx.UnsignedCharTy ;
@@ -369,13 +369,15 @@ class TypeEncoder final : public TypeVisitor<TypeEncoder> {
369
369
case BuiltinType::SveFloat16: return Ctx.Float16Ty ;
370
370
case BuiltinType::SveFloat32: return Ctx.FloatTy ;
371
371
case BuiltinType::SveFloat64: return Ctx.DoubleTy ;
372
- #endif // CLANG_VERSION_MAJOR >= 10
373
372
}
374
373
}();
375
374
// All the SVE types present in Clang 10 are 128-bit vectors
376
375
// (see `AArch64SVEACLETypes.def`), so we can divide 128
377
376
// by their element size to get element count.
378
377
auto ElemCount = 128 / Context->getTypeSize (ElemType);
378
+ #else
379
+ llvm_unreachable (" LLVM version does not have any vector types" );
380
+ #endif // CLANG_VERSION_MAJOR >= 10
379
381
#endif // CLANG_VERSION_MAJOR >= 11
380
382
auto ElemTypeTag = encodeQualType (ElemType);
381
383
encodeType (T, TagVectorType,
0 commit comments