rust/src/tools/rust-demangler
2022-01-08 11:39:34 +08:00
..
src Changed function signature to keep buffer handling out of lib 2021-04-03 11:42:54 -07:00
tests mangling_v0: Update tests for the rust-demangler tool 2022-01-08 11:39:34 +08:00
Cargo.toml Migrate to 2021 2021-09-20 22:21:42 -04:00
README.md Address review comments and Windows failure, and make cleaner 2021-04-03 18:03:50 -07:00

rust-demangler

Demangles rustc mangled names.

rust-demangler supports the requirements of the llvm-cov show -Xdemangler option, to perform Rust-specific symbol demangling:

The demangler is expected to read a newline-separated list of symbols from stdin and write a newline-separated list of the same length to stdout.

To use rust-demangler with llvm-cov for example:

$ TARGET="${PWD}/build/x86_64-unknown-linux-gnu"
$ "${TARGET}"/llvm/bin/llvm-cov show \
  --Xdemangler=path/to/rust-demangler \
  --instr-profile=main.profdata ./main --show-line-counts-or-regions

rust-demangler is a Rust "extended tool", used in Rust compiler tests, and optionally included in Rust distributions that enable coverage profiling. Symbol demangling is implemented using the rustc-demangle crate.

(Note, for Rust developers, the third-party tool rustfilt also supports llvm-cov symbol demangling. rustfilt is a more generalized tool that searches any body of text, using pattern matching, to find and demangle Rust symbols.)

License

Rust-demangler is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.