LLVM-CXXMAP(1)

πŸ’… llvm-cxxmap β€” the mangled-name remapping tool, bestie edition

okay so this one's a little LLVM command-line tool, and it's genuinely so useful once you get what it does. It lives in the LLVM family, and honestly? It ate.


✨ SYNOPSIS ✨

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

🌸 DESCRIPTION 🌸

So llvm-cxxmap does fuzzy matching of C++ mangled names β€” and the way it decides what counts as "the same" is by reading a file that tells it which name components should be considered equivalent. That's the whole vibe: you hand it a rulebook, it hands you back the matches. 🫢

Your symbol files are just lists of C++ mangled names, one per line. Blank lines? Ignored. Lines starting with #? Also ignored, they're just commentary, no notes taken. πŸ’…

The output is a list of pairs of equivalent symbols, one per line, looking exactly like this:

<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 here's the cute part β€” mappings where the two symbols are identical get omitted. No point stating the obvious, right? 😌


πŸŽ€ OPTIONS πŸŽ€

  • -remapping-file=file, -r=file β€” gives it a file with the list of equivalence rules it should use to decide whether two symbols are equivalent. This one is required, bestie, no skipping. See REMAPPING FILE below for the tea. πŸ“
  • -output=file, -o=file β€” names a file to write the list of matched names into. If you don't specify one, the list just goes to stdout like a normal little program. ✨
  • -Wambiguous β€” throws a warning if there are multiple equivalent (but distinct) symbols sitting in symbol-file-2. Like, which one did you mean?? 😭
  • -Wincomplete β€” throws a warning if symbol-file-1 contains a symbol that has no equivalent symbol in symbol-file-2. Heartbreaking. Absolutely heartbreaking. πŸ’€

πŸ¦‹ REMAPPING FILE πŸ¦‹

This is a text file, and every line in it looks like:

fragmentkind fragment1 fragment2

where fragmentkind is one of name, type, or encoding β€” it's telling you whether the mangled name fragments that follow are <name>s, <type>s, or <encoding>s respectively. The links for the curious (fr fr, they're in the original, so they're here too):

Blank lines and lines starting with # are ignored here too. πŸŽ€

Unmangled C names can be expressed as an encoding that's a (length-prefixed) <source-name> β€” link: 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

And for convenience, built-in <substitution>s such as St and Ss are accepted as <name>s β€” even though technically they are not <name>s. 🀫 (we don't gatekeep here)


πŸ’– the example, because it's iconic

Say you want absl::string_view and std::string_view to be treated as equivalent. Your remapping file would look like:

# 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

See how it works? Obsessed. 🌈


Note: ⚠️ symbol remapping is currently only supported for C++ mangled names following the Itanium C++ ABI mangling scheme. That covers all the C++ targets Clang supports β€” other than Windows targets. Not a Windows girlie, sorry. πŸ™ˆ

πŸ‘‘ Author πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). Slay.


2003-2026, LLVM Project


and that's the whole page, bestie 🫢 go remap some mangled names, you're gonna do amazing. this little manpage moment was brought to you by LLVM, version 23, dated 2026-10-20 β€” mwah πŸ’œβœ¨

πŸ“¦ where this page comes from
  • arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms