[llvm] r293643 - Add support for demangling C++11 thread_local variables.
David Bozier via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 07:56:36 PST 2017
Author: davidb
Date: Tue Jan 31 09:56:36 2017
New Revision: 293643
URL: http://llvm.org/viewvc/llvm-project?rev=293643&view=rev
Log:
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
Modified:
llvm/trunk/lib/Demangle/ItaniumDemangle.cpp
Modified: llvm/trunk/lib/Demangle/ItaniumDemangle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Demangle/ItaniumDemangle.cpp?rev=293643&r1=293642&r2=293643&view=diff
==============================================================================
--- llvm/trunk/lib/Demangle/ItaniumDemangle.cpp (original)
+++ llvm/trunk/lib/Demangle/ItaniumDemangle.cpp Tue Jan 31 09:56:36 2017
@@ -3836,6 +3836,8 @@ static const char *parse_call_offset(con
// ::= 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(co
}
}
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>
{
More information about the llvm-commits
mailing list