LLVM-CXXMAP(1)

πŸ’… LLVM-CXXMAP πŸ’…

okay bestie, welcome to llvm-cxxmap β€” the mangled name remapping tool from your friends over in LLVM. it lives in section 1 of the manual, and honestly? it's giving "niche but iconic." πŸŽ€


✨ NAME ✨

llvm-cxxmap β€” mangled name remapping tool πŸ¦‹


🌸 SYNOPSIS 🌸

llvm-cxxmap [options] symbol-file-1 symbol-file-2

πŸ’– DESCRIPTION πŸ’–

so here's the vibe: llvm-cxxmap does fuzzy matching of C++ mangled names, and it figures out what matches what based on a file that tells it which name components should be considered equivalent. lowkey genius. 🧠✨

the symbol files should each contain a list of C++ mangled names, one per line β€” like, respectfully, one name per line, that's the rule. blank lines and lines starting with # are ignored (yes queen, comment your stuff).

the output is a list of pairs of equivalent symbols, one per line, of the form:

<symbol-1> <symbol-2>

where <symbol-1> is a symbol from symbol-file-1 and <symbol-2> is a symbol from symbol-file-2. and bestie, listen β€” mappings for which the two symbols are identical are omitted. if it's the same symbol, we don't talk about it. periodt. πŸ’…


πŸ”₯ OPTIONS πŸ”₯

  • -remapping-file=file, -r=file β€” point this at a file containing the list of equivalence rules that get used to decide whether two symbols are equivalent. it's required, no cap. see the remapping file section below for the tea. πŸ«–
  • -output=file, -o=file β€” where the list of matched names gets written. if you don't specify it, it goes to stdout. no biggie.
  • -Wambiguous β€” produce a warning if there are multiple equivalent (but distinct) symbols in symbol-file-2. multiple matches? messy. you get warned. 😭
  • -Wincomplete β€” produce a warning if symbol-file-1 contains a symbol that has no equivalent symbol in symbol-file-2. like, hello? where's their match? πŸ‘€

🌈 REMAPPING FILE 🌈

the remapping file is a text file containing lines of the form:

fragmentkind fragment1 fragment2

where fragmentkind is one of name, type, or encoding β€” indicating whether the following mangled name fragments are names (<http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.name>), types (<http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.type>), or encodings (<http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.encoding>), respectively. blank lines and lines starting with # are ignored here too. consistency slay. ✨

unmangled C names can be expressed as an encoding that is a (length-prefixed) source-name (<http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangle.source-name>):

# C function "void foo_bar()" is remapped to C++ function "void foo::bar()".
encoding 7foo_bar _Z3foo3barv

for convenience, built-in substitutions such as St and Ss are accepted as names β€” even though they technically are not names. we don't gatekeep here. πŸ™ˆ

for example, to specify that absl::string_view and std::string_view should be treated as equivalent, the following remapping file could be used:

# absl::string_view is considered equivalent to std::string_view
type N4absl11string_viewE St17basic_string_viewIcSt11char_traitsIcEE

# std:: might be std::__1:: in libc++ or std::__cxx11:: in libstdc++
name St St3__1
name St St7__cxx11

⭐ Note ⭐

symbol remapping is currently only supported for C++ mangled names following the Itanium C++ ABI mangling scheme. this covers all C++ targets supported by Clang other than Windows targets. so if you're on Windows, bestie… this is not your era. πŸ’€

πŸ‘‘ Author πŸ‘‘

maintained by the LLVM Team (<https://llvm.org/>). absolute icons. 🫢


2003-2026, LLVM Project


and that's the whole page!! no notes, ate and left no crumbs πŸ’œ β€” this one's from LLVM, version 15, dated 2026-09-09, so if you ever need to cite it in a group chat, now you know. bye bestie, go remap some mangled names πŸ¦‹πŸŒΈπŸ“

πŸ“¦ where this page comes from