Skip to content

Commit 4a3b446

Browse files
committed
Implement mangling for matrix types
1 parent 0d19efa commit 4a3b446

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

clang/lib/AST/MicrosoftMangle.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3526,7 +3526,22 @@ void MicrosoftCXXNameMangler::mangleType(const DependentSizedExtVectorType *T,
35263526

35273527
void MicrosoftCXXNameMangler::mangleType(const ConstantMatrixType *T,
35283528
Qualifiers quals, SourceRange Range) {
3529-
Error(Range.getBegin(), "matrix type") << Range;
3529+
QualType EltTy = T->getElementType();
3530+
const BuiltinType *ET = EltTy->getAs<BuiltinType>();
3531+
3532+
llvm::SmallString<64> TemplateMangling;
3533+
llvm::raw_svector_ostream Stream(TemplateMangling);
3534+
MicrosoftCXXNameMangler Extra(Context, Stream);
3535+
3536+
Stream << "?$";
3537+
3538+
Extra.mangleSourceName("__matrix");
3539+
Extra.mangleType(EltTy, Range, QMM_Escape);
3540+
3541+
Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(T->getNumRows()));
3542+
Extra.mangleIntegerLiteral(llvm::APSInt::getUnsigned(T->getNumColumns()));
3543+
3544+
mangleArtificialTagType(TagTypeKind::Struct, TemplateMangling, {"__clang"});
35303545
}
35313546

35323547
void MicrosoftCXXNameMangler::mangleType(const DependentSizedMatrixType *T,

0 commit comments

Comments
 (0)