@@ -571,13 +571,9 @@ pub trait Processor {
571571 fn finished_first_collection ( & mut self , _: ProfileKind ) -> bool {
572572 false
573573 }
574-
575- fn measure_rustc ( & mut self , _: Compiler < ' _ > ) -> anyhow:: Result < ( ) > {
576- Ok ( ( ) )
577- }
578574}
579575
580- pub struct MeasureProcessor < ' a > {
576+ pub struct BenchProcessor < ' a > {
581577 rt : & ' a mut Runtime ,
582578 benchmark : & ' a BenchmarkName ,
583579 conn : & ' a mut dyn database:: Connection ,
@@ -589,7 +585,7 @@ pub struct MeasureProcessor<'a> {
589585 tries : u8 ,
590586}
591587
592- impl < ' a > MeasureProcessor < ' a > {
588+ impl < ' a > BenchProcessor < ' a > {
593589 pub fn new (
594590 rt : & ' a mut Runtime ,
595591 conn : & ' a mut dyn database:: Connection ,
@@ -615,7 +611,7 @@ impl<'a> MeasureProcessor<'a> {
615611 assert ! ( has_tracelog) ;
616612 }
617613
618- MeasureProcessor {
614+ BenchProcessor {
619615 rt,
620616 upload : None ,
621617 conn,
@@ -722,6 +718,16 @@ impl<'a> MeasureProcessor<'a> {
722718 self . rt
723719 . block_on ( async move { while let Some ( ( ) ) = buf. next ( ) . await { } } ) ;
724720 }
721+
722+ pub fn measure_rustc ( & mut self , compiler : Compiler < ' _ > ) -> anyhow:: Result < ( ) > {
723+ rustc:: measure (
724+ self . rt ,
725+ self . conn ,
726+ compiler,
727+ self . artifact ,
728+ self . artifact_row_id ,
729+ )
730+ }
725731}
726732
727733struct Upload ( std:: process:: Child , tempfile:: NamedTempFile ) ;
@@ -812,7 +818,7 @@ impl Upload {
812818 }
813819}
814820
815- impl < ' a > Processor for MeasureProcessor < ' a > {
821+ impl < ' a > Processor for BenchProcessor < ' a > {
816822 fn profiler ( & self , _profile : ProfileKind ) -> Profiler {
817823 if self . is_first_collection && self . is_self_profile {
818824 if cfg ! ( unix) {
@@ -897,16 +903,6 @@ impl<'a> Processor for MeasureProcessor<'a> {
897903 }
898904 }
899905 }
900-
901- fn measure_rustc ( & mut self , compiler : Compiler < ' _ > ) -> anyhow:: Result < ( ) > {
902- rustc:: measure (
903- self . rt ,
904- self . conn ,
905- compiler,
906- self . artifact ,
907- self . artifact_row_id ,
908- )
909- }
910906}
911907
912908pub struct ProfileProcessor < ' a > {
@@ -1231,15 +1227,6 @@ impl<'a> Processor for ProfileProcessor<'a> {
12311227
12321228impl Benchmark {
12331229 pub fn new ( name : String , path : PathBuf ) -> anyhow:: Result < Self > {
1234- if name == "rustc" {
1235- return Ok ( Benchmark {
1236- name : BenchmarkName ( name) ,
1237- path,
1238- patches : vec ! [ ] ,
1239- config : BenchmarkConfig :: default ( ) ,
1240- } ) ;
1241- }
1242-
12431230 let mut patches = vec ! [ ] ;
12441231 for entry in fs:: read_dir ( & path) ? {
12451232 let entry = entry?;
@@ -1359,10 +1346,6 @@ impl Benchmark {
13591346 ) -> anyhow:: Result < ( ) > {
13601347 let iterations = iterations. unwrap_or ( self . config . runs ) ;
13611348
1362- if self . name . 0 == "rustc" {
1363- return processor. measure_rustc ( compiler) . context ( "measure rustc" ) ;
1364- }
1365-
13661349 if self . config . disabled || profile_kinds. is_empty ( ) {
13671350 eprintln ! ( "Skipping {}: disabled" , self . name) ;
13681351 bail ! ( "disabled benchmark" ) ;
0 commit comments