[PATCH] D35159: [libcxxabi][demangler] Use an AST to represent the demangled name

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 9 06:14:49 PDT 2017


erik.pilkington created this revision.
Herald added a reviewer: EricWF.

This patch changes cxa_demangle.cpp to use an AST instead of manipulating std::strings to produce a demangled name. This is good because:

- Performance: 3.7x faster to demangle symbols in LLVM
- Code size: 40% reduction for a release build on my machine
- Better readability: Now the formatting code is separated from the parsing code

This is probably correctish because:

- The fuzzer doesn't seem to have any problems with this patch.
- Demangles symbols in llvm identically to old demangler

Sorry for the mega-patch, I couldn't figure out a sane way of dividing this up further.

Please see a recent thread on llvm-dev for more context: http://lists.llvm.org/pipermail/llvm-dev/2017-June/114448.html

NOTE: this patch depends on: https://reviews.llvm.org/D35158

Thanks for taking a look!
Erik


https://reviews.llvm.org/D35159

Files:
  src/cxa_demangle.cpp
  test/test_demangle.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35159.105716.patch
Type: text/x-patch
Size: 150075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170709/b87f1594/attachment-0001.bin>


More information about the cfe-commits mailing list