[llvm] r351481 - [demangler] Ignore leading underscores if present
Erik Pilkington via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 17 13:37:36 PST 2019
Author: epilk
Date: Thu Jan 17 13:37:36 2019
New Revision: 351481
URL: http://llvm.org/viewvc/llvm-project?rev=351481&view=rev
Log:
[demangler] Ignore leading underscores if present
On MacOS, symbols start with a leading underscore, so just parse and
ignore it if present.
Modified:
llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h
Modified: llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h?rev=351481&r1=351480&r2=351481&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h (original)
+++ llvm/trunk/include/llvm/Demangle/ItaniumDemangle.h Thu Jan 17 13:37:36 2019
@@ -5143,7 +5143,7 @@ AbstractManglingParser<Derived, Alloc>::
// 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, Al
return Encoding;
}
- if (consumeIf("___Z")) {
+ if (consumeIf("___Z") || consumeIf("____Z")) {
Node *Encoding = getDerived().parseEncoding();
if (Encoding == nullptr || !consumeIf("_block_invoke"))
return nullptr;
More information about the llvm-commits
mailing list