[libcxxabi] r327227 - [demangler] Support for sequence numbers on lifetime extended temporaries.
Erik Pilkington via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 10 13:31:23 PST 2018
Author: epilk
Date: Sat Mar 10 13:31:22 2018
New Revision: 327227
URL: http://llvm.org/viewvc/llvm-project?rev=327227&view=rev
Log:
[demangler] Support for sequence numbers on lifetime extended temporaries.
Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
libcxxabi/trunk/test/test_demangle.pass.cpp
Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=327227&r1=327226&r2=327227&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Sat Mar 10 13:31:22 2018
@@ -4324,6 +4324,8 @@ bool Db::parseCallOffset() {
// # No <type>
// ::= TW <object name> # Thread-local wrapper
// ::= TH <object name> # Thread-local initialization
+// ::= GR <object name> _ # First temporary
+// ::= GR <object name> <seq-id> _ # Subsequent temporaries
// extension ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first
// extension ::= GR <object name> # reference temporary for object
Node *Db::parseSpecialName() {
@@ -4428,11 +4430,17 @@ Node *Db::parseSpecialName() {
return make<SpecialName>("guard variable for ", Name);
}
// GR <object name> # reference temporary for object
+ // GR <object name> _ # First temporary
+ // GR <object name> <seq-id> _ # Subsequent temporaries
case 'R': {
First += 2;
Node *Name = parseName();
if (Name == nullptr)
return nullptr;
+ size_t Count;
+ bool ParsedSeqId = !parseSeqId(&Count);
+ if (!consumeIf('_') && ParsedSeqId)
+ return nullptr;
return make<SpecialName>("reference temporary for ", Name);
}
}
Modified: libcxxabi/trunk/test/test_demangle.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_demangle.pass.cpp?rev=327227&r1=327226&r2=327227&view=diff
==============================================================================
--- libcxxabi/trunk/test/test_demangle.pass.cpp (original)
+++ libcxxabi/trunk/test/test_demangle.pass.cpp Sat Mar 10 13:31:22 2018
@@ -29722,6 +29722,9 @@ const char* cases[][2] =
// Structured bindings:
{"_ZDC2a12a2E", "'structured-binding'[a1, a2]"},
{"_ZN2NSDC1x1yEE", "NS::'structured-binding'[x, y]"},
+
+ {"_ZGRDC1x1yE_", "reference temporary for 'structured-binding'[x, y]"},
+ {"_ZGR1bIvE2_", "reference temporary for b<void>"},
};
const unsigned N = sizeof(cases) / sizeof(cases[0]);
More information about the cfe-commits
mailing list