@@ -11,7 +11,7 @@ use cranelift_codegen::ValueLocRange;
1111
1212use gimli:: write:: {
1313 self , Address , AttributeValue , DwarfUnit , Expression , LineProgram , LineString , Location ,
14- LocationList , Range , RangeList , UnitEntryId , Writer , FileInfo ,
14+ LocationList , Range , RangeList , UnitEntryId , Writer ,
1515} ;
1616use gimli:: { Encoding , Format , LineEncoding , RunTimeEndian , X86_64 } ;
1717
@@ -59,15 +59,15 @@ impl<'tcx> DebugContext<'tcx> {
5959 // Normally this would use option_env!("CFG_VERSION").
6060 let producer = format ! ( "cg_clif (rustc {})" , "unknown version" ) ;
6161 let comp_dir = tcx. sess . working_dir . 0 . to_string_lossy ( ) . into_owned ( ) ;
62- let ( name, file_hash ) = match tcx. sess . local_crate_source_file . clone ( ) {
62+ let ( name, file_info ) = match tcx. sess . local_crate_source_file . clone ( ) {
6363 Some ( path) => {
6464 let name = path. to_string_lossy ( ) . into_owned ( ) ;
65- let hash = tcx. sess
65+ let info = tcx. sess
6666 . source_map ( )
6767 . get_source_file ( & FileName :: Real ( path) )
6868 . map ( |f| f. src_hash )
69- . and_then ( line_info:: FileHash :: from_source_hash ) ;
70- ( name, hash )
69+ . and_then ( line_info:: make_file_info ) ;
70+ ( name, info )
7171 } ,
7272 None => ( tcx. crate_name ( LOCAL_CRATE ) . to_string ( ) , None ) ,
7373 } ;
@@ -77,13 +77,9 @@ impl<'tcx> DebugContext<'tcx> {
7777 LineEncoding :: default ( ) ,
7878 LineString :: new ( comp_dir. as_bytes ( ) , encoding, & mut dwarf. line_strings ) ,
7979 LineString :: new ( name. as_bytes ( ) , encoding, & mut dwarf. line_strings ) ,
80- Some ( FileInfo {
81- timestamp : 0 ,
82- size : 0 ,
83- md5 : file_hash. unwrap_or_default ( ) . inner ( ) ,
84- } ) ,
80+ file_info,
8581 ) ;
86- line_program. file_has_md5 = file_hash . is_some ( ) ;
82+ line_program. file_has_md5 = file_info . is_some ( ) ;
8783
8884 dwarf. unit . line_program = line_program;
8985
0 commit comments