@@ -11,7 +11,7 @@ use cranelift_codegen::ValueLocRange;
11
11
12
12
use gimli:: write:: {
13
13
self , Address , AttributeValue , DwarfUnit , Expression , LineProgram , LineString , Location ,
14
- LocationList , Range , RangeList , UnitEntryId , Writer , FileInfo ,
14
+ LocationList , Range , RangeList , UnitEntryId , Writer ,
15
15
} ;
16
16
use gimli:: { Encoding , Format , LineEncoding , RunTimeEndian , X86_64 } ;
17
17
@@ -59,15 +59,15 @@ impl<'tcx> DebugContext<'tcx> {
59
59
// Normally this would use option_env!("CFG_VERSION").
60
60
let producer = format ! ( "cg_clif (rustc {})" , "unknown version" ) ;
61
61
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 ( ) {
63
63
Some ( path) => {
64
64
let name = path. to_string_lossy ( ) . into_owned ( ) ;
65
- let hash = tcx. sess
65
+ let info = tcx. sess
66
66
. source_map ( )
67
67
. get_source_file ( & FileName :: Real ( path) )
68
68
. 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 )
71
71
} ,
72
72
None => ( tcx. crate_name ( LOCAL_CRATE ) . to_string ( ) , None ) ,
73
73
} ;
@@ -77,13 +77,9 @@ impl<'tcx> DebugContext<'tcx> {
77
77
LineEncoding :: default ( ) ,
78
78
LineString :: new ( comp_dir. as_bytes ( ) , encoding, & mut dwarf. line_strings ) ,
79
79
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,
85
81
) ;
86
- line_program. file_has_md5 = file_hash . is_some ( ) ;
82
+ line_program. file_has_md5 = file_info . is_some ( ) ;
87
83
88
84
dwarf. unit . line_program = line_program;
89
85
0 commit comments