[PATCH] D56855: Add ___Z demangling to new common demangle function
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 17 07:50:17 PST 2019
jhenderson created this revision.
jhenderson added reviewers: erik.pilkington, grimar, rupprecht, rnk, labath, zturner.
This is a follow-up to rL351448 <https://reviews.llvm.org/rL351448>. This change adds support for the ___Z extension of Itanium demangling, requested by @erik.pilkington in the previous review, to the newly available `demangle` function.
Repository:
rL LLVM
https://reviews.llvm.org/D56855
Files:
lib/Demangle/Demangle.cpp
unittests/Demangle/DemangleTest.cpp
Index: unittests/Demangle/DemangleTest.cpp
===================================================================
--- unittests/Demangle/DemangleTest.cpp
+++ unittests/Demangle/DemangleTest.cpp
@@ -14,6 +14,8 @@
TEST(Demangle, demangleTest) {
EXPECT_EQ(demangle("_Z3fooi"), "foo(int)");
+ EXPECT_EQ(demangle("___Z3fooi_block_invoke"),
+ "invocation function for block in foo(int)");
EXPECT_EQ(demangle("?foo@@YAXH at Z"), "void __cdecl foo(int)");
EXPECT_EQ(demangle("foo"), "foo");
}
Index: lib/Demangle/Demangle.cpp
===================================================================
--- lib/Demangle/Demangle.cpp
+++ lib/Demangle/Demangle.cpp
@@ -15,7 +15,8 @@
std::string llvm::demangle(const std::string &MangledName) {
char *Demangled;
- if (MangledName.compare(0, 2, "_Z") == 0)
+ if (MangledName.compare(0, 2, "_Z") == 0 ||
+ MangledName.compare(0, 4, "___Z") == 0)
Demangled = itaniumDemangle(MangledName.c_str(), nullptr, nullptr, nullptr);
else
Demangled =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56855.182290.patch
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190117/1770b2a4/attachment.bin>
More information about the llvm-commits
mailing list