@@ -181,6 +181,7 @@ pub enum Profiler {
181181 LlvmLines ,
182182 MonoItems ,
183183 DepGraph ,
184+ LlvmIr ,
184185}
185186
186187impl Profiler {
@@ -203,6 +204,7 @@ impl Profiler {
203204 "llvm-lines" => Ok ( Profiler :: LlvmLines ) ,
204205 "mono-items" => Ok ( Profiler :: MonoItems ) ,
205206 "dep-graph" => Ok ( Profiler :: DepGraph ) ,
207+ "llvm-ir" => Ok ( Profiler :: LlvmIr ) ,
206208 _ => Err ( anyhow ! ( "'{}' is not a known profiler" , name) ) ,
207209 }
208210 }
@@ -225,6 +227,7 @@ impl Profiler {
225227 Profiler :: LlvmLines => "llvm-lines" ,
226228 Profiler :: MonoItems => "mono-items" ,
227229 Profiler :: DepGraph => "dep-graph" ,
230+ Profiler :: LlvmIr => "llvm-ir" ,
228231 }
229232 }
230233
@@ -246,6 +249,7 @@ impl Profiler {
246249 | Profiler :: Massif
247250 | Profiler :: DepGraph
248251 | Profiler :: MonoItems
252+ | Profiler :: LlvmIr
249253 | Profiler :: Eprintln => {
250254 if profile_kind == ProfileKind :: Doc {
251255 Some ( "rustdoc" )
@@ -275,6 +279,7 @@ impl Profiler {
275279 | Profiler :: DHAT
276280 | Profiler :: Massif
277281 | Profiler :: MonoItems
282+ | Profiler :: LlvmIr
278283 | Profiler :: Eprintln => true ,
279284 // only incremental
280285 Profiler :: DepGraph => scenario_kind != ScenarioKind :: Full ,
@@ -1206,6 +1211,12 @@ impl<'a> Processor for ProfileProcessor<'a> {
12061211 fs:: copy ( & tmp_file, & output) ?;
12071212 }
12081213
1214+ Profiler :: LlvmIr => {
1215+ let tmp_file = filepath ( data. cwd . as_ref ( ) , "llvm-ir" ) ;
1216+ let output = filepath ( self . output_dir , & out_file ( "llir" ) ) ;
1217+ fs:: copy ( & tmp_file, & output) ?;
1218+ }
1219+
12091220 // `cargo llvm-lines` writes its output to stdout. We copy that
12101221 // output into a file in the output dir.
12111222 Profiler :: LlvmLines => {
0 commit comments