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.

Initial change was made in libccxxabi r293638

llvm-svn: 293643
This commit is contained in:
David Bozier 2017-01-31 15:56:36 +00:00
parent e0c3b40dde
commit 60b80d2233
1 changed files with 23 additions and 0 deletions

View File

@ -3836,6 +3836,8 @@ static const char *parse_call_offset(const char *first, const char *last) {
// ::= 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
@ -3929,6 +3931,27 @@ static const char *parse_special_name(const char *first, const char *last,
}
}
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>
{