[all-commits] [llvm/llvm-project] 562ce1: [demangler] Avoid special-subst code duplication

Nathan Sidwell via All-commits all-commits at lists.llvm.org
Fri May 13 04:35:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 562ce15924560d14f7062173cbdc6a9cd778e2eb
      https://github.com/llvm/llvm-project/commit/562ce15924560d14f7062173cbdc6a9cd778e2eb
  Author: Nathan Sidwell <nathan at acm.org>
  Date:   2022-05-13 (Fri, 13 May 2022)

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

  Log Message:
  -----------
  [demangler] Avoid special-subst code duplication

We need to expand special substitutions in four different ways.  This
refactors to only have one conversion from enum to string, and derive
the other 3 needs off that.

The SpecialSubstitution node is derived from the
ExpandedSpecialSubstitution.  While this may seem unintuitive, it
works out quite well, as SpecialSubstitution can then use the former's
getBaseName and remove an unneeded 'basic_' prefix, for those
substitutions that are instantiations (to known typedef).  Similarly
all those instantiations use the same set of template arguments (with
'basic_string', getting an additional 'allocator' arg).

Expansion tests were added in D123134, and remain unchanged.

Reviewed By: MaskRay, dblaikie

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




More information about the All-commits mailing list