[all-commits] [llvm/llvm-project] 4cf98f: [GH54588]Fix ItaniumMangler for NTTP unnamed union...

Erich Keane via All-commits all-commits at lists.llvm.org
Fri Apr 1 11:48:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4cf98f973a13c5049322abff43f0dff3c214311b
      https://github.com/llvm/llvm-project/commit/4cf98f973a13c5049322abff43f0dff3c214311b
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2022-04-01 (Fri, 01 Apr 2022)

  Changed paths:
    M clang/lib/AST/ItaniumMangle.cpp
    A clang/test/CodeGenCXX/mangle-nttp-anon-union.cpp

  Log Message:
  -----------
  [GH54588]Fix ItaniumMangler for NTTP unnamed unions w/ unnamed structs

As reported in https://github.com/llvm/llvm-project/issues/54588
and discussed in https://github.com/itanium-cxx-abi/cxx-abi/issues/139

We are supposed to do a DFS, pre-order, decl-order search for a name for
the union in this case. Prevoiusly we crashed because the IdentiferInfo
pointer was nullptr, so this makes sure we have a name in the cases
described by the ABI.

I added an llvm-unreachable to cover an unexpected case at the end of
the new function with information/reference to the ABI in case we come
up with some way to get back to here.

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




More information about the All-commits mailing list