[cfe-commits] r99616 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGen/mangle.c
Nick Lewycky
nicholas at mxc.ca
Fri Mar 26 00:18:04 PDT 2010
Author: nicholas
Date: Fri Mar 26 02:18:04 2010
New Revision: 99616
URL: http://llvm.org/viewvc/llvm-project?rev=99616&view=rev
Log:
Implement new mangling for vectors.
Modified:
cfe/trunk/lib/CodeGen/Mangle.cpp
cfe/trunk/test/CodeGen/mangle.c
Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=99616&r1=99615&r2=99616&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Fri Mar 26 02:18:04 2010
@@ -1136,15 +1136,20 @@
}
// 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());
}
Modified: cfe/trunk/test/CodeGen/mangle.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mangle.c?rev=99616&r1=99615&r2=99616&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/mangle.c (original)
+++ cfe/trunk/test/CodeGen/mangle.c Fri Mar 26 02:18:04 2010
@@ -59,3 +59,7 @@
int func(void) {
return 42;
}
+
+// CHECK: @_Z4foo9Dv4_f
+typedef __attribute__(( vector_size(16) )) float float4;
+void __attribute__((__overloadable__)) foo9(float4 f) {}
More information about the cfe-commits
mailing list