This is an archive of the discontinued LLVM Phabricator instance.

Port libcxxabi D52992 into llvm
ClosedPublic

Authored by labath on Oct 15 2018, 1:00 PM.

Details

Summary

The original commit message is:

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.

The only difference here is the addition of a unit test which exercises
the CRTP mechanism to override a function in the parser.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Oct 15 2018, 1:00 PM
erik.pilkington accepted this revision.Oct 15 2018, 2:00 PM

LGTM too!

unittests/Demangle/CMakeLists.txt
2 ↗(On Diff #169744)

Don't you have to add Support here now?

This revision is now accepted and ready to land.Oct 15 2018, 2:00 PM
labath marked an inline comment as done.Oct 16 2018, 7:25 AM
labath added inline comments.
unittests/Demangle/CMakeLists.txt
2 ↗(On Diff #169744)

I don't *have* to (the BumpPtrAllocator is header-only, so it kinda works), but I should. In fact I did add it already, but then that got lost when I remerged the libc++ patch. I'll update this before comitting.

This revision was automatically updated to reflect the committed changes.
labath marked an inline comment as done.