xref: /openbsd-src/gnu/llvm/llvm/docs/CommandGuide/llvm-cxxfilt.rst (revision 73471bf04ceb096474c7f0fa83b1b65c70a787a1)
109467b48Spatrickllvm-cxxfilt - LLVM symbol name demangler
209467b48Spatrick=========================================
309467b48Spatrick
409467b48Spatrick.. program:: llvm-cxxfilt
509467b48Spatrick
609467b48SpatrickSYNOPSIS
709467b48Spatrick--------
809467b48Spatrick
909467b48Spatrick:program:`llvm-cxxfilt` [*options*] [*mangled names...*]
1009467b48Spatrick
1109467b48SpatrickDESCRIPTION
1209467b48Spatrick-----------
1309467b48Spatrick
1409467b48Spatrick:program:`llvm-cxxfilt` is a symbol demangler that can be used as a replacement
1509467b48Spatrickfor the GNU :program:`c++filt` tool. It takes a series of symbol names and
1609467b48Spatrickprints their demangled form on the standard output stream. If a name cannot be
1709467b48Spatrickdemangled, it is simply printed as is.
1809467b48Spatrick
1909467b48SpatrickIf no names are specified on the command-line, names are read interactively from
2009467b48Spatrickthe standard input stream. When reading names from standard input, each input
2109467b48Spatrickline is split on characters that are not part of valid Itanium name manglings,
2209467b48Spatricki.e. characters that are not alphanumeric, '.', '$', or '_'. Separators between
2309467b48Spatricknames are copied to the output as is.
2409467b48Spatrick
2509467b48SpatrickEXAMPLE
2609467b48Spatrick-------
2709467b48Spatrick
2809467b48Spatrick.. code-block:: console
2909467b48Spatrick
3009467b48Spatrick  $ llvm-cxxfilt _Z3foov _Z3bari not_mangled
3109467b48Spatrick  foo()
3209467b48Spatrick  bar(int)
3309467b48Spatrick  not_mangled
3409467b48Spatrick  $ cat input.txt
3509467b48Spatrick  | _Z3foov *** _Z3bari *** not_mangled |
3609467b48Spatrick  $ llvm-cxxfilt < input.txt
3709467b48Spatrick  | foo() *** bar(int) *** not_mangled |
3809467b48Spatrick
3909467b48SpatrickOPTIONS
4009467b48Spatrick-------
4109467b48Spatrick
4209467b48Spatrick.. option:: --format=<value>, -s
4309467b48Spatrick
4409467b48Spatrick  Mangling scheme to assume. Valid values are ``auto`` (default, auto-detect the
4509467b48Spatrick  style) and ``gnu`` (assume GNU/Itanium style).
4609467b48Spatrick
4709467b48Spatrick.. option:: --help, -h
4809467b48Spatrick
4909467b48Spatrick  Print a summary of command line options.
5009467b48Spatrick
51*097a140dSpatrick.. option:: --no-strip-underscore, -n
52*097a140dSpatrick
53*097a140dSpatrick  Do not strip a leading underscore. This is the default for all platforms
54*097a140dSpatrick  except Mach-O based hosts.
55*097a140dSpatrick
5609467b48Spatrick.. option:: --strip-underscore, -_
5709467b48Spatrick
58*097a140dSpatrick  Strip a single leading underscore, if present, from each input name before
59*097a140dSpatrick  demangling. On by default on Mach-O based platforms.
6009467b48Spatrick
6109467b48Spatrick.. option:: --types, -t
6209467b48Spatrick
6309467b48Spatrick  Attempt to demangle names as type names as well as function names.
6409467b48Spatrick
6509467b48Spatrick.. option:: --version
6609467b48Spatrick
6709467b48Spatrick  Display the version of the :program:`llvm-cxxfilt` executable.
6809467b48Spatrick
6909467b48Spatrick.. option:: @<FILE>
7009467b48Spatrick
7109467b48Spatrick Read command-line options from response file `<FILE>`.
7209467b48Spatrick
7309467b48SpatrickEXIT STATUS
7409467b48Spatrick-----------
7509467b48Spatrick
7609467b48Spatrick:program:`llvm-cxxfilt` returns 0 unless it encounters a usage error, in which
7709467b48Spatrickcase a non-zero exit code is returned.
7809467b48Spatrick
7909467b48SpatrickSEE ALSO
8009467b48Spatrick--------
8109467b48Spatrick
8209467b48Spatrick:manpage:`llvm-nm(1)`
83