[PATCH] D122820: [GH54588]Fix ItaniumMangler for NTTP unnamed unions w/ unnamed structs

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 07:43:15 PDT 2022


erichkeane created this revision.
erichkeane added reviewers: rjmccall, aaron.ballman, tahonermann.
Herald added a project: All.
erichkeane requested review of this revision.

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.


https://reviews.llvm.org/D122820

Files:
  clang/lib/AST/ItaniumMangle.cpp
  clang/test/CodeGenCXX/mangle-nttp-anon-union.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122820.419456.patch
Type: text/x-patch
Size: 5608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220331/c66a3cc3/attachment.bin>


More information about the cfe-commits mailing list