[all-commits] [llvm/llvm-project] fa0cf3: [llvm][aarch64] Fix Arm64EC name mangling algorith...

Daniel Paoliello via All-commits all-commits at lists.llvm.org
Wed Nov 13 15:35:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa0cf3d39e03c3c63478f30a4c8c17d119b54b7f
      https://github.com/llvm/llvm-project/commit/fa0cf3d39e03c3c63478f30a4c8c17d119b54b7f
  Author: Daniel Paoliello <danpao at microsoft.com>
  Date:   2024-11-13 (Wed, 13 Nov 2024)

  Changed paths:
    M llvm/include/llvm/Demangle/Demangle.h
    M llvm/include/llvm/Demangle/MicrosoftDemangle.h
    M llvm/include/llvm/IR/Mangler.h
    M llvm/lib/Demangle/MicrosoftDemangle.cpp
    M llvm/lib/IR/Mangler.cpp
    M llvm/unittests/IR/ManglerTest.cpp

  Log Message:
  -----------
  [llvm][aarch64] Fix Arm64EC name mangling algorithm (#115567)

Arm64EC uses a special name mangling mode that adds `$$h` between the
symbol name and its type. In MSVC's name mangling `@` is used to
separate the name and type BUT it is also used for other purposes, such
as the separator between paths in a fully qualified name.

The original algorithm was quite fragile and made assumptions that
didn't hold true for all MSVC mangled symbols, so instead of trying to
improve this algorithm we are now using the demangler to indicate where
the insertion point should be (i.e., to parse the fully-qualified name
and return the current string offset).

Also fixed `isArm64ECMangledFunctionName` to search for `@$$h` since the
`$$h` must always be after a `@`.

Fixes #115231



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list