about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-02 12:48:44 +0000
committerbors <bors@rust-lang.org>2023-07-02 12:48:44 +0000
commit131a03664ef90d6443dfb567ac19e5466baa937f (patch)
treeffc0d22c74433638812919334b9375b5591b586c /compiler/rustc_codegen_gcc
parent4c3f8c728bd621fa6d9c783e8350485fd8b52e7f (diff)
parent62728c7aaff0441b12057de8f1be620feb96652c (diff)
downloadrust-131a03664ef90d6443dfb567ac19e5466baa937f.tar.gz
rust-131a03664ef90d6443dfb567ac19e5466baa937f.zip
Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko
Add `-Zremark-dir` unstable flag to write LLVM optimization remarks to YAML

This PR adds an option for `rustc` to emit LLVM optimization remarks to a set of YAML files, which can then be digested by existing tools, like https://github.com/OfekShilon/optview2. When `-Cremark-dir` is passed, and remarks are enabled (`-Cremark=all`), the remarks will be now written to the specified directory, **instead** of being printed to standard error output.  The files are named based on the CGU from which they are being generated.

Currently, the remarks are written using the LLVM streaming machinery, directly in the diagnostics handler. It seemed easier than going back to Rust and then form there back to C++ to use the streamer from the diagnostics handler. But there are many ways to implement this, of course, so I'm open to suggestions :)

I included some comments with questions into the code. Also, I'm not sure how to test this.

r? `@tmiasko`
Diffstat (limited to 'compiler/rustc_codegen_gcc')
0 files changed, 0 insertions, 0 deletions