@@ -111,54 +111,6 @@ impl<'a, 'tcx> CrateDebugContext<'a, 'tcx> {
111111 }
112112}
113113
114- pub enum FunctionDebugContext < D > {
115- RegularContext ( FunctionDebugContextData < D > ) ,
116- DebugInfoDisabled ,
117- FunctionWithoutDebugInfo ,
118- }
119-
120- impl < D > FunctionDebugContext < D > {
121- pub fn get_ref < ' a > ( & ' a self , span : Span ) -> & ' a FunctionDebugContextData < D > {
122- match * self {
123- FunctionDebugContext :: RegularContext ( ref data) => data,
124- FunctionDebugContext :: DebugInfoDisabled => {
125- span_bug ! ( span, "{}" , Self :: debuginfo_disabled_message( ) ) ;
126- }
127- FunctionDebugContext :: FunctionWithoutDebugInfo => {
128- span_bug ! ( span, "{}" , Self :: should_be_ignored_message( ) ) ;
129- }
130- }
131- }
132-
133- fn debuginfo_disabled_message ( ) -> & ' static str {
134- "debuginfo: Error trying to access FunctionDebugContext although debug info is disabled!"
135- }
136-
137- fn should_be_ignored_message ( ) -> & ' static str {
138- "debuginfo: Error trying to access FunctionDebugContext for function that should be \
139- ignored by debug info!"
140- }
141- }
142-
143- pub struct FunctionDebugContextData < D > {
144- fn_metadata : D ,
145- source_locations_enabled : Cell < bool > ,
146- pub defining_crate : CrateNum ,
147- }
148-
149- pub enum VariableAccess < ' a , V > {
150- // The llptr given is an alloca containing the variable's value
151- DirectVariable { alloca : V } ,
152- // The llptr given is an alloca containing the start of some pointer chain
153- // leading to the variable's content.
154- IndirectVariable { alloca : V , address_operations : & ' a [ i64 ] }
155- }
156-
157- pub enum VariableKind {
158- ArgumentVariable ( usize /*index*/ ) ,
159- LocalVariable ,
160- }
161-
162114/// Create any deferred debug metadata nodes
163115pub fn finalize ( cx : & CodegenCx ) {
164116 if cx. dbg_cx . is_none ( ) {
@@ -578,15 +530,24 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
578530 }
579531
580532 fn extend_scope_to_file (
581- & self ,
582- scope_metadata : & ' ll DIScope ,
583- file : & syntax_pos:: SourceFile ,
584- defining_crate : CrateNum ,
585- ) -> & ' ll DILexicalBlock {
586- metadata:: extend_scope_to_file ( & self , scope_metadata, file, defining_crate)
587- }
533+ & self ,
534+ scope_metadata : & ' ll DIScope ,
535+ file : & syntax_pos:: SourceFile ,
536+ defining_crate : CrateNum ,
537+ ) -> & ' ll DILexicalBlock {
538+ metadata:: extend_scope_to_file ( & self , scope_metadata, file, defining_crate)
539+ }
588540
589541 fn debuginfo_finalize ( & self ) {
590542 finalize ( self )
591543 }
544+
545+ fn debuginfo_upvar_decls_ops_sequence ( & self , byte_offset_of_var_in_env : u64 ) -> & [ i64 ] {
546+ unsafe {
547+ [ llvm:: LLVMRustDIBuilderCreateOpDeref ( ) ,
548+ llvm:: LLVMRustDIBuilderCreateOpPlusUconst ( ) ,
549+ byte_offset_of_var_in_env as i64 ,
550+ llvm:: LLVMRustDIBuilderCreateOpDeref ( ) ]
551+ } ;
552+ }
592553}
0 commit comments