-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a --files option to analyse rustc's --emit=llvm-lines output. #32
Conversation
/// Analyze .ll files that were produced by eg. `RUSTFLAGS="--emit=llvm-ir" ./x.py build --stage 0 compiler/rustc`. | ||
/// Supports globs, eg `./build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/debug/deps/*.ll` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a little more complicated of an example than you need to give in public docs. It's better suited for rustc-dev-guide IMO.
/// Analyze .ll files that were produced by eg. `RUSTFLAGS="--emit=llvm-ir" ./x.py build --stage 0 compiler/rustc`. | |
/// Supports globs, eg `./build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/debug/deps/*.ll` | |
/// Analyze .ll files produced by `RUSTFLAGS="--emit=llvm-ir"`. | |
/// | |
/// Supports globs, e.g. `./build/debug/deps/*.ll` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in #33.
@@ -50,6 +51,17 @@ enum Opt { | |||
)] | |||
sort: SortOrder, | |||
|
|||
/// Analyze .ll files that were produced by eg. `RUSTFLAGS="--emit=llvm-ir" ./x.py build --stage 0 compiler/rustc`. | |||
/// Supports globs, eg `./build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/debug/deps/*.ll` | |||
// zsh substitutes the glob with a list of files, therefore this needs to be a Vec. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to both support globs and multiple files? It seems easier to let the shell expand the glob instead (and means less dependencies for llvm-lines).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in #33 to leave globbing to the shell.
@@ -50,6 +51,17 @@ enum Opt { | |||
)] | |||
sort: SortOrder, | |||
|
|||
/// Analyze .ll files that were produced by eg. `RUSTFLAGS="--emit=llvm-ir" ./x.py build --stage 0 compiler/rustc`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should mention that it ignores files that don't end in .ll
, I would not expect that behavior. Maybe it shouldn't ignore them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in #33 to not ignore any files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks for addressing the review! |
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:
I successfully used this in rust-lang/rust#76680.