Understand the difference between rust-* tools and cargo subcommands
masterThe project provides two ways to interact with LLVM tools:
Direct Proxies (
rust-*): These are direct proxies for the LLVM tools in thellvm-toolscomponent. They require you to pass the path to the artifact manually. Example:rust-size target/debug/my-appCargo Subcommands (
cargo *): These are 'sugar' for a two-step process: they first build the project using Cargo and then run the corresponding LLVM tool on the resulting artifact. This is known as "build and inspect" mode. Example:cargo size --example foo(which runscargo build --example foofollowed byrust-sizeon the output).
Key Features of Cargo Subcommands:
- Automatic Demangling: All Rust symbols in the output are automatically demangled.
- Build and Inspect Mode: When used within a Cargo project, you can use flags like
--bin,--example,--lib,--target, and--releaseto automatically locate and pass the artifact path to the tool.