gnzlbg / cargo-asm

cargo subcommand showing the assembly or llvm-ir generated for Rust code
https://github.com/gnzlbg/cargo-asm
Other
1.17k stars 36 forks source link

Support for -Z asm-comments #58

Open GabrielMajeri opened 6 years ago

GabrielMajeri commented 6 years ago

A recent rust-lang PR added support for LLVM assembly comment output. While only available on nightly, it would be great if cargo asm could support them.

Currently, the following commands don't work:

$ RUSTFLAGS="-Z asm-comments" cargo asm
thread 'main' panicked at 'line starts with _ but we failed to parse the label: ...
gnzlbg commented 6 years ago

Yep, I've asked if there are any plans to stabilize that flag but there aren't any already so this won't work with the stable Rust compilers for the time being. We can detect if the compiler is a nightly compiler, and pass it the flag if that's the case.