@@ -51,7 +51,6 @@ mod utils;
5151pub use self :: create_scope_map:: compute_mir_scopes;
5252pub use self :: metadata:: create_global_var_metadata;
5353pub use self :: metadata:: extend_scope_to_file;
54- pub use self :: source_loc:: set_source_location;
5554
5655#[ allow( non_upper_case_globals) ]
5756const DW_TAG_auto_variable : c_uint = 0x100 ;
@@ -193,13 +192,14 @@ impl DebugInfoBuilderMethods for Builder<'a, 'll, 'tcx> {
193192 }
194193 }
195194
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+ }
203203 }
204204 fn insert_reference_to_gdb_debug_scripts_section_global ( & mut self ) {
205205 gdb:: insert_reference_to_gdb_debug_scripts_section_global ( self )
@@ -333,7 +333,6 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
333333 } ;
334334 let mut fn_debug_context = FunctionDebugContext {
335335 scopes : IndexVec :: from_elem ( null_scope, & mir. source_scopes ) ,
336- source_locations_enabled : false ,
337336 defining_crate : def_id. krate ,
338337 } ;
339338
0 commit comments