2018-07-21 01:27:48 +08:00
|
|
|
; These tests are based on clang/test/CodeGenCXX/mangle-ms.cpp
|
|
|
|
; RUN: llvm-undname < %s | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK-NOT: Invalid mangled name
|
|
|
|
|
|
|
|
?a@@3HA
|
|
|
|
; CHECK: int a
|
|
|
|
|
|
|
|
?b@N@@3HA
|
|
|
|
; CHECK: int N::b
|
|
|
|
|
|
|
|
?anonymous@?A@N@@3HA
|
|
|
|
; CHECK: int N::`anonymous namespace'::anonymous
|
|
|
|
|
2018-08-15 02:54:28 +08:00
|
|
|
?$RT1@NeedsReferenceTemporary@@3ABHB
|
|
|
|
; CHECK: int const &NeedsReferenceTemporary::$RT1
|
|
|
|
?$RT1@NeedsReferenceTemporary@@3AEBHEB
|
|
|
|
; CHECK: int const &NeedsReferenceTemporary::$RT1
|
2018-07-27 04:20:29 +08:00
|
|
|
|
2018-07-21 01:27:48 +08:00
|
|
|
?_c@@YAHXZ
|
|
|
|
; CHECK: int __cdecl _c(void)
|
|
|
|
|
|
|
|
?d@foo@@0FB
|
|
|
|
; CHECK: static short const foo::d
|
|
|
|
|
|
|
|
?e@foo@@1JC
|
|
|
|
; CHECK: static long volatile foo::e
|
|
|
|
|
|
|
|
?f@foo@@2DD
|
|
|
|
; CHECK: static char const volatile foo::f
|
|
|
|
|
|
|
|
??0foo@@QAE@XZ
|
|
|
|
; CHECK: __thiscall foo::foo(void)
|
|
|
|
|
|
|
|
??0foo@@QEAA@XZ
|
|
|
|
; CHECK: __cdecl foo::foo(void)
|
|
|
|
|
|
|
|
??1foo@@QAE@XZ
|
|
|
|
; CHECK: __thiscall foo::~foo(void)
|
|
|
|
|
|
|
|
??1foo@@QEAA@XZ
|
|
|
|
; CHECK: __cdecl foo::~foo(void)
|
|
|
|
|
|
|
|
??0foo@@QAE@H@Z
|
|
|
|
; CHECK: __thiscall foo::foo(int)
|
|
|
|
|
|
|
|
??0foo@@QEAA@H@Z
|
|
|
|
; CHECK: __cdecl foo::foo(int)
|
|
|
|
|
|
|
|
??0foo@@QAE@PAD@Z
|
|
|
|
; CHECK: __thiscall foo::foo(char *)
|
|
|
|
|
|
|
|
??0foo@@QEAA@PEAD@Z
|
|
|
|
; CHECK: __cdecl foo::foo(char *)
|
|
|
|
|
|
|
|
?bar@@YA?AVfoo@@XZ
|
|
|
|
; CHECK: class foo __cdecl bar(void)
|
|
|
|
|
|
|
|
?bar@@YA?AVfoo@@XZ
|
|
|
|
; CHECK: class foo __cdecl bar(void)
|
|
|
|
|
|
|
|
??Hfoo@@QAEHH@Z
|
|
|
|
; CHECK: int __thiscall foo::operator+(int)
|
|
|
|
|
|
|
|
??Hfoo@@QEAAHH@Z
|
|
|
|
; CHECK: int __cdecl foo::operator+(int)
|
|
|
|
|
2018-08-02 02:32:47 +08:00
|
|
|
??$?HH@S@@QEAAAEANH@Z
|
|
|
|
; CHECK: double & __cdecl S::operator+<int>(int)
|
|
|
|
|
2018-07-21 01:27:48 +08:00
|
|
|
?static_method@foo@@SAPAV1@XZ
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static class foo * __cdecl foo::static_method(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?static_method@foo@@SAPEAV1@XZ
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static class foo * __cdecl foo::static_method(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?g@bar@@2HA
|
|
|
|
; CHECK: static int bar::g
|
|
|
|
|
|
|
|
; undname returns `int *h1`, but it is a bug in their demangler. Their mangler
|
|
|
|
; correctly mangles `int *h1` as ?h1@3PAHA and `int * const h1` as ?h1@3QAHA
|
|
|
|
?h1@@3QAHA
|
|
|
|
; CHECK: int *const h1
|
|
|
|
|
|
|
|
?h2@@3QBHB
|
|
|
|
; CHECK: int const *const h2
|
|
|
|
|
|
|
|
?h3@@3QIAHIA
|
2018-07-27 04:25:35 +08:00
|
|
|
; CHECK: int *const __restrict h3
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?h3@@3QEIAHEIA
|
2018-07-27 04:25:35 +08:00
|
|
|
; CHECK: int *const __restrict h3
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?i@@3PAY0BE@HA
|
|
|
|
; CHECK: int (*i)[20]
|
|
|
|
|
|
|
|
?FunArr@@3PAY0BE@P6AHHH@ZA
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl *(*FunArr)[20])(int, int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?j@@3P6GHCE@ZA
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__stdcall *j)(signed char, unsigned char)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?funptr@@YAP6AHXZXZ
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl * __cdecl funptr(void))(void)
|
2018-07-27 04:20:10 +08:00
|
|
|
|
2018-07-27 03:56:09 +08:00
|
|
|
?k@@3PTfoo@@DT1@
|
|
|
|
; CHECK: char const volatile foo::*k
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 03:56:09 +08:00
|
|
|
?k@@3PETfoo@@DET1@
|
|
|
|
; CHECK: char const volatile foo::*k
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?l@@3P8foo@@AEHH@ZQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__thiscall foo::*l)(int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?g_cInt@@3HB
|
|
|
|
; CHECK: int const g_cInt
|
|
|
|
|
|
|
|
?g_vInt@@3HC
|
|
|
|
; CHECK: int volatile g_vInt
|
|
|
|
|
|
|
|
?g_cvInt@@3HD
|
|
|
|
; CHECK: int const volatile g_cvInt
|
|
|
|
|
|
|
|
?beta@@YI_N_J_W@Z
|
|
|
|
; CHECK: bool __fastcall beta(__int64, wchar_t)
|
|
|
|
|
|
|
|
?beta@@YA_N_J_W@Z
|
|
|
|
; CHECK: bool __cdecl beta(__int64, wchar_t)
|
|
|
|
|
|
|
|
?alpha@@YGXMN@Z
|
|
|
|
; CHECK: void __stdcall alpha(float, double)
|
|
|
|
|
|
|
|
?alpha@@YAXMN@Z
|
|
|
|
; CHECK: void __cdecl alpha(float, double)
|
|
|
|
|
|
|
|
?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z
|
|
|
|
; CHECK: void __cdecl gamma(class foo, struct bar, union baz, enum quux)
|
|
|
|
|
|
|
|
?gamma@@YAXVfoo@@Ubar@@Tbaz@@W4quux@@@Z
|
|
|
|
; CHECK: void __cdecl gamma(class foo, struct bar, union baz, enum quux)
|
|
|
|
|
|
|
|
?delta@@YAXQAHABJ@Z
|
|
|
|
; CHECK: void __cdecl delta(int *const, long const &)
|
|
|
|
|
|
|
|
?delta@@YAXQEAHAEBJ@Z
|
|
|
|
; CHECK: void __cdecl delta(int *const, long const &)
|
|
|
|
|
|
|
|
?epsilon@@YAXQAY19BE@H@Z
|
|
|
|
; CHECK: void __cdecl epsilon(int (*const)[10][20])
|
|
|
|
|
|
|
|
?epsilon@@YAXQEAY19BE@H@Z
|
|
|
|
; CHECK: void __cdecl epsilon(int (*const)[10][20])
|
|
|
|
|
|
|
|
?zeta@@YAXP6AHHH@Z@Z
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: void __cdecl zeta(int (__cdecl *)(int, int))
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?zeta@@YAXP6AHHH@Z@Z
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: void __cdecl zeta(int (__cdecl *)(int, int))
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:29 +08:00
|
|
|
; FIXME: We don't support blocks yet.
|
|
|
|
|
|
|
|
; ?eta@@YAXP_EAHHH@Z@Z
|
|
|
|
; FIXME: void eta(int (^)(int, int))
|
|
|
|
; ?theta@@YAXP_EAHHH@Z@Z
|
|
|
|
; FIXME: void theta(int(int,int)^ block)
|
|
|
|
|
2018-07-21 01:27:48 +08:00
|
|
|
??2@YAPAXI@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: void * __cdecl operator new(unsigned int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??3@YAXPAX@Z
|
|
|
|
; CHECK: void __cdecl operator delete(void *)
|
|
|
|
|
|
|
|
??_U@YAPAXI@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: void * __cdecl operator new[](unsigned int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??_V@YAXPAX@Z
|
|
|
|
; CHECK: void __cdecl operator delete[](void *)
|
|
|
|
|
|
|
|
?color1@@3PANA
|
|
|
|
; CHECK: double *color1
|
|
|
|
|
|
|
|
?color2@@3QBNB
|
|
|
|
; CHECK: double const *const color2
|
|
|
|
|
2018-08-15 02:54:28 +08:00
|
|
|
; undname prints `double const (* color3)[3]`, but this is a bug in undname.
|
|
|
|
?color3@@3QAY02$$CBNA
|
|
|
|
; CHECK: double const (*const color3)[3]
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-08-15 02:54:28 +08:00
|
|
|
; undname prints `double const (* color4)[3]`, but this is a bug in undname.
|
|
|
|
?color4@@3QAY02$$CBNA
|
|
|
|
; CHECK: double const (*const color4)[3]
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptr1@@3RESB@@HES1@
|
|
|
|
; CHECK: int volatile B::*volatile memptr1
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptr2@@3PESB@@HES1@
|
|
|
|
; CHECK: int volatile B::*memptr2
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptr3@@3REQB@@HEQ1@
|
|
|
|
; CHECK: int B::*volatile memptr3
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?funmemptr1@@3RESB@@R6AHXZES1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl *volatile B::*volatile funmemptr1)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?funmemptr2@@3PESB@@R6AHXZES1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl *volatile B::*funmemptr2)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?funmemptr3@@3REQB@@P6AHXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl *B::*volatile funmemptr3)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun1@@3R8B@@EAAXXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: void (__cdecl B::*volatile memptrtofun1)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun2@@3P8B@@EAAXXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: void (__cdecl B::*memptrtofun2)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun3@@3P8B@@EAAXXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: void (__cdecl B::*memptrtofun3)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun4@@3R8B@@EAAHXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl B::*volatile memptrtofun4)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun5@@3P8B@@EAA?CHXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int volatile (__cdecl B::*memptrtofun5)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun6@@3P8B@@EAA?BHXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int const (__cdecl B::*memptrtofun6)(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun7@@3R8B@@EAAP6AHXZXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl * (__cdecl B::*volatile memptrtofun7)(void))(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun8@@3P8B@@EAAR6AHXZXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl *volatile (__cdecl B::*memptrtofun8)(void))(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-07-27 04:20:10 +08:00
|
|
|
?memptrtofun9@@3P8B@@EAAQ6AHXZXZEQ1@
|
2018-07-27 04:33:48 +08:00
|
|
|
; CHECK: int (__cdecl *const (__cdecl B::*memptrtofun9)(void))(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
?fooE@@YA?AW4E@@XZ
|
|
|
|
; CHECK: enum E __cdecl fooE(void)
|
|
|
|
|
|
|
|
?fooE@@YA?AW4E@@XZ
|
|
|
|
; CHECK: enum E __cdecl fooE(void)
|
|
|
|
|
|
|
|
?fooX@@YA?AVX@@XZ
|
|
|
|
; CHECK: class X __cdecl fooX(void)
|
|
|
|
|
|
|
|
?fooX@@YA?AVX@@XZ
|
|
|
|
; CHECK: class X __cdecl fooX(void)
|
|
|
|
|
|
|
|
?s0@PR13182@@3PADA
|
|
|
|
; CHECK: char *PR13182::s0
|
|
|
|
|
|
|
|
?s1@PR13182@@3PADA
|
|
|
|
; CHECK: char *PR13182::s1
|
|
|
|
|
|
|
|
?s2@PR13182@@3QBDB
|
|
|
|
; CHECK: char const *const PR13182::s2
|
|
|
|
|
|
|
|
?s3@PR13182@@3QBDB
|
|
|
|
; CHECK: char const *const PR13182::s3
|
|
|
|
|
|
|
|
?s4@PR13182@@3RCDC
|
|
|
|
; CHECK: char volatile *volatile PR13182::s4
|
|
|
|
|
|
|
|
?s5@PR13182@@3SDDD
|
|
|
|
; CHECK: char const volatile *const volatile PR13182::s5
|
|
|
|
|
|
|
|
; undname adds an extra const in here, but it seems like their bug.
|
|
|
|
?s6@PR13182@@3PBQBDB
|
|
|
|
; CHECK: char const *const *PR13182::s6
|
|
|
|
|
2018-08-11 05:09:05 +08:00
|
|
|
?local@?1??extern_c_func@@9@4HA
|
|
|
|
; CHECK: int `extern "C" extern_c_func'::`2'::local
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-08-11 05:09:05 +08:00
|
|
|
?local@?1??extern_c_func@@9@4HA
|
|
|
|
; CHECK: int `extern "C" extern_c_func'::`2'::local
|
2018-07-27 04:20:29 +08:00
|
|
|
|
[MS Demangler] Demangle symbols in function scopes.
There are a couple of issues you run into when you start getting into
more complex names, especially with regards to function local statics.
When you've got something like:
int x() {
static int n = 0;
return n;
}
Then this needs to demangle to something like
int `int __cdecl x()'::`1'::n
The nested mangled symbols (e.g. `int __cdecl x()` in the above
example) also share state with regards to back-referencing, so
we need to be able to re-use the demangler in the middle of
demangling a symbol while sharing back-ref state.
To make matters more complicated, there are a lot of ambiguities
when demangling a symbol's qualified name, because a function local
scope pattern (usually something like `?1??name?`) looks suspiciously
like many other possible things that can occur, such as `?1` meaning
the second back-ref and disambiguating these cases is rather
interesting. The `?1?` in a local scope pattern is actually a special
case of the more general pattern of `? + <encoded number> + ?`, where
"encoded number" can itself have embedded `@` symbols, which is a
common delimeter in mangled names. So we have to take care during the
disambiguation, which is the reason for the overly complicated
`isLocalScopePattern` function in this patch.
I've added some pretty obnoxious tests to exercise all of this, which
exposed several other problems related to back-referencing, so those
are fixed here as well. Finally, I've uncommented some tests that were
previously marked as `FIXME`, since now these work.
Differential Revision: https://reviews.llvm.org/D49965
llvm-svn: 338226
2018-07-30 11:12:34 +08:00
|
|
|
?v@?1??f@@YAHXZ@4U<unnamed-type-v>@?1??1@YAHXZ@A
|
|
|
|
; CHECK: struct `int __cdecl f(void)'::`2'::<unnamed-type-v> `int __cdecl f(void)'::`2'::v
|
2018-07-27 04:20:29 +08:00
|
|
|
|
[MS Demangler] Demangle symbols in function scopes.
There are a couple of issues you run into when you start getting into
more complex names, especially with regards to function local statics.
When you've got something like:
int x() {
static int n = 0;
return n;
}
Then this needs to demangle to something like
int `int __cdecl x()'::`1'::n
The nested mangled symbols (e.g. `int __cdecl x()` in the above
example) also share state with regards to back-referencing, so
we need to be able to re-use the demangler in the middle of
demangling a symbol while sharing back-ref state.
To make matters more complicated, there are a lot of ambiguities
when demangling a symbol's qualified name, because a function local
scope pattern (usually something like `?1??name?`) looks suspiciously
like many other possible things that can occur, such as `?1` meaning
the second back-ref and disambiguating these cases is rather
interesting. The `?1?` in a local scope pattern is actually a special
case of the more general pattern of `? + <encoded number> + ?`, where
"encoded number" can itself have embedded `@` symbols, which is a
common delimeter in mangled names. So we have to take care during the
disambiguation, which is the reason for the overly complicated
`isLocalScopePattern` function in this patch.
I've added some pretty obnoxious tests to exercise all of this, which
exposed several other problems related to back-referencing, so those
are fixed here as well. Finally, I've uncommented some tests that were
previously marked as `FIXME`, since now these work.
Differential Revision: https://reviews.llvm.org/D49965
llvm-svn: 338226
2018-07-30 11:12:34 +08:00
|
|
|
?v@?1???$f@H@@YAHXZ@4U<unnamed-type-v>@?1???$f@H@@YAHXZ@A
|
|
|
|
; CHECK: struct `int __cdecl f<int>(void)'::`2'::<unnamed-type-v> `int __cdecl f<int>(void)'::`2'::v
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??2OverloadedNewDelete@@SAPAXI@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static void * __cdecl OverloadedNewDelete::operator new(unsigned int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
??_UOverloadedNewDelete@@SAPAXI@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static void * __cdecl OverloadedNewDelete::operator new[](unsigned int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??3OverloadedNewDelete@@SAXPAX@Z
|
|
|
|
; CHECK: static void __cdecl OverloadedNewDelete::operator delete(void *)
|
|
|
|
|
|
|
|
|
|
|
|
??_VOverloadedNewDelete@@SAXPAX@Z
|
|
|
|
; CHECK: static void __cdecl OverloadedNewDelete::operator delete[](void *)
|
|
|
|
|
|
|
|
??HOverloadedNewDelete@@QAEHH@Z
|
|
|
|
; CHECK: int __thiscall OverloadedNewDelete::operator+(int)
|
|
|
|
|
|
|
|
??2OverloadedNewDelete@@SAPEAX_K@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static void * __cdecl OverloadedNewDelete::operator new(unsigned __int64)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??_UOverloadedNewDelete@@SAPEAX_K@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static void * __cdecl OverloadedNewDelete::operator new[](unsigned __int64)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??3OverloadedNewDelete@@SAXPEAX@Z
|
|
|
|
; CHECK: static void __cdecl OverloadedNewDelete::operator delete(void *)
|
|
|
|
|
|
|
|
|
|
|
|
??_VOverloadedNewDelete@@SAXPEAX@Z
|
|
|
|
; CHECK: static void __cdecl OverloadedNewDelete::operator delete[](void *)
|
|
|
|
|
|
|
|
??HOverloadedNewDelete@@QEAAHH@Z
|
|
|
|
; CHECK: int __cdecl OverloadedNewDelete::operator+(int)
|
|
|
|
|
|
|
|
|
|
|
|
??2TypedefNewDelete@@SAPAXI@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static void * __cdecl TypedefNewDelete::operator new(unsigned int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
??_UTypedefNewDelete@@SAPAXI@Z
|
2018-07-27 04:20:10 +08:00
|
|
|
; CHECK: static void * __cdecl TypedefNewDelete::operator new[](unsigned int)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
??3TypedefNewDelete@@SAXPAX@Z
|
|
|
|
; CHECK: static void __cdecl TypedefNewDelete::operator delete(void *)
|
|
|
|
|
|
|
|
??_VTypedefNewDelete@@SAXPAX@Z
|
|
|
|
; CHECK: static void __cdecl TypedefNewDelete::operator delete[](void *)
|
|
|
|
|
|
|
|
?vector_func@@YQXXZ
|
|
|
|
; CHECK: void __vectorcall vector_func(void)
|
|
|
|
|
2018-08-11 05:09:05 +08:00
|
|
|
??$fn_tmpl@$1?extern_c_func@@YAXXZ@@YAXXZ
|
|
|
|
; CHECK: void __cdecl fn_tmpl<&void __cdecl extern_c_func(void)>(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
2018-08-11 05:09:05 +08:00
|
|
|
?overloaded_fn@@$$J0YAXXZ
|
|
|
|
; CHECK: extern "C" void __cdecl overloaded_fn(void)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
[MS Demangler] Demangle symbols in function scopes.
There are a couple of issues you run into when you start getting into
more complex names, especially with regards to function local statics.
When you've got something like:
int x() {
static int n = 0;
return n;
}
Then this needs to demangle to something like
int `int __cdecl x()'::`1'::n
The nested mangled symbols (e.g. `int __cdecl x()` in the above
example) also share state with regards to back-referencing, so
we need to be able to re-use the demangler in the middle of
demangling a symbol while sharing back-ref state.
To make matters more complicated, there are a lot of ambiguities
when demangling a symbol's qualified name, because a function local
scope pattern (usually something like `?1??name?`) looks suspiciously
like many other possible things that can occur, such as `?1` meaning
the second back-ref and disambiguating these cases is rather
interesting. The `?1?` in a local scope pattern is actually a special
case of the more general pattern of `? + <encoded number> + ?`, where
"encoded number" can itself have embedded `@` symbols, which is a
common delimeter in mangled names. So we have to take care during the
disambiguation, which is the reason for the overly complicated
`isLocalScopePattern` function in this patch.
I've added some pretty obnoxious tests to exercise all of this, which
exposed several other problems related to back-referencing, so those
are fixed here as well. Finally, I've uncommented some tests that were
previously marked as `FIXME`, since now these work.
Differential Revision: https://reviews.llvm.org/D49965
llvm-svn: 338226
2018-07-30 11:12:34 +08:00
|
|
|
?f@UnnamedType@@YAXQAPAU<unnamed-type-T1>@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::<unnamed-type-T1> **const)
|
2018-07-21 01:27:48 +08:00
|
|
|
|
|
|
|
?f@UnnamedType@@YAXUT2@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T2)
|
|
|
|
|
|
|
|
?f@UnnamedType@@YAXPAUT4@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T4 *)
|
|
|
|
|
|
|
|
?f@UnnamedType@@YAXUT4@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T4)
|
|
|
|
|
|
|
|
?f@UnnamedType@@YAXUT5@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T5)
|
|
|
|
|
|
|
|
?f@UnnamedType@@YAXUT2@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T2)
|
|
|
|
|
|
|
|
?f@UnnamedType@@YAXUT4@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T4)
|
|
|
|
|
|
|
|
?f@UnnamedType@@YAXUT5@S@1@@Z
|
|
|
|
; CHECK: void __cdecl UnnamedType::f(struct UnnamedType::S::T5)
|
|
|
|
|
2018-07-27 04:20:29 +08:00
|
|
|
|
|
|
|
; ?foo@PassObjectSize@@YAHQAHW4__pass_object_size0@__clang@@@Z
|
|
|
|
; FIXME: int foo(int *const i __attribute__((pass_object_size(0))));
|
|
|
|
; ?bar@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@@Z
|
|
|
|
; FIXME: int bar(int *const i __attribute__((pass_object_size(1))));
|
|
|
|
; ?qux@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@0W4__pass_object_size0@3@@Z
|
|
|
|
; FIXME: int qux(int *const i __attribute__((pass_object_size(1))), int *const j __attribute__((pass_object_size(0))));
|
|
|
|
; ?zot@PassObjectSize@@YAHQAHW4__pass_object_size1@__clang@@01@Z
|
|
|
|
; FIXME: int zot(int *const i __attribute__((pass_object_size(1))), int *const j __attribute__((pass_object_size(1))));
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-21 01:27:48 +08:00
|
|
|
?f@Atomic@@YAXU?$_Atomic@H@__clang@@@Z
|
|
|
|
; CHECK: void __cdecl Atomic::f(struct __clang::_Atomic<int>)
|
|
|
|
|
|
|
|
?f@Complex@@YAXU?$_Complex@H@__clang@@@Z
|
|
|
|
; CHECK: void __cdecl Complex::f(struct __clang::_Complex<int>)
|
|
|
|
|
|
|
|
?f@Float16@@YAXU_Float16@__clang@@@Z
|
|
|
|
; CHECK: void __cdecl Float16::f(struct __clang::_Float16)
|
|
|
|
|
|
|
|
|
|
|
|
??0?$L@H@NS@@QEAA@XZ
|
|
|
|
; CHECK: __cdecl NS::L<int>::L<int>(void)
|
|
|
|
|
|
|
|
??0Bar@Foo@@QEAA@XZ
|
|
|
|
; CHECK: __cdecl Foo::Bar::Bar(void)
|
|
|
|
|
|
|
|
??0?$L@V?$H@PAH@PR26029@@@PR26029@@QAE@XZ
|
|
|
|
; CHECK: __thiscall PR26029::L<class PR26029::H<int *>>::L<class PR26029::H<int *>>(void)
|
2018-08-22 05:23:49 +08:00
|
|
|
|
|
|
|
; ??$emplace_back@ABH@?$vector@HV?$allocator@H@std@@@std@@QAE?A?<decltype-auto>@@ABH@Z
|
|
|
|
<decltype-auto> __thiscall std::vector<int, class std::allocator<int>>::emplace_back<int const &>(int const &)
|