]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_gcc/src/debuginfo.rs
Auto merge of #106399 - estebank:type-err-span-label, r=nagisa
[rust.git] / compiler / rustc_codegen_gcc / src / debuginfo.rs
1 use gccjit::RValue;
2 use rustc_codegen_ssa::mir::debuginfo::{FunctionDebugContext, VariableKind};
3 use rustc_codegen_ssa::traits::{DebugInfoBuilderMethods, DebugInfoMethods};
4 use rustc_middle::mir;
5 use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty};
6 use rustc_span::{SourceFile, Span, Symbol};
7 use rustc_target::abi::call::FnAbi;
8 use rustc_target::abi::Size;
9 use std::ops::Range;
10
11 use crate::builder::Builder;
12 use crate::context::CodegenCx;
13
14 impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
15     // FIXME(eddyb) find a common convention for all of the debuginfo-related
16     // names (choose between `dbg`, `debug`, `debuginfo`, `debug_info` etc.).
17     fn dbg_var_addr(
18         &mut self,
19         _dbg_var: Self::DIVariable,
20         _scope_metadata: Self::DIScope,
21         _variable_alloca: Self::Value,
22         _direct_offset: Size,
23         _indirect_offsets: &[Size],
24         _fragment: Option<Range<Size>>,
25     ) {
26         unimplemented!();
27     }
28
29     fn insert_reference_to_gdb_debug_scripts_section_global(&mut self) {
30         // TODO(antoyo): insert reference to gdb debug scripts section global.
31     }
32
33     fn set_var_name(&mut self, _value: RValue<'gcc>, _name: &str) {
34         unimplemented!();
35     }
36
37     fn set_dbg_loc(&mut self, _dbg_loc: Self::DILocation) {
38         unimplemented!();
39     }
40 }
41
42 impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
43     fn create_vtable_debuginfo(
44         &self,
45         _ty: Ty<'tcx>,
46         _trait_ref: Option<PolyExistentialTraitRef<'tcx>>,
47         _vtable: Self::Value,
48     ) {
49         // TODO(antoyo)
50     }
51
52     fn create_function_debug_context(
53         &self,
54         _instance: Instance<'tcx>,
55         _fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
56         _llfn: RValue<'gcc>,
57         _mir: &mir::Body<'tcx>,
58     ) -> Option<FunctionDebugContext<Self::DIScope, Self::DILocation>> {
59         // TODO(antoyo)
60         None
61     }
62
63     fn extend_scope_to_file(
64         &self,
65         _scope_metadata: Self::DIScope,
66         _file: &SourceFile,
67     ) -> Self::DIScope {
68         unimplemented!();
69     }
70
71     fn debuginfo_finalize(&self) {
72         // TODO(antoyo)
73     }
74
75     fn create_dbg_var(
76         &self,
77         _variable_name: Symbol,
78         _variable_type: Ty<'tcx>,
79         _scope_metadata: Self::DIScope,
80         _variable_kind: VariableKind,
81         _span: Span,
82     ) -> Self::DIVariable {
83         unimplemented!();
84     }
85
86     fn dbg_scope_fn(
87         &self,
88         _instance: Instance<'tcx>,
89         _fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
90         _maybe_definition_llfn: Option<RValue<'gcc>>,
91     ) -> Self::DIScope {
92         unimplemented!();
93     }
94
95     fn dbg_loc(
96         &self,
97         _scope: Self::DIScope,
98         _inlined_at: Option<Self::DILocation>,
99         _span: Span,
100     ) -> Self::DILocation {
101         unimplemented!();
102     }
103 }