llvm.org GIT mirror llvm / 65bbcca
[MS Demangler] Print public:, protected:, private: if set in FunctionClass or a variable's StorageClass. undname prints them, and the information is in the decorated name, so we probably shouldn't lose it when undecorating. I spot-checked a few of the funnier-looking outputs, and undname has the same output. Differential Revision: https://reviews.llvm.org/D54396 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346791 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 10 months ago
9 changed file(s) with 42 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
367367
368368 void FunctionSignatureNode::outputPre(OutputStream &OS,
369369 OutputFlags Flags) const {
370 if (FunctionClass & FC_Public)
371 OS << "public: ";
372 if (FunctionClass & FC_Protected)
373 OS << "protected: ";
374 if (FunctionClass & FC_Private)
375 OS << "private: ";
376
370377 if (!(FunctionClass & FC_Global)) {
371378 if (FunctionClass & FC_Static)
372379 OS << "static ";
373380 }
381 if (FunctionClass & FC_Virtual)
382 OS << "virtual ";
383
374384 if (FunctionClass & FC_ExternC)
375385 OS << "extern \"C\" ";
376
377 if (FunctionClass & FC_Virtual)
378 OS << "virtual ";
379386
380387 if (ReturnType) {
381388 ReturnType->outputPre(OS, Flags);
553560 void VariableSymbolNode::output(OutputStream &OS, OutputFlags Flags) const {
554561 switch (SC) {
555562 case StorageClass::PrivateStatic:
563 OS << "private: static ";
564 break;
556565 case StorageClass::PublicStatic:
566 OS << "public: static ";
567 break;
557568 case StorageClass::ProtectedStatic:
558 OS << "static ";
569 OS << "protected: static ";
559570 break;
560571 default:
561572 break;
110110 ; CHECK: int __cdecl PR18204::f>(union PR18204:: *)
111111
112112 ??R@?0??PR26105@@YAHXZ@QBE@H@Z
113 ; CHECK: __thiscall `int __cdecl PR26105(void)'::`1'::::operator()(int) const
113 ; CHECK: public: __thiscall `int __cdecl PR26105(void)'::`1'::::operator()(int) const
114114
115115 ??R@?0???R@?0??PR26105@@YAHXZ@QBE@H@Z@QBE@H@Z
116 ; CHECK: __thiscall `__thiscall `int __cdecl PR26105(void)'::`1'::::operator()(int) const'::`1'::::operator()(int) const
116 ; CHECK: public: __thiscall `public: __thiscall `int __cdecl PR26105(void)'::`1'::::operator()(int) const'::`1'::::operator()(int) const
117117
118118 ?unaligned_foo1@@YAPFAHXZ
119119 ; CHECK: int __unaligned * __cdecl unaligned_foo1(void)
143143 ; CHECK: __thiscall PR31197::A::x::::operator()(void) const
144144
145145 ?white@?1???R@x@A@PR31197@@QBE@XZ@4HA
146 ; CHECK: int `__thiscall PR31197::A::x::::operator()(void) const'::`2'::white
146 ; CHECK: int `public: __thiscall PR31197::A::x::::operator()(void) const'::`2'::white
147147
148148 ?f@@YAXW4@@@Z
149149 ; CHECK: void __cdecl f(enum )
1515 ; CHECK: __thiscall ::operator()(void) const
1616
1717 ?ValueFromLambdaWithLocalType@@3ULocalType@?1???R@@QBE?A?@@XZ@A
18 ; CHECK: struct ` __thiscall ::operator()(void) const'::`2'::LocalType ValueFromLambdaWithLocalType
18 ; CHECK: struct `public: __thiscall ::operator()(void) const'::`2'::LocalType ValueFromLambdaWithLocalType
1919
2020 ?ValueFromTemplateFuncionWithLocalLambda@@3ULocalType@?2???R@?0???$TemplateFuncionWithLocalLambda@H@@YA?A?@@H@Z@QBE?A?3@XZ@A
21 ; CHECK: struct ` __thiscall ` __cdecl TemplateFuncionWithLocalLambda(int)'::`1'::::operator()(void) const'::`3'::LocalType ValueFromTemplateFuncionWithLocalLambda
21 ; CHECK: struct `public: __thiscall ` __cdecl TemplateFuncionWithLocalLambda(int)'::`1'::::operator()(void) const'::`3'::LocalType ValueFromTemplateFuncionWithLocalLambda
2222
2323 ??$TemplateFuncionWithLocalLambda@H@@YA?A?@@H@Z
2424 ; CHECK: __cdecl TemplateFuncionWithLocalLambda(int)
8080 ; CHECK: int `int __cdecl M(void)'::`2'::M
8181
8282 ?L@?2??M@0?2??0@YAHXZ@QEAAHXZ@4HA
83 ; CHECK: int `int __cdecl `int __cdecl L(void)'::`3'::L::M(void)'::`3'::L
83 ; CHECK: int `public: int __cdecl `int __cdecl L(void)'::`3'::L::M(void)'::`3'::L
8484
8585 ?M@?2??0L@?2??1@YAHXZ@QEAAHXZ@4HA
86 ; CHECK: int `int __cdecl `int __cdecl L(void)'::`3'::L::M(void)'::`3'::M
86 ; CHECK: int `public: int __cdecl `int __cdecl L(void)'::`3'::L::M(void)'::`3'::M
8787
8888 ; Function local scopes of template functions
8989 ?M@?1???$L@H@@YAHXZ@4HA
9494 ; CHECK: int __cdecl NS::NS::SN(void)
9595
9696 ?NS@?1??SN@?$NS@H@0@QEAAHXZ@4HA
97 ; CHECK: int `int __cdecl NS::NS::SN(void)'::`2'::NS
97 ; CHECK: int `public: int __cdecl NS::NS::SN(void)'::`2'::NS
9898
9999 ?SN@?1??0?$NS@H@NS@@QEAAHXZ@4HA
100 ; CHECK: int `int __cdecl NS::NS::SN(void)'::`2'::SN
100 ; CHECK: int `public: int __cdecl NS::NS::SN(void)'::`2'::SN
101101
102102 ?NS@?1??SN@?$NS@H@10@QEAAHXZ@4HA
103 ; CHECK: int `int __cdecl NS::SN::NS::SN(void)'::`2'::NS
103 ; CHECK: int `public: int __cdecl NS::SN::NS::SN(void)'::`2'::NS
104104
105105 ?SN@?1??0?$NS@H@0NS@@QEAAHXZ@4HA
106 ; CHECK: int `int __cdecl NS::SN::NS::SN(void)'::`2'::SN
106 ; CHECK: int `public: int __cdecl NS::SN::NS::SN(void)'::`2'::SN
107107
108108 ; Make sure instantiated templates participate in back-referencing.
109109 ; In the next 3 examples there should be 3 back-references:
136136 ; } } } } }
137137
138138 ?C@?1??B@?$C@H@0101A@@QEAAHXZ@4U201013@A
139 ; CHECK: struct A::B::C::B::C::C `int __cdecl A::B::C::B::C::C::B(void)'::`2'::C
139 ; CHECK: struct A::B::C::B::C::C `public: int __cdecl A::B::C::B::C::C::B(void)'::`2'::C
140140
141141 ?B@?1??0?$C@H@C@020A@@QEAAHXZ@4HA
142 ; CHECK: int `int __cdecl A::B::C::B::C::C::B(void)'::`2'::B
142 ; CHECK: int `public: int __cdecl A::B::C::B::C::C::B(void)'::`2'::B
143143
144144 ?A@?1??B@?$C@H@C@1310@QEAAHXZ@4HA
145 ; CHECK: int `int __cdecl A::B::C::B::C::C::B(void)'::`2'::A
145 ; CHECK: int `public: int __cdecl A::B::C::B::C::C::B(void)'::`2'::A
161161 ; CHECK: virtual void * __cdecl Base::`vector deleting dtor'(unsigned int)
162162
163163 ??_EBase@@G3AEPAXI@Z
164 ; CHECK: [thunk]: void * __thiscall Base::`vector deleting dtor'`adjustor{4}'(unsigned int)
164 ; CHECK: [thunk]: private: void * __thiscall Base::`vector deleting dtor'`adjustor{4}'(unsigned int)
165165
166166 ??_F?$SomeTemplate@H@@QAEXXZ
167167 ; CHECK: void __thiscall SomeTemplate::`default ctor closure'(void)
227227 ; CHECK: void __cdecl `dynamic atexit destructor for 'Foo''(void)
228228
229229 ??__F_decisionToDFA@XPathLexer@@0V?$vector@VDFA@dfa@antlr4@@V?$allocator@VDFA@dfa@antlr4@@@std@@@std@@A@YAXXZ
230 ; CHECK: void __cdecl `dynamic atexit destructor for `static class std::vector> XPathLexer::_decisionToDFA''(void)
230 ; CHECK: void __cdecl `dynamic atexit destructor for `private: static class std::vector> XPathLexer::_decisionToDFA''(void)
231231
232232 ??__K_deg@@YAHO@Z
233233 ; CHECK: int __cdecl operator ""_deg(long double)
4646 ; CHECK: void __cdecl WrapFnRef<&void __cdecl VoidFn(void)>(void)
4747
4848 ??$WrapFnPtr@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ
49 ; CHECK: void __cdecl WrapFnPtr<&static void __cdecl Thing::VoidStaticMethod(void)>(void)
49 ; CHECK: void __cdecl WrapFnPtr<&public: static void __cdecl Thing::VoidStaticMethod(void)>(void)
5050
5151 ??$WrapFnRef@$1?VoidStaticMethod@Thing@@SAXXZ@@YAXXZ
52 ; CHECK: void __cdecl WrapFnRef<&static void __cdecl Thing::VoidStaticMethod(void)>(void)
52 ; CHECK: void __cdecl WrapFnRef<&public: static void __cdecl Thing::VoidStaticMethod(void)>(void)
1111 ; CHECK: void __cdecl CallMethod(struct M &)
1212
1313 ??$CallMethod@UM@@$H?f@1@QAEXXZA@@@YAXAAUM@@@Z
14 ; CHECK: void __cdecl CallMethodvoid __thiscall M::f(void), 0}>(struct M &)
14 ; CHECK: void __cdecl CallMethodpublic: void __thiscall M::f(void), 0}>(struct M &)
1515
1616 ??$CallMethod@UO@@$H??_91@$BA@AE3@@YAXAAUO@@@Z
1717 ; CHECK: void __cdecl CallMethod(struct O &)
2323 ; CHECK: void __cdecl CallMethod(struct S &)
2424
2525 ??$CallMethod@US@@$1?f@1@QAEXXZ@@YAXAAUS@@@Z
26 ; CHECK: void __cdecl CallMethodvoid __thiscall S::f(void)>(struct S &)
26 ; CHECK: void __cdecl CallMethodpublic: void __thiscall S::f(void)>(struct S &)
2727
2828 ??$CallMethod@UU@@$0A@@@YAXAAUU@@@Z
2929 ; CHECK: void __cdecl CallMethod(struct U &)
3232 ; CHECK: void __cdecl CallMethod(struct U &)
3333
3434 ??$CallMethod@UU@@$J?f@1@QAEXXZA@A@A@@@YAXAAUU@@@Z
35 ; CHECK: void __cdecl CallMethodvoid __thiscall U::f(void), 0, 0, 0}>(struct U &)
35 ; CHECK: void __cdecl CallMethodpublic: void __thiscall U::f(void), 0, 0, 0}>(struct U &)
3636
3737 ??$CallMethod@UV@@$0A@@@YAXAAUV@@@Z
3838 ; CHECK: void __cdecl CallMethod(struct V &)
4141 ; CHECK: void __cdecl CallMethod(struct V &)
4242
4343 ??$CallMethod@UV@@$I?f@1@QAEXXZA@A@@@YAXAAUV@@@Z
44 ; CHECK: void __cdecl CallMethodvoid __thiscall V::f(void), 0, 0}>(struct V &)
44 ; CHECK: void __cdecl CallMethodpublic: void __thiscall V::f(void), 0, 0}>(struct V &)
4545
4646 ??$ReadField@UA@@$0?0@@YAHAAUA@@@Z
4747 ; CHECK: int __cdecl ReadField(struct A &)
194194 ; CHECK: void __thiscall UUIDType4<&struct __s_GUID const _GUID_12345678_1234_1234_1234_1234567890ab>::bar(void)
195195
196196 ??$f@US@@$1?g@1@QEAAXXZ@@YAXXZ
197 ; CHECK: void __cdecl fvoid __cdecl S::g(void)>(void)
197 ; CHECK: void __cdecl fpublic: void __cdecl S::g(void)>(void)
198198
199199 ??$?0N@?$Foo@H@@QEAA@N@Z
200 ; CHECK: __cdecl Foo::Foo(double)
200 ; CHECK: __cdecl Foo::Foo(double)
22 ; CHECK-NOT: Invalid mangled name
33
44 ?f@C@@WBA@EAAHXZ
5 ; CHECK: [thunk]: virtual int __cdecl C::f`adjustor{16}'(void)
5 ; CHECK: [thunk]: public: virtual int __cdecl C::f`adjustor{16}'(void)
66
77 ??_EDerived@@$4PPPPPPPM@A@EAAPEAXI@Z
8 ; CHECK: [thunk]: virtual void * __cdecl Derived::`vector deleting dtor'`vtordisp{-4, 0}'(unsigned int)
8 ; CHECK: [thunk]: public: virtual void * __cdecl Derived::`vector deleting dtor'`vtordisp{-4, 0}'(unsigned int)
99
1010 ?f@A@simple@@$R477PPPPPPPM@7AEXXZ
11 ; CHECK: [thunk]: virtual void __thiscall simple::A::f`vtordispex{8, 8, -4, 8}'(void)
11 ; CHECK: [thunk]: public: virtual void __thiscall simple::A::f`vtordispex{8, 8, -4, 8}'(void)
1212
1313 ??_9Base@@$B7AA
1414 ; CHECK: [thunk]: __cdecl Base::`vcall'{8, {flat}}