[all-commits] [llvm/llvm-project] 7f89fa: [demangler][NFC] Tabularize operator name parsing

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Tue Mar 1 04:45:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f89fa32e8e9251b0b780009c340bc0d8f4d2e88
      https://github.com/llvm/llvm-project/commit/7f89fa32e8e9251b0b780009c340bc0d8f4d2e88
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M libcxxabi/src/demangle/ItaniumDemangle.h
    M llvm/include/llvm/Demangle/ItaniumDemangle.h

  Log Message:
  -----------
  [demangler][NFC] Tabularize operator name parsing

We need to parse operator names 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.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D119467




More information about the All-commits mailing list