@@ -17,10 +17,11 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
17
17
let mut debug_context = cx
18
18
. debug_context
19
19
. as_mut ( )
20
- . map ( |debug_context| FunctionDebugContext :: new ( tcx , debug_context, mir , func_id, & name, & sig ) ) ;
20
+ . map ( |debug_context| FunctionDebugContext :: new ( debug_context, instance , func_id, & name) ) ;
21
21
22
22
// Make FunctionBuilder
23
23
let mut func = Function :: with_name_signature ( ExternalName :: user ( 0 , 0 ) , sig) ;
24
+ func. collect_debug_info ( ) ;
24
25
let mut func_ctx = FunctionBuilderContext :: new ( ) ;
25
26
let mut bcx = FunctionBuilder :: new ( & mut func, & mut func_ctx) ;
26
27
@@ -60,6 +61,7 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
60
61
let instance = fx. instance ;
61
62
let clif_comments = fx. clif_comments ;
62
63
let source_info_set = fx. source_info_set ;
64
+ let local_map = fx. local_map ;
63
65
64
66
#[ cfg( debug_assertions) ]
65
67
crate :: pretty_clif:: write_clif_file ( cx. tcx , "unopt" , instance, & func, & clif_comments, None ) ;
@@ -72,26 +74,28 @@ pub fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
72
74
context. func = func;
73
75
cx. module . define_function ( func_id, context) . unwrap ( ) ;
74
76
75
- let value_ranges = context
76
- . build_value_labels_ranges ( cx. module . isa ( ) )
77
- . expect ( "value location ranges" ) ;
78
-
79
77
// Write optimized function to file for debugging
80
78
#[ cfg( debug_assertions) ]
81
- crate :: pretty_clif:: write_clif_file (
82
- cx. tcx ,
83
- "opt" ,
84
- instance,
85
- & context. func ,
86
- & clif_comments,
87
- Some ( & value_ranges) ,
88
- ) ;
79
+ {
80
+ let value_ranges = context
81
+ . build_value_labels_ranges ( cx. module . isa ( ) )
82
+ . expect ( "value location ranges" ) ;
83
+
84
+ crate :: pretty_clif:: write_clif_file (
85
+ cx. tcx ,
86
+ "opt" ,
87
+ instance,
88
+ & context. func ,
89
+ & clif_comments,
90
+ Some ( & value_ranges) ,
91
+ ) ;
92
+ }
89
93
90
94
// Define debuginfo for function
91
95
let isa = cx. module . isa ( ) ;
92
96
debug_context
93
97
. as_mut ( )
94
- . map ( |x| x. define ( tcx , context, isa, & source_info_set) ) ;
98
+ . map ( |x| x. define ( context, isa, & source_info_set, local_map ) ) ;
95
99
96
100
// Clear context to make it usable for the next function
97
101
context. clear ( ) ;
0 commit comments