[AArch64] Add MSVC-style mangling for SVE types. (#141887)

No released version of MSVC supports these types, so make up a mangling
that's unlikely to conflict, for now.
This commit is contained in:
Eli Friedman 2025-06-03 16:22:30 -07:00 committed by GitHub
parent 6c1091ea3f
commit 12f8bf34c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 3 deletions

View File

@ -2828,6 +2828,13 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
break;
#include "clang/Basic/HLSLIntangibleTypes.def"
#define SVE_TYPE(Name, Id, SingletonId) \
case BuiltinType::Id: \
mangleArtificialTagType(TagTypeKind::Struct, #Name, {"__clang"}); \
break;
#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits)
#include "clang/Basic/AArch64ACLETypes.def"
// Issue an error for any type not explicitly handled.
default:
Error(Range.getBegin(), "built-in type: ",

View File

@ -1,7 +1,13 @@
// RUN: not %clang_cc1 -triple aarch64-unknown-windows-msvc %s -emit-llvm \
// RUN: -o - 2>&1 | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc %s -emit-llvm \
// RUN: -o - | FileCheck %s
template<typename T> struct S {};
// CHECK: cannot mangle this built-in type: __SVInt8_t yet
// CHECK: void @"?f1@@YAXU?$S@U__SVInt8_t@__clang@@@@@Z"
void f1(S<__SVInt8_t>) {}
// CHECK: void @"?f2@@YAXU?$S@U__SVInt32_t@__clang@@@@@Z"
void f2(S<__SVInt32_t>) {}
// CHECK: void @"?f3@@YAXU?$S@U__SVBool_t@__clang@@@@@Z"
void f3(S<__SVBool_t>) {}
// CHECK: void @"?f4@@YAXU?$S@U__clang_svfloat64x4_t@__clang@@@@@Z"
void f4(S<__clang_svfloat64x4_t>) {}