2,723 changes: 892 additions & 1,831 deletions llvm/lib/Demangle/MicrosoftDemangle.cpp

Large diffs are not rendered by default.

590 changes: 590 additions & 0 deletions llvm/lib/Demangle/MicrosoftDemangleNodes.cpp

Large diffs are not rendered by default.

705 changes: 705 additions & 0 deletions llvm/lib/Demangle/MicrosoftDemangleNodes.h

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions llvm/test/Demangle/ms-basic.test
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,12 @@
?x@@3PEATty@@EA
; CHECK: union ty *x

?x@@3PEAUty@@EA
; CHECK: struct ty *x
?x@@3PEAVty@@EA
; CHECK: class ty *x

?x@@3PEAW4ty@@EA
; CHECK: enum ty *x

?x@@3PEAVty@@EA
; CHECK: class ty *x

?x@@3PEAV?$tmpl@H@@EA
; CHECK: class tmpl<int> *x

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Demangle/ms-operators.test
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@
; CHECK: const Base::`RTTI Complete Object Locator'

??__EFoo@@YAXXZ
void __cdecl `dynamic initializer for 'Foo''(void)
; CHECK: void __cdecl `dynamic initializer for 'Foo''(void)

??__FFoo@@YAXXZ
void __cdecl `dynamic atexit destructor for 'Foo''(void)
; CHECK: void __cdecl `dynamic atexit destructor for 'Foo''(void)

??__K_deg@@YAHO@Z
; CHECK: int __cdecl operator ""_deg(long double)
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/Demangle/ms-templates-memptrs-2.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
; CHECK: struct K<struct M, -1> m2

?n@@3U?$J@UN@@$HA@@@A
; CHECK: struct J<struct N, nullptr> n
; CHECK: struct J<struct N, {0}> n

?n2@@3U?$K@UN@@$0?0@@A
; CHECK: struct K<struct N, -1> n2

?o@@3U?$J@UO@@$IA@A@@@A
; CHECK: struct J<struct O, nullptr> o
; CHECK: struct J<struct O, {0, 0}> o

?o2@@3U?$K@UO@@$FA@?0@@A
; CHECK: struct K<struct O, {0, -1}> o2

?p@@3U?$J@UP@@$JA@A@?0@@A
; CHECK: struct J<struct P, nullptr> p
; CHECK: struct J<struct P, {0, 0, -1}> p

?p2@@3U?$K@UP@@$GA@A@?0@@A
; CHECK: struct K<struct P, {0, 0, -1}> p2
Expand Down
9 changes: 4 additions & 5 deletions llvm/test/Demangle/ms-templates-memptrs.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

; CHECK-NOT: Invalid mangled name

; There's a back-referencing problem here
??$CallMethod@UC@NegativeNVOffset@@$I??_912@$BA@AEPPPPPPPM@A@@@YAXAAUC@NegativeNVOffset@@@Z
; FIXME: void __cdecl CallMethod<struct NegativeNVOffset::C, {[thunk]: __thiscall NegativeNVOffset::C::`vcall'{0, {flat}}, 4294967292, 0}>(struct NegativeNVOffset::C &)
; CHECK: void __cdecl CallMethod<struct NegativeNVOffset::C, {[thunk]: __thiscall NegativeNVOffset::C::`vcall'{0, {flat}}, 4294967292, 0}>(struct NegativeNVOffset::C &)

??$CallMethod@UM@@$0A@@@YAXAAUM@@@Z
; CHECK: void __cdecl CallMethod<struct M, 0>(struct M &)

??$CallMethod@UM@@$H??_91@$BA@AEA@@@YAXAAUM@@@Z
; FIXME: void __cdecl CallMethod<struct M, {[thunk]: __thiscall M::`vcall'{0, {flat}}', 0}>(struct M &)
; CHECK: void __cdecl CallMethod<struct M, {[thunk]: __thiscall M::`vcall'{0, {flat}}, 0}>(struct M &)

??$CallMethod@UM@@$H?f@1@QAEXXZA@@@YAXAAUM@@@Z
; FIXME: void __cdecl CallMethod<struct M, {void __thiscall M::f(void), 0}>(struct M &)
; CHECK: void __cdecl CallMethod<struct M, {void __thiscall M::f(void), 0}>(struct M &)

??$CallMethod@UO@@$H??_91@$BA@AE3@@YAXAAUO@@@Z
; FIXME: void __cdecl CallMethod<struct O, {[thunk]: __thiscall O::`vcall'{0, {flat}}, 4}>(struct O &)
; CHECK: void __cdecl CallMethod<struct O, {[thunk]: __thiscall O::`vcall'{0, {flat}}, 4}>(struct O &)

??$CallMethod@US@@$0A@@@YAXAAUS@@@Z
; CHECK: void __cdecl CallMethod<struct S, 0>(struct S &)
Expand Down