[cfe-commits] r82912 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle-subst.cpp
Anders Carlsson
andersca at mac.com
Sun Sep 27 12:53:49 PDT 2009
Author: andersca
Date: Sun Sep 27 14:53:49 2009
New Revision: 82912
URL: http://llvm.org/viewvc/llvm-project?rev=82912&view=rev
Log:
Use mangleTemplatePrefix when we know that we're mangling a nested template name.
Modified:
cfe/trunk/lib/CodeGen/Mangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-subst.cpp
Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=82912&r1=82911&r2=82912&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Sun Sep 27 14:53:49 2009
@@ -480,11 +480,13 @@
void CXXNameMangler::mangleNestedName(const TemplateDecl *TD,
const TemplateArgument *TemplateArgs,
unsigned NumTemplateArgs) {
+ // <nested-name> ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
+
Out << 'N';
- manglePrefix(TD->getDeclContext());
- mangleUnqualifiedName(TD);
+ mangleTemplatePrefix(TD);
mangleTemplateArgs(TemplateArgs, NumTemplateArgs);
+
Out << 'E';
}
Modified: cfe/trunk/test/CodeGenCXX/mangle-subst.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-subst.cpp?rev=82912&r1=82911&r2=82912&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-subst.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-subst.cpp Sun Sep 27 14:53:49 2009
@@ -46,3 +46,11 @@
// CHECK: @_Z2f2IiEv1VIT_ENS2_1UE
template void f2<int>(V<int>, int);
+
+namespace NS {
+template <typename T> struct S1 {};
+template<typename T> void ft3(S1<T>, S1<char>) { }
+
+// CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE
+template void ft3<int>(S1<int>, S1<char>);
+}
More information about the cfe-commits
mailing list