This is an archive of the discontinued LLVM Phabricator instance.

Use llvm's demangler
ClosedPublic

Authored by rafael on Sep 7 2016, 6:51 AM.

Details

Summary

LLVM now has a copy of libcxxabi demangler, so lldb doesn't need to keep one too.

Diff Detail

Event Timeline

rafael updated this revision to Diff 70526.Sep 7 2016, 6:51 AM
rafael retitled this revision from to Use llvm's demangler.
rafael updated this object.
rafael added a reviewer: chaoren.
rafael added a subscriber: lldb-commits.
emaste added a subscriber: emaste.Sep 7 2016, 7:41 AM

Which library contains llvm::itaniumDemangle?

chaoren edited edge metadata.Sep 7 2016, 8:35 AM

Cool. Would it be a good idea to only use LLVM's demangler? We can get rid of all the messy ifdef business, and I assume the LLVM demangler would be better maintained and more up to date than any system demangler.

clayborg accepted this revision.Sep 7 2016, 8:50 AM
clayborg edited edge metadata.

We need to carefully benchmark any changes in demangling if we are thinking about switching to using llvm::itaniumDemangle() for everything. The demangler that was built into libcxxabi was 4 times slower than our fast version. I am not sure what version is now in LLVM, but I would guess that it might be the same version? FastDemangle is fast and any changes can't regress on performance.

This revision is now accepted and ready to land.Sep 7 2016, 8:50 AM
zturner added a subscriber: zturner.Sep 7 2016, 9:11 AM

AFAICT, this patch only changes the case where we were already not able to use the fast demangler. So nothing should change.

AFAICT, this patch only changes the case where we were already not able to use the fast demangler. So nothing should change.

Yep, I saw that and that is why I OK'ed the patch. Someone else suggested cutting over to only use llvm::itaniumDemangle(), so thus my comment.

k8stone edited edge metadata.Sep 7 2016, 10:02 AM

Glad to see this change. Maintaining another copy of the same demangler in LLDB is definitely unnecessary.

include/lldb/Core/CxaDemangle.h