dtolnay / cargo-llvm-lines

Count lines of LLVM IR per generic function
Apache License 2.0
414 stars 24 forks source link

Added a --files option to analyse rustc's --emit=llvm-lines output. #32

Closed Julian-Wollersberger closed 4 years ago

Julian-Wollersberger commented 4 years ago

Since you can't use cargo-llvm-lines with x.py, I added a --files option, so that I could measure the llvm-lines of rustc itself.

I'm also writing an entry in rustc-dev-guide. Example usage:

RUSTFLAGS="--emit=llvm-ir" ./x.py build --stage 0 compiler/rustc

# Single crate, eg. rustc_middle
cargo llvm-lines --files ./build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/debug/deps/rustc_middle* > llvm-lines-middle.txt
# Whole compiler at once
cargo llvm-lines --files ./build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/debug/deps/*.ll > llvm-lines.txt

I successfully used this in rust-lang/rust#76680.

Julian-Wollersberger commented 4 years ago

Thanks for addressing the review!