[PATCH] D116774: AST: Move __va_list tag to the top level on ARM architectures.

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 6 15:37:13 PST 2022


pcc created this revision.
pcc added reviewers: rsmith, eugenis, jrtc27.
Herald added a subscriber: kristof.beyls.
pcc requested review of this revision.
Herald added a project: clang.

In post-commit feedback on D104830 <https://reviews.llvm.org/D104830> Jessica Clarke pointed out that
unconditionally adding __va_list to the std namespace caused namespace
debug info to be emitted in C, which is not only inappropriate but
turned out to confuse the dtrace tool. Therefore, move __va_list to the
top level unconditionally so that the correct debug info is generated.

To avoid breaking name mangling for __va_list, teach the Itanium name
mangler to mangle it as if it were in the std namespace when targeting
ARM architectures. This logic is not needed for the Microsoft name
mangler because Microsoft platforms define va_list as a typedef of
char *.

It was also noted that 32-bit ARM has the same issue as was fixed
for 64-bit ARM in D104830 <https://reviews.llvm.org/D104830>, so do the same for that architecture.

Depends on D116773 <https://reviews.llvm.org/D116773>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116774

Files:
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/ItaniumMangle.cpp
  clang/test/CodeGen/aarch64-varargs.c
  clang/test/CodeGen/arm64-be-hfa-vararg.c
  clang/test/Headers/stdarg.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116774.398008.patch
Type: text/x-patch
Size: 72425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220106/ac187585/attachment-0001.bin>


More information about the cfe-commits mailing list