[PATCH] D125418: [Arm64EC 6/?] Implement C/C++ mangling for Arm64EC function definitions.

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 13:52:27 PDT 2022


efriedma created this revision.
Herald added subscribers: zzheng, kristof.beyls.
Herald added a project: All.
efriedma requested review of this revision.
Herald added a project: clang.

Part of initial Arm64EC patchset.

For the Arm64EC ABI, ARM64 functions have an alternate name.  For C code, this name is just the original name prefixed with "#".  For C++ code, we stick a "$$h" modifier in the middle of the mangling.

For functions which are not hybrid_patchable, the normal name is then an alias for the alternate name.  (For functions that are patchable, we have to do something more complicated to tell the linker to generate a stub; I haven't tried to implement that yet.)

This doesn't emit quite the same symbols table as MSVC for simple cases: MSVC generates a IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY alias, where this just makes another symbol pointing at the function definition. This probably matters for the hybmp$x table, but I don't have the complete documentation at the moment.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125418

Files:
  clang/include/clang/AST/Mangle.h
  clang/lib/AST/MicrosoftMangle.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/test/CodeGen/arm64ec.c
  clang/test/CodeGenCXX/arm64ec.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125418.428767.patch
Type: text/x-patch
Size: 5867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220511/8d4b3413/attachment.bin>


More information about the cfe-commits mailing list