@@ -181,6 +181,7 @@ pub enum Profiler {
181
181
LlvmLines ,
182
182
MonoItems ,
183
183
DepGraph ,
184
+ LlvmIr ,
184
185
}
185
186
186
187
impl Profiler {
@@ -203,6 +204,7 @@ impl Profiler {
203
204
"llvm-lines" => Ok ( Profiler :: LlvmLines ) ,
204
205
"mono-items" => Ok ( Profiler :: MonoItems ) ,
205
206
"dep-graph" => Ok ( Profiler :: DepGraph ) ,
207
+ "llvm-ir" => Ok ( Profiler :: LlvmIr ) ,
206
208
_ => Err ( anyhow ! ( "'{}' is not a known profiler" , name) ) ,
207
209
}
208
210
}
@@ -225,6 +227,7 @@ impl Profiler {
225
227
Profiler :: LlvmLines => "llvm-lines" ,
226
228
Profiler :: MonoItems => "mono-items" ,
227
229
Profiler :: DepGraph => "dep-graph" ,
230
+ Profiler :: LlvmIr => "llvm-ir" ,
228
231
}
229
232
}
230
233
@@ -246,6 +249,7 @@ impl Profiler {
246
249
| Profiler :: Massif
247
250
| Profiler :: DepGraph
248
251
| Profiler :: MonoItems
252
+ | Profiler :: LlvmIr
249
253
| Profiler :: Eprintln => {
250
254
if profile_kind == ProfileKind :: Doc {
251
255
Some ( "rustdoc" )
@@ -275,6 +279,7 @@ impl Profiler {
275
279
| Profiler :: DHAT
276
280
| Profiler :: Massif
277
281
| Profiler :: MonoItems
282
+ | Profiler :: LlvmIr
278
283
| Profiler :: Eprintln => true ,
279
284
// only incremental
280
285
Profiler :: DepGraph => scenario_kind != ScenarioKind :: Full ,
@@ -1206,6 +1211,12 @@ impl<'a> Processor for ProfileProcessor<'a> {
1206
1211
fs:: copy ( & tmp_file, & output) ?;
1207
1212
}
1208
1213
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
+
1209
1220
// `cargo llvm-lines` writes its output to stdout. We copy that
1210
1221
// output into a file in the output dir.
1211
1222
Profiler :: LlvmLines => {
0 commit comments