[PATCH] D119933: [demangler] Add support for C++20 modules

Nathan Sidwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 04:46:44 PST 2022


urnathan created this revision.
urnathan added reviewers: rsmith, ChuanqiXu, iains, bruno.
Herald added a subscriber: hiraditya.
urnathan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Now all the prerequisite demangler patches are in, here's the patch for module demangling.  As with the mangler patch (D118352 <https://reviews.llvm.org/D118352>) this is the updated scheme described at https://drive.google.com/file/d/1qQjqptzOFT_lfXH8L6-iD9nCRi34wjft/view

We have two new demangler nodes -- ModuleName and ModuleEntity.  The former represents a module name in a hierarchical fashion.  The latter is the combination of a (name) node and a module name.  Because module names and entity identities use the same substitution encoding, we have to adjust the flow of how substitutions are handled, and examine the substituted node to know how to deal with it.

There is one difference to that doc, the global initializer _ZGI <module-name> lacks the 'v' suffix.  I don't think that necessary -- my original thought was of describing something more like a regular void function mangling.  I'll be updating the google doc with this alteration and some other clarifications that don't affect the demangler.


https://reviews.llvm.org/D119933

Files:
  libcxxabi/src/demangle/ItaniumDemangle.h
  libcxxabi/test/test_demangle.pass.cpp
  llvm/include/llvm/Demangle/ItaniumDemangle.h
  llvm/lib/Demangle/ItaniumDemangle.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119933.409210.patch
Type: text/x-patch
Size: 25244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220216/da25decf/attachment.bin>


More information about the llvm-commits mailing list