summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--absl/debugging/internal/demangle.cc10
-rw-r--r--absl/debugging/internal/demangle_test.cc15
2 files changed, 24 insertions, 1 deletions
diff --git a/absl/debugging/internal/demangle.cc b/absl/debugging/internal/demangle.cc
index 8b76ce01..9f4a8352 100644
--- a/absl/debugging/internal/demangle.cc
+++ b/absl/debugging/internal/demangle.cc
@@ -1112,6 +1112,7 @@ static bool ParseOperatorName(State *state, int *arity) {
// ::= GV <(object) name>
// ::= GR <(object) name> [<seq-id>] _
// ::= T <call-offset> <(base) encoding>
+// ::= GTt <encoding> # transaction-safe entry point
// G++ extensions:
// ::= TC <type> <(offset) number> _ <(base) type>
// ::= TF <type>
@@ -1205,6 +1206,12 @@ static bool ParseSpecialName(State *state) {
}
state->parse_state = copy;
+ if (ParseThreeCharToken(state, "GTt") &&
+ MaybeAppend(state, "transaction clone for ") && ParseEncoding(state)) {
+ return true;
+ }
+ state->parse_state = copy;
+
if (ParseOneCharToken(state, 'T') && ParseCharClass(state, "hv") &&
ParseCallOffset(state) && ParseEncoding(state)) {
return true;
@@ -1509,7 +1516,7 @@ static bool ParseExceptionSpec(State *state) {
}
// <function-type> ::=
-// [exception-spec] F [Y] <bare-function-type> [<ref-qualifier>] E
+// [exception-spec] [Dx] F [Y] <bare-function-type> [<ref-qualifier>] E
//
// <ref-qualifier> ::= R | O
static bool ParseFunctionType(State *state) {
@@ -1517,6 +1524,7 @@ static bool ParseFunctionType(State *state) {
if (guard.IsTooComplex()) return false;
ParseState copy = state->parse_state;
Optional(ParseExceptionSpec(state));
+ Optional(ParseTwoCharToken(state, "Dx"));
if (!ParseOneCharToken(state, 'F')) {
state->parse_state = copy;
return false;
diff --git a/absl/debugging/internal/demangle_test.cc b/absl/debugging/internal/demangle_test.cc
index 108642a8..974b15f0 100644
--- a/absl/debugging/internal/demangle_test.cc
+++ b/absl/debugging/internal/demangle_test.cc
@@ -759,6 +759,21 @@ TEST(Demangle, GnuVectorSizeIsADependentOperatorExpression) {
EXPECT_STREQ("f<>()", tmp);
}
+TEST(Demangle, TransactionSafeEntryPoint) {
+ char tmp[80];
+
+ EXPECT_TRUE(Demangle("_ZGTt1fv", tmp, sizeof(tmp)));
+ EXPECT_STREQ("transaction clone for f()", tmp);
+}
+
+TEST(Demangle, TransactionSafeFunctionType) {
+ char tmp[80];
+
+ // GNU demangling: f(void (*)() transaction_safe)
+ EXPECT_TRUE(Demangle("_Z1fPDxFvvE", tmp, sizeof(tmp)));
+ EXPECT_STREQ("f()", tmp);
+}
+
TEST(Demangle, EnableIfAttributeOnGlobalFunction) {
char tmp[80];