[PATCH] D52992: cxa_demangle: make demangler's parsing functions overridable

Pavel Labath via Phabricator reviews at reviews.llvm.org
Mon Oct 8 10:20:13 PDT 2018


labath created this revision.
labath added reviewers: erik.pilkington, rsmith.
Herald added subscribers: ldionne, christof.

This uses CRTP (for performance reasons) to allow a user the override
demangler functions to implement custom parsing logic. The motivation
for this is LLDB, which needs to occasionaly modify the mangled names.
One such instance is already implemented via the TypeCallback member,
but this is very specific functionality which does not help with any
other use case. Currently we have a use case for modifying the
constructor flavours, which would require adding another callback. This
approach does not scale.

With CRTP, the user (LLDB) can override any function it needs without
any special support from the demangler library. After LLDB is ported to
use this instead of the TypeCallback mechanism, the callback can be
removed.

More context can be found in https://reviews.llvm.org/D50599.


Repository:
  rCXXA libc++abi

https://reviews.llvm.org/D52992

Files:
  src/cxa_demangle.cpp
  src/demangle/ItaniumDemangle.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52992.168679.patch
Type: text/x-patch
Size: 73682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181008/c34c50db/attachment-0001.bin>


More information about the libcxx-commits mailing list