@@ -180,6 +180,7 @@ pub enum Profiler {
180180 Eprintln ,
181181 LlvmLines ,
182182 MonoItems ,
183+ DepGraph ,
183184}
184185
185186impl Profiler {
@@ -201,6 +202,7 @@ impl Profiler {
201202 "eprintln" => Ok ( Profiler :: Eprintln ) ,
202203 "llvm-lines" => Ok ( Profiler :: LlvmLines ) ,
203204 "mono-items" => Ok ( Profiler :: MonoItems ) ,
205+ "dep-graph" => Ok ( Profiler :: DepGraph ) ,
204206 _ => Err ( anyhow ! ( "'{}' is not a known profiler" , name) ) ,
205207 }
206208 }
@@ -222,6 +224,7 @@ impl Profiler {
222224 Profiler :: Eprintln => "eprintln" ,
223225 Profiler :: LlvmLines => "llvm-lines" ,
224226 Profiler :: MonoItems => "mono-items" ,
227+ Profiler :: DepGraph => "dep-graph" ,
225228 }
226229 }
227230
@@ -241,6 +244,7 @@ impl Profiler {
241244 | Profiler :: Callgrind
242245 | Profiler :: DHAT
243246 | Profiler :: Massif
247+ | Profiler :: DepGraph
244248 | Profiler :: MonoItems
245249 | Profiler :: Eprintln => {
246250 if build_kind == BuildKind :: Doc {
@@ -272,6 +276,8 @@ impl Profiler {
272276 | Profiler :: Massif
273277 | Profiler :: MonoItems
274278 | Profiler :: Eprintln => true ,
279+ // only incremental
280+ Profiler :: DepGraph => scenario_kind != ScenarioKind :: Full ,
275281 Profiler :: LlvmLines => scenario_kind == ScenarioKind :: Full ,
276282 }
277283 }
@@ -1183,6 +1189,21 @@ impl<'a> Processor for ProfileProcessor<'a> {
11831189 }
11841190 }
11851191
1192+ Profiler :: DepGraph => {
1193+ let tmp_file = filepath ( data. cwd . as_ref ( ) , "dep_graph.txt" ) ;
1194+ let output =
1195+ filepath ( self . output_dir , & out_file ( "dep-graph" ) ) . with_extension ( "txt" ) ;
1196+
1197+ fs:: copy ( & tmp_file, & output) ?;
1198+
1199+ let tmp_file = filepath ( data. cwd . as_ref ( ) , "dep_graph.dot" ) ;
1200+ let output =
1201+ filepath ( self . output_dir , & out_file ( "dep-graph" ) ) . with_extension ( "dot" ) ;
1202+
1203+ // May not exist if not incremental, but then that's OK.
1204+ fs:: copy ( & tmp_file, & output) ?;
1205+ }
1206+
11861207 // `cargo llvm-lines` writes its output to stdout. We copy that
11871208 // output into a file in the output dir.
11881209 Profiler :: LlvmLines => {
0 commit comments