@@ -16,6 +16,66 @@ pub(super) const UNKNOWN_LINE_NUMBER: u32 = 0;
1616pub ( super ) const UNKNOWN_COLUMN_NUMBER : u32 = 0 ;
1717
1818impl < ' a , ' gcc , ' tcx > DebugInfoBuilderMethods < ' tcx > for Builder < ' a , ' gcc , ' tcx > {
19+ fn dbg_scope_fn (
20+ & mut self ,
21+ _instance : Instance < ' tcx > ,
22+ _fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
23+ _maybe_definition_llfn : Option < Function < ' gcc > > ,
24+ ) -> Self :: DIScope {
25+ // FIXME(antoyo): implement.
26+ }
27+
28+ fn dbg_create_lexical_block (
29+ & mut self ,
30+ _pos : BytePos ,
31+ _parent_scope : Self :: DIScope ,
32+ ) -> Self :: DIScope {
33+ }
34+
35+ fn dbg_location_clone_with_discriminator (
36+ & mut self ,
37+ loc : Self :: DILocation ,
38+ _discriminator : u32 ,
39+ ) -> Option < Self :: DILocation > {
40+ Some ( loc)
41+ }
42+
43+ fn extend_scope_to_file (
44+ & mut self ,
45+ _scope_metadata : Self :: DIScope ,
46+ _file : & SourceFile ,
47+ ) -> Self :: DIScope {
48+ // FIXME(antoyo): implement.
49+ }
50+
51+ fn dbg_loc (
52+ & mut 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+
69+ fn create_dbg_var (
70+ & mut self ,
71+ _variable_name : Symbol ,
72+ _variable_type : Ty < ' tcx > ,
73+ _scope_metadata : Self :: DIScope ,
74+ _variable_kind : VariableKind ,
75+ _span : Span ,
76+ ) -> Self :: DIVariable {
77+ }
78+
1979 // FIXME(eddyb) find a common convention for all of the debuginfo-related
2080 // names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
2181 fn dbg_var_addr (
@@ -103,6 +163,10 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
103163 DebugLoc { file, line, col }
104164 }
105165 }
166+
167+ pub ( crate ) fn debuginfo_finalize ( & self ) {
168+ self . context . set_debug_info ( true )
169+ }
106170}
107171
108172impl < ' gcc , ' tcx > DebugInfoCodegenMethods < ' tcx > for CodegenCx < ' gcc , ' tcx > {
@@ -114,68 +178,4 @@ impl<'gcc, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
114178 ) {
115179 // FIXME(antoyo)
116180 }
117-
118- fn dbg_create_lexical_block (
119- & self ,
120- _pos : BytePos ,
121- _parent_scope : Self :: DIScope ,
122- ) -> Self :: DIScope {
123- }
124-
125- fn dbg_location_clone_with_discriminator (
126- & self ,
127- loc : Self :: DILocation ,
128- _discriminator : u32 ,
129- ) -> Option < Self :: DILocation > {
130- Some ( loc)
131- }
132-
133- fn extend_scope_to_file (
134- & self ,
135- _scope_metadata : Self :: DIScope ,
136- _file : & SourceFile ,
137- ) -> Self :: DIScope {
138- // FIXME(antoyo): implement.
139- }
140-
141- fn debuginfo_finalize ( & self ) {
142- self . context . set_debug_info ( true )
143- }
144-
145- fn create_dbg_var (
146- & self ,
147- _variable_name : Symbol ,
148- _variable_type : Ty < ' tcx > ,
149- _scope_metadata : Self :: DIScope ,
150- _variable_kind : VariableKind ,
151- _span : Span ,
152- ) -> Self :: DIVariable {
153- }
154-
155- fn dbg_scope_fn (
156- & self ,
157- _instance : Instance < ' tcx > ,
158- _fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
159- _maybe_definition_llfn : Option < Function < ' gcc > > ,
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