llvm.org GIT mirror llvm / ac46986
[MS Demangler] Demangle special operator 'dynamic initializer'. This is encoded as __E and should print something like "dynamic initializer for 'Foo'(void)" This also adds support for dynamic atexit destructor, which is basically identical but encoded as __F with slightly different description. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340239 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 26 days ago
2 changed file(s) with 24 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
270270 LocalVftableCtorClosure, // ?_T # local vftable constructor closure
271271 ArrayNew, // ?_U operator new[]
272272 ArrayDelete, // ?_V operator delete[]
273 DynamicInitializer, // ?__E dynamic initializer for `T'
274 DynamicAtexitDestructor, // ?__F dynamic atexit destructor for `T'
273275 LiteralOperator, // ?__K operator ""_name
274276 CoAwait, // ?__L co_await
275277 Spaceship, // operator<=>
359361 {"_T", "`local vftable ctor closure'", OperatorTy::LocalVftableCtorClosure},
360362 {"_U", "operator new[]", OperatorTy::ArrayNew},
361363 {"_V", "operator delete[]", OperatorTy::ArrayDelete},
364 {"__E", "dynamic initializer", OperatorTy::DynamicInitializer},
365 {"__F", "dynamic atexit destructor", OperatorTy::DynamicAtexitDestructor},
362366 {"__K", "operator \"\"", OperatorTy::LiteralOperator},
363367 {"__L", "co_await", OperatorTy::CoAwait},
364368 };
882886
883887 const OperatorInfo *Operator = lastComponentAsOperator(TheName);
884888 const VirtualMemberPtrThunk *Thunk = nullptr;
889 bool PrintLastScopeSeparator = true;
885890 if (Operator) {
886891 if (Operator->Info->Operator == OperatorTy::Vcall) {
887892 Thunk = static_cast(Operator);
888893 OS << "[thunk]: ";
889894 outputCallingConvention(OS, Thunk->CC);
890895 OS << " ";
896 } else if (Operator->Info->Operator == OperatorTy::DynamicInitializer) {
897 OS << "`dynamic initializer for '";
898 PrintLastScopeSeparator = false;
899 } else if (Operator->Info->Operator ==
900 OperatorTy::DynamicAtexitDestructor) {
901 OS << "`dynamic atexit destructor for '";
902 PrintLastScopeSeparator = false;
891903 }
892904 }
893905
896908 for (; TheName->Next; TheName = TheName->Next) {
897909 Previous = TheName;
898910 outputNameComponent(OS, *TheName);
899 OS << "::";
911 if (TheName->Next != Operator || PrintLastScopeSeparator)
912 OS << "::";
900913 }
901914
902915 // Print out a regular name.
945958 OS << Thunk->OffsetInVTable << ", {flat}}";
946959 break;
947960 }
961 case OperatorTy::DynamicInitializer:
962 case OperatorTy::DynamicAtexitDestructor:
963 OS << "''";
964 break;
948965
949966 case OperatorTy::LocalStaticGuard: {
950967 const LocalStaticGuardVariable &LSG =
214214 ??_R4Base@@6B@
215215 ; CHECK: const Base::`RTTI Complete Object Locator'
216216
217 ??__EFoo@@YAXXZ
218 void __cdecl `dynamic initializer for 'Foo''(void)
219
220 ??__FFoo@@YAXXZ
221 void __cdecl `dynamic atexit destructor for 'Foo''(void)
222
217223 ??__K_deg@@YAHO@Z
218224 ; CHECK: int __cdecl operator ""_deg(long double)
219225