Add support for demangling C++11 thread_local variables. In clang, the grammar for mangling for these names are "<special-name> ::= TW <object name>" for wrapper variables or "<special-name> ::= TH <object name>" for initialization variables.
llvm-svn: 293638
This commit is contained in:
parent
1b39d5db7b
commit
ec78fd11ca
|
@ -4345,6 +4345,8 @@ parse_call_offset(const char* first, const char* last)
|
|||
// # base is the nominal target function of thunk
|
||||
// ::= GV <object name> # Guard variable for one-time initialization
|
||||
// # No <type>
|
||||
// ::= TW <object name> # Thread-local wrapper
|
||||
// ::= TH <object name> # Thread-local initialization
|
||||
// extension ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first
|
||||
// extension ::= GR <object name> # reference temporary for object
|
||||
|
||||
|
@ -4448,6 +4450,28 @@ parse_special_name(const char* first, const char* last, C& db)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 'W':
|
||||
// TW <object name> # Thread-local wrapper
|
||||
t = parse_name(first + 2, last, db);
|
||||
if (t != first + 2)
|
||||
{
|
||||
if (db.names.empty())
|
||||
return first;
|
||||
db.names.back().first.insert(0, "thread-local wrapper routine for ");
|
||||
first = t;
|
||||
}
|
||||
break;
|
||||
case 'H':
|
||||
//TH <object name> # Thread-local initialization
|
||||
t = parse_name(first + 2, last, db);
|
||||
if (t != first + 2)
|
||||
{
|
||||
if (db.names.empty())
|
||||
return first;
|
||||
db.names.back().first.insert(0, "thread-local initialization routine for ");
|
||||
first = t;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// T <call-offset> <base encoding>
|
||||
{
|
||||
|
|
|
@ -29602,6 +29602,8 @@ const char* cases[][2] =
|
|||
// FIXME(compnerd) pretty print this as void (*)(unsigned long &) volatile &&
|
||||
{"PVFvRmOE", "void (*)(unsigned long&) volatile&&"},
|
||||
{"PFvRmOE", "void (*)(unsigned long&) &&"},
|
||||
{"_ZTW1x", "thread-local wrapper routine for x"},
|
||||
{"_ZTHN3fooE", "thread-local initialization routine for foo"},
|
||||
};
|
||||
|
||||
const unsigned N = sizeof(cases) / sizeof(cases[0]);
|
||||
|
|
Loading…
Reference in New Issue