Add FFI bindings for LLVM's Module::getInstructionCount()#65720
Add FFI bindings for LLVM's Module::getInstructionCount()#65720bors merged 1 commit intorust-lang:masterfrom
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
r? @eddyb |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
It doesn't even seem to work on CI, so it might be a new addition? |
|
This API was added in llvm/llvm-project@e49374d which is in LLVM 7. |
|
So, we can't merge this PR as is because of our LLVM version requirements. This could be solved by adding a version check ( |
|
Sure, I can add it. It's not a huge deal either way but it doesn't look like a lot of work either. Thanks! |
|
Added a version check. Is there anything more useful this can do besides just returning 0 if the LLVM version < 7, though? |
|
It's a bit subjective but for this use case (interactive, optional) I personally would crash with an error message to avoid silently producing misleading results. Something like |
|
Done, thanks! |
|
r=me but please squash the commits |
Just to make it useable for profiling and such inside rustc itself. It was vaguely useful in https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured I might as well upstream it; I may or may not ever get around to doing more with it (hopefully I will), but it may be useful for others.
b79efa8 to
567962d
Compare
|
Thank you triage, commits squashed. |
|
Thanks! @bors r+ rollup |
|
📌 Commit 567962d has been approved by |
…=rkruppe Add FFI bindings for LLVM's Module::getInstructionCount() Just to make it usable for profiling and such inside rustc itself. It was vaguely useful in https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured I might as well upstream it; I may or may not ever get around to doing more with it (hopefully I will), but it may be useful for others.
Rollup of 10 pull requests Successful merges: - #65136 (Update codegen option documentation.) - #65574 (docs: improve disclaimer regarding LinkedList) - #65720 (Add FFI bindings for LLVM's Module::getInstructionCount()) - #65905 ([doc] fixes for unix/vxworks `OpenOptionsExt::mode`) - #65962 (Fix logic in example.) - #66019 (Improved std::iter::Chain documentation) - #66038 (doc(str): show example of chars().count() under len()) - #66042 (Suggest correct code when encountering an incorrect trait bound referencing the current trait) - #66073 (Do not needlessly write-lock) - #66096 (Add a failing UI test for multiple loops of all kinds in a `const`) Failed merges: r? @ghost
Just to make it usable for profiling and such inside
rustc itself. It was vaguely useful in
https://wiki.alopex.li/WhereRustcSpendsItsTime and I figured
I might as well upstream it; I may or may not ever get around
to doing more with it (hopefully I will), but it may be useful
for others.