[PATCH] D56721: Move llvm-objdump demangle function into demangler library
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 15 07:41:13 PST 2019
jhenderson created this revision.
jhenderson added reviewers: zturner, labath, rnk, grimar, rupprecht.
Herald added subscribers: erik.pilkington, mgorny.
I'm currently working on https://bugs.llvm.org/show_bug.cgi?id=40054. In order to avoid duplication of the demangling code in llvm-objdump, this change moves that code into the demangler library ready for reuse in llvm-readobj. The new function in the library provides memory management via std::string, and also calls both the Itanium and Microsoft demanglers, as per the old behaviour. One minor change is that the microsoftDemangle function will always be called if the input string does not start with "_Z", since the pre-existing "?" check is unnecessary (the microsoftDemangle function does this same check).
One aspect I'm uncertain on is the usage of std::string in Demangle.h. If this is an issue, I would welcome suggestions for an alternative location for this function.
Repository:
rL LLVM
https://reviews.llvm.org/D56721
Files:
include/llvm/Demangle/Demangle.h
lib/Demangle/CMakeLists.txt
lib/Demangle/Demangle.cpp
tools/llvm-objdump/llvm-objdump.cpp
unittests/Demangle/CMakeLists.txt
unittests/Demangle/DemangleTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56721.181782.patch
Type: text/x-patch
Size: 5554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190115/855890b7/attachment.bin>
More information about the llvm-commits
mailing list