Implement new mangling for vectors.

llvm-svn: 99616
This commit is contained in:
Nick Lewycky 2010-03-26 07:18:04 +00:00
parent f956b35f98
commit 3cfe6af8b5
2 changed files with 11 additions and 2 deletions

View File

@ -1136,15 +1136,20 @@ void CXXNameMangler::mangleType(const ComplexType *T) {
}
// GNU extension: vector types
// <type> ::= <vector-type>
// <vector-type> ::= Dv <positive dimension number> _ <element type>
// ::= Dv [<dimension expression>] _ <element type>
void CXXNameMangler::mangleType(const VectorType *T) {
Out << "U8__vector";
Out << "Dv" << T->getNumElements() << '_';
mangleType(T->getElementType());
}
void CXXNameMangler::mangleType(const ExtVectorType *T) {
mangleType(static_cast<const VectorType*>(T));
}
void CXXNameMangler::mangleType(const DependentSizedExtVectorType *T) {
Out << "U8__vector";
Out << "Dv";
mangleExpression(T->getSizeExpr());
Out << '_';
mangleType(T->getElementType());
}

View File

@ -59,3 +59,7 @@ extern int func (void) __asm__ ("FUNC");
int func(void) {
return 42;
}
// CHECK: @_Z4foo9Dv4_f
typedef __attribute__(( vector_size(16) )) float float4;
void __attribute__((__overloadable__)) foo9(float4 f) {}