[PATCH] D119467: [demangler][NFC] Tabularize operator name parsing

Nathan Sidwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 11:59:41 PST 2022


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

We need to parse operator encodings in 3 places -- expressions, names & fold expressions.  Currently we have 3 separate pieces to do this, and a FIXME.

The operator name and expression parsing are implemented as handwritten two-character nested switches, the fold expression is a sequence of string comparisons.

This adds a new OperatorInfo class to encode the operator info (encoding, kind, name), and has a table that it can binary search. From that each of the above 3 uses are altered to use the new scheme.

Existing tests cover parsing operator encodings, but as you can see there's a self-check for table ordering.


https://reviews.llvm.org/D119467

Files:
  libcxxabi/src/demangle/ItaniumDemangle.h
  llvm/include/llvm/Demangle/ItaniumDemangle.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119467.407628.patch
Type: text/x-patch
Size: 78818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220210/9814d37b/attachment.bin>


More information about the llvm-commits mailing list