@@ -51,7 +51,6 @@ mod utils;
51
51
pub use self :: create_scope_map:: compute_mir_scopes;
52
52
pub use self :: metadata:: create_global_var_metadata;
53
53
pub use self :: metadata:: extend_scope_to_file;
54
- pub use self :: source_loc:: set_source_location;
55
54
56
55
#[ allow( non_upper_case_globals) ]
57
56
const DW_TAG_auto_variable : c_uint = 0x100 ;
@@ -193,13 +192,14 @@ impl DebugInfoBuilderMethods for Builder<'a, 'll, 'tcx> {
193
192
}
194
193
}
195
194
196
- fn set_source_location (
197
- & mut self ,
198
- debug_context : & mut FunctionDebugContext < & ' ll DIScope > ,
199
- scope : & ' ll DIScope ,
200
- span : Span ,
201
- ) {
202
- set_source_location ( debug_context, & self , scope, span)
195
+ fn set_source_location ( & mut self , scope : & ' ll DIScope , span : Span ) {
196
+ debug ! ( "set_source_location: {}" , self . sess( ) . source_map( ) . span_to_string( span) ) ;
197
+
198
+ let dbg_loc = self . cx ( ) . create_debug_loc ( scope, span) ;
199
+
200
+ unsafe {
201
+ llvm:: LLVMSetCurrentDebugLocation ( self . llbuilder , dbg_loc) ;
202
+ }
203
203
}
204
204
fn insert_reference_to_gdb_debug_scripts_section_global ( & mut self ) {
205
205
gdb:: insert_reference_to_gdb_debug_scripts_section_global ( self )
@@ -333,7 +333,6 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
333
333
} ;
334
334
let mut fn_debug_context = FunctionDebugContext {
335
335
scopes : IndexVec :: from_elem ( null_scope, & mir. source_scopes ) ,
336
- source_locations_enabled : false ,
337
336
defining_crate : def_id. krate ,
338
337
} ;
339
338
0 commit comments