]> git.lizzy.rs Git - rust.git/blob - src/tools/rust-demangler/README.md
Make rust-demangler installable
[rust.git] / src / tools / rust-demangler / README.md
1 # rust-demangler
2
3 Demangles rustc mangled names.
4
5 This tool uses the [rustc-demangle](https://crates.io/crates/rustc-demangle)
6 crate to convert an input buffer of newline-separated mangled names into their
7 demangled translations.
8
9 This tool takes a list of mangled names (one per line) on standard input, and
10 prints a corresponding list of demangled names. The tool is designed to support
11 programs that can leverage a third-party demangler, such as `llvm-cov`, via the
12 `-Xdemangler=<path-to-demangler>` option.
13
14 To use `rust-demangler` with `llvm-cov` for example, add the `-Xdemangler=...`
15 option:
16
17 ```shell
18 $ TARGET="${PWD}/build/x86_64-unknown-linux-gnu"
19 $ "${TARGET}"/llvm/bin/llvm-cov show \
20   --Xdemangler=path/to/rust-demangler \
21   --instr-profile=main.profdata ./main --show-line-counts-or-regions
22 ```
23
24 ## License
25
26 Rust-demangler is distributed under the terms of both the MIT license and the
27 Apache License (Version 2.0).
28
29 See [LICENSE-APACHE](/LICENSE-APACHE) and [LICENSE-MIT](/LICENSE-MIT) for details.