forked from OSchip/llvm-project
[Demangle] Add support for D special identifiers
Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D114308
This commit is contained in:
parent
5911a29aa9
commit
8a7ddf9e22
|
@ -247,6 +247,55 @@ const char *Demangler::parseIdentifier(OutputBuffer *Demangled,
|
|||
|
||||
const char *Demangler::parseLName(OutputBuffer *Demangled, const char *Mangled,
|
||||
unsigned long Len) {
|
||||
switch (Len) {
|
||||
case 6:
|
||||
if (strncmp(Mangled, "__initZ", Len + 1) == 0) {
|
||||
// The static initializer for a given symbol.
|
||||
Demangled->prepend("initializer for ");
|
||||
Demangled->setCurrentPosition(Demangled->getCurrentPosition() - 1);
|
||||
Mangled += Len;
|
||||
return Mangled;
|
||||
}
|
||||
if (strncmp(Mangled, "__vtblZ", Len + 1) == 0) {
|
||||
// The vtable symbol for a given class.
|
||||
Demangled->prepend("vtable for ");
|
||||
Demangled->setCurrentPosition(Demangled->getCurrentPosition() - 1);
|
||||
Mangled += Len;
|
||||
return Mangled;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
if (strncmp(Mangled, "__ClassZ", Len + 1) == 0) {
|
||||
// The classinfo symbol for a given class.
|
||||
Demangled->prepend("ClassInfo for ");
|
||||
Demangled->setCurrentPosition(Demangled->getCurrentPosition() - 1);
|
||||
Mangled += Len;
|
||||
return Mangled;
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
if (strncmp(Mangled, "__InterfaceZ", Len + 1) == 0) {
|
||||
// The interface symbol for a given class.
|
||||
Demangled->prepend("Interface for ");
|
||||
Demangled->setCurrentPosition(Demangled->getCurrentPosition() - 1);
|
||||
Mangled += Len;
|
||||
return Mangled;
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
if (strncmp(Mangled, "__ModuleInfoZ", Len + 1) == 0) {
|
||||
// The ModuleInfo symbol for a given module.
|
||||
Demangled->prepend("ModuleInfo for ");
|
||||
Demangled->setCurrentPosition(Demangled->getCurrentPosition() - 1);
|
||||
Mangled += Len;
|
||||
return Mangled;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
*Demangled << StringView(Mangled, Len);
|
||||
Mangled += Len;
|
||||
|
||||
|
|
|
@ -36,4 +36,13 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
std::make_pair("_D8demangle4testZ", "demangle.test"),
|
||||
std::make_pair("_D8demangle4test5test2Z", "demangle.test.test2"),
|
||||
std::make_pair("_D8demangle4test0Z", "demangle.test"),
|
||||
std::make_pair("_D8demangle4test03fooZ", "demangle.test.foo")));
|
||||
std::make_pair("_D8demangle4test03fooZ", "demangle.test.foo"),
|
||||
std::make_pair("_D8demangle4test6__initZ",
|
||||
"initializer for demangle.test"),
|
||||
std::make_pair("_D8demangle4test6__vtblZ", "vtable for demangle.test"),
|
||||
std::make_pair("_D8demangle4test7__ClassZ",
|
||||
"ClassInfo for demangle.test"),
|
||||
std::make_pair("_D8demangle4test11__InterfaceZ",
|
||||
"Interface for demangle.test"),
|
||||
std::make_pair("_D8demangle4test12__ModuleInfoZ",
|
||||
"ModuleInfo for demangle.test")));
|
||||
|
|
Loading…
Reference in New Issue