[MS Demangler] Print template constructor args.
Previously if you had something like this:
template<typename T>
struct Foo {
template<typename U>
Foo(U);
};
Foo F(3.7);
this would mangle as ??$?0N@?$Foo@H@@QEAA@N@Z
and this would be demangled as:
undname: __cdecl Foo<int>::Foo<int><double>(double)
llvm-undname: __cdecl Foo<int>::Foo<int>(double)
Note the lack of the constructor template parameter in our
demangling.
This patch makes it so we print the constructor argument list.
llvm-svn: 340356
This commit is contained in:
parent
986f03c2ea
commit
ee09170d25
@ -969,7 +969,20 @@ static void outputName(OutputStream &OS, const Name *TheName, const Type *Ty) {
|
||||
OS << "~";
|
||||
LLVM_FALLTHROUGH;
|
||||
case OperatorTy::Ctor:
|
||||
// Output the class name with template arguments a second time.
|
||||
outputNameComponent(OS, *Previous);
|
||||
|
||||
// Structors don't have a name, so outputting the name here actually is a
|
||||
// no-op. But for template constructors, it needs to output the template
|
||||
// argument list. e.g.
|
||||
//
|
||||
// template<typename T>
|
||||
// struct Foo {
|
||||
// template<typename U>
|
||||
// Foo(U);
|
||||
// };
|
||||
// should demangle as -- for example -- Foo<int><double>(double);
|
||||
outputNameComponent(OS, *TheName);
|
||||
break;
|
||||
case OperatorTy::Conversion:
|
||||
OS << "operator";
|
||||
|
||||
@ -196,3 +196,6 @@
|
||||
|
||||
??$f@US@@$1?g@1@QEAAXXZ@@YAXXZ
|
||||
; CHECK: void __cdecl f<struct S, &void __cdecl S::g(void)>(void)
|
||||
|
||||
??$?0N@?$Foo@H@@QEAA@N@Z
|
||||
; CHECK: __cdecl Foo<int>::Foo<int><double>(double)
|
||||
Loading…
x
Reference in New Issue
Block a user