Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the Rust compiler to dump out the LLVM it generates?

Tags:

rust

llvm-ir

I'd like to see the LLVM that the Rust compiler generates. Even better would be to have it just dump out LLVM and stop. This could be in bitcode format or assembler text.

like image 609
rocky Avatar asked Dec 04 '22 00:12

rocky


1 Answers

You can pass the formats which you want to --emit

e.g.

rustc --emit=asm,llvm-bc,llvm-ir xxx.rs

or

cargo rustc -- --emit=asm,llvm-bc,llvm-ir

more information please see rustc --help

like image 192
wdv4758h Avatar answered May 16 '23 07:05

wdv4758h