1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[demangler] Ignore leading underscores if present

On MacOS, symbols start with a leading underscore, so just parse and
ignore it if present.

llvm-svn: 351481
This commit is contained in:
Erik Pilkington 2019-01-17 21:37:36 +00:00
parent dbf49926e4
commit 640017f2fc

View File

@ -5143,7 +5143,7 @@ AbstractManglingParser<Derived, Alloc>::parseTemplateArgs(bool TagTemplates) {
// extension ::= ___Z <encoding> _block_invoke_<decimal-digit>+
template <typename Derived, typename Alloc>
Node *AbstractManglingParser<Derived, Alloc>::parse() {
if (consumeIf("_Z")) {
if (consumeIf("_Z") || consumeIf("__Z")) {
Node *Encoding = getDerived().parseEncoding();
if (Encoding == nullptr)
return nullptr;
@ -5156,7 +5156,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parse() {
return Encoding;
}
if (consumeIf("___Z")) {
if (consumeIf("___Z") || consumeIf("____Z")) {
Node *Encoding = getDerived().parseEncoding();
if (Encoding == nullptr || !consumeIf("_block_invoke"))
return nullptr;