9292//! source-level module, functions from the same module will be available for
9393//! inlining, even when they are not marked `#[inline]`.
9494
95- // Manuel, fixing rebase
9695use rustc_symbol_mangling:: symbol_name_for_instance_in_crate;
9796use rustc_middle:: middle:: typetree:: { Kind , Type , TypeTree } ;
9897use rustc_target:: abi:: FieldsShape ;
@@ -1143,7 +1142,6 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Au
11431142 } )
11441143 . collect ( ) ;
11451144
1146-
11471145 let autodiff_items = items
11481146 . iter ( )
11491147 . filter_map ( |item| match * item {
@@ -1156,6 +1154,7 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Au
11561154 if !target_attrs. apply_autodiff ( ) {
11571155 return None ;
11581156 }
1157+ println ! ( "target_id: {:?}" , target_id) ;
11591158
11601159 let target_symbol =
11611160 symbol_name_for_instance_in_crate ( tcx, instance. clone ( ) , LOCAL_CRATE ) ;
@@ -1250,9 +1249,6 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Au
12501249
12511250 ( tcx. arena . alloc ( mono_items) , autodiff_items, codegen_units)
12521251}
1253- //use rustc_middle::ty::{self, Adt, ParamEnvAnd, Ty};
1254- //use rustc_target::abi::FieldsShape;
1255- //use std::iter;
12561252
12571253pub fn typetree_empty ( ) -> TypeTree {
12581254 TypeTree ( vec ! [ ] )
@@ -1263,19 +1259,14 @@ pub fn typetree_from_ty<'a>(ty: Ty<'a>, tcx: TyCtxt<'a>, depth: usize) -> TypeTr
12631259 if ty. is_fn_ptr ( ) {
12641260 unimplemented ! ( "what to do whith fn ptr?" ) ;
12651261 }
1266-
12671262 let inner_ty = ty. builtin_deref ( true ) . unwrap ( ) . ty ;
12681263 let child = typetree_from_ty ( inner_ty, tcx, depth + 1 ) ;
1269-
12701264 let tt = Type { offset : -1 , kind : Kind :: Pointer , size : 8 , child } ;
1271- //println!("{:depth$} add indirection {:?}", "", tt);
1272-
12731265 return TypeTree ( vec ! [ tt] ) ;
12741266 }
12751267
12761268 if ty. is_scalar ( ) {
12771269 assert ! ( !ty. is_any_ptr( ) ) ;
1278-
12791270 let ( kind, size) = if ty. is_integral ( ) {
12801271 ( Kind :: Integer , 8 )
12811272 } else {
@@ -1286,7 +1277,6 @@ pub fn typetree_from_ty<'a>(ty: Ty<'a>, tcx: TyCtxt<'a>, depth: usize) -> TypeTr
12861277 _ => panic ! ( "floatTy scalar that is neither f32 nor f64" ) ,
12871278 }
12881279 } ;
1289-
12901280 return TypeTree ( vec ! [ Type { offset: -1 , child: typetree_empty( ) , kind, size } ] ) ;
12911281 }
12921282
@@ -1311,7 +1301,6 @@ pub fn typetree_from_ty<'a>(ty: Ty<'a>, tcx: TyCtxt<'a>, depth: usize) -> TypeTr
13111301 FieldsShape :: Arbitrary { offsets : o, memory_index : m } => ( o, m) ,
13121302 _ => panic ! ( "" ) ,
13131303 } ;
1314- //println!("{:depth$} combine fields", "");
13151304
13161305 let fields = adt_def. all_fields ( ) ;
13171306 let fields = fields
@@ -1336,17 +1325,12 @@ pub fn typetree_from_ty<'a>(ty: Ty<'a>, tcx: TyCtxt<'a>, depth: usize) -> TypeTr
13361325 }
13371326 }
13381327
1339- //inner_tt.offset = offset;
1340-
1341- //println!("{:depth$} -> {:?}", "", child);
1342-
13431328 Some ( child)
13441329 } )
13451330 . flatten ( )
13461331 . collect :: < Vec < Type > > ( ) ;
13471332
13481333 let ret_tt = TypeTree ( fields) ;
1349- //println!("{:depth$} into {:?}", "", ret_tt);
13501334 return ret_tt;
13511335 } else {
13521336 unimplemented ! ( "adt that isn't a struct" ) ;
@@ -1378,8 +1362,6 @@ pub fn typetree_from_ty<'a>(ty: Ty<'a>, tcx: TyCtxt<'a>, depth: usize) -> TypeTr
13781362 . collect ( ) ,
13791363 ) ;
13801364
1381- //println!("{:depth$} repeated array into {:?}", "", tt);
1382-
13831365 return tt;
13841366 }
13851367
@@ -1390,7 +1372,6 @@ pub fn typetree_from_ty<'a>(ty: Ty<'a>, tcx: TyCtxt<'a>, depth: usize) -> TypeTr
13901372 return subtt;
13911373 }
13921374
1393- //println!("Warning: create empty typetree for {}", ty);
13941375 typetree_empty ( )
13951376}
13961377
0 commit comments