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

Daniel Paoliello via All-commits all-commits at lists.llvm.org
Fri Nov 15 00:26:11 PST 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 81005af65fa40638d8766b1b10bdb0dd705bf782
      https://github.com/llvm/llvm-project/commit/81005af65fa40638d8766b1b10bdb0dd705bf782
  Author: Daniel Paoliello <danpao at microsoft.com>
  Date:   2024-11-15 (Fri, 15 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