@@ -32,6 +32,40 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
3232 ) -> Self :: DIScope {
3333 }
3434
35+ fn dbg_location_clone_with_discriminator (
36+ & self ,
37+ loc : Self :: DILocation ,
38+ _discriminator : u32 ,
39+ ) -> Option < Self :: DILocation > {
40+ Some ( loc)
41+ }
42+
43+ fn extend_scope_to_file (
44+ & self ,
45+ _scope_metadata : Self :: DIScope ,
46+ _file : & SourceFile ,
47+ ) -> Self :: DIScope {
48+ // FIXME(antoyo): implement.
49+ }
50+
51+ fn dbg_loc (
52+ & self ,
53+ _scope : Self :: DIScope ,
54+ _inlined_at : Option < Self :: DILocation > ,
55+ span : Span ,
56+ ) -> Self :: DILocation {
57+ let pos = span. lo ( ) ;
58+ let DebugLoc { file, line, col } = self . lookup_debug_loc ( pos) ;
59+ match file. name {
60+ rustc_span:: FileName :: Real ( ref name) => self . context . new_location (
61+ name. path ( rustc_span:: RemapPathScopeComponents :: DEBUGINFO ) . to_string_lossy ( ) ,
62+ line as i32 ,
63+ col as i32 ,
64+ ) ,
65+ _ => Location :: null ( ) ,
66+ }
67+ }
68+
3569 fn create_dbg_var (
3670 & self ,
3771 _variable_name : Symbol ,
@@ -144,38 +178,4 @@ impl<'gcc, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
144178 ) {
145179 // FIXME(antoyo)
146180 }
147-
148- fn dbg_location_clone_with_discriminator (
149- & self ,
150- loc : Self :: DILocation ,
151- _discriminator : u32 ,
152- ) -> Option < Self :: DILocation > {
153- Some ( loc)
154- }
155-
156- fn extend_scope_to_file (
157- & self ,
158- _scope_metadata : Self :: DIScope ,
159- _file : & SourceFile ,
160- ) -> Self :: DIScope {
161- // FIXME(antoyo): implement.
162- }
163-
164- fn dbg_loc (
165- & self ,
166- _scope : Self :: DIScope ,
167- _inlined_at : Option < Self :: DILocation > ,
168- span : Span ,
169- ) -> Self :: DILocation {
170- let pos = span. lo ( ) ;
171- let DebugLoc { file, line, col } = self . lookup_debug_loc ( pos) ;
172- match file. name {
173- rustc_span:: FileName :: Real ( ref name) => self . context . new_location (
174- name. path ( rustc_span:: RemapPathScopeComponents :: DEBUGINFO ) . to_string_lossy ( ) ,
175- line as i32 ,
176- col as i32 ,
177- ) ,
178- _ => Location :: null ( ) ,
179- }
180- }
181181}
0 commit comments