Skip to content

Commit 752019e

Browse files
efriedma-quicrorth
authored andcommitted
[AArch64] Add MSVC-style mangling for SVE types. (llvm#141887)
No released version of MSVC supports these types, so make up a mangling that's unlikely to conflict, for now.
1 parent 6a62ee3 commit 752019e

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,6 +2828,13 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T, Qualifiers,
28282828
break;
28292829
#include "clang/Basic/HLSLIntangibleTypes.def"
28302830

2831+
#define SVE_TYPE(Name, Id, SingletonId) \
2832+
case BuiltinType::Id: \
2833+
mangleArtificialTagType(TagTypeKind::Struct, #Name, {"__clang"}); \
2834+
break;
2835+
#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits)
2836+
#include "clang/Basic/AArch64ACLETypes.def"
2837+
28312838
// Issue an error for any type not explicitly handled.
28322839
default:
28332840
Error(Range.getBegin(), "built-in type: ",
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
// RUN: not %clang_cc1 -triple aarch64-unknown-windows-msvc %s -emit-llvm \
2-
// RUN: -o - 2>&1 | FileCheck %s
1+
// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc %s -emit-llvm \
2+
// RUN: -o - | FileCheck %s
33

44
template<typename T> struct S {};
55

6-
// CHECK: cannot mangle this built-in type: __SVInt8_t yet
6+
// CHECK: void @"?f1@@YAXU?$S@U__SVInt8_t@__clang@@@@@Z"
77
void f1(S<__SVInt8_t>) {}
8+
// CHECK: void @"?f2@@YAXU?$S@U__SVInt32_t@__clang@@@@@Z"
9+
void f2(S<__SVInt32_t>) {}
10+
// CHECK: void @"?f3@@YAXU?$S@U__SVBool_t@__clang@@@@@Z"
11+
void f3(S<__SVBool_t>) {}
12+
// CHECK: void @"?f4@@YAXU?$S@U__clang_svfloat64x4_t@__clang@@@@@Z"
13+
void f4(S<__clang_svfloat64x4_t>) {}

0 commit comments

Comments
 (0)