Skip to content

Commit 2c0c87d

Browse files
pcwaltonkhei4
authored andcommitted
rustc_llvm: Add a -Z print-llvm-stats option to expose LLVM statistics.
LLVM has a neat [statistics] feature that tracks how often optimizations kick in. It's very handy for optimization work. Since we expose the LLVM pass timings, I thought it made sense to expose the LLVM statistics too. [statistics]: https://llvm.org/docs/ProgrammersManual.html#the-statistic-class-stats-option
1 parent d873fa7 commit 2c0c87d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ impl WriteBackendMethods for GccCodegenBackend {
239239
unimplemented!();
240240
}
241241

242+
fn print_statistics(&self) {
243+
unimplemented!()
244+
}
245+
242246
unsafe fn optimize(_cgcx: &CodegenContext<Self>, _diag_handler: &Handler, module: &ModuleCodegen<Self::Module>, config: &ModuleConfig) -> Result<(), FatalError> {
243247
module.module_llvm.context.set_optimization_level(to_gcc_opt_level(config.opt_level));
244248
Ok(())

0 commit comments

Comments
 (0)