about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/debuginfo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/debuginfo.rs')
-rw-r--r--compiler/rustc_codegen_gcc/src/debuginfo.rs25
1 files changed, 2 insertions, 23 deletions
diff --git a/compiler/rustc_codegen_gcc/src/debuginfo.rs b/compiler/rustc_codegen_gcc/src/debuginfo.rs
index 8661532a359..4d3b4f04bad 100644
--- a/compiler/rustc_codegen_gcc/src/debuginfo.rs
+++ b/compiler/rustc_codegen_gcc/src/debuginfo.rs
@@ -1,11 +1,9 @@
-use gccjit::{FunctionType, RValue};
+use gccjit::RValue;
 use rustc_codegen_ssa::mir::debuginfo::{FunctionDebugContext, VariableKind};
-use rustc_codegen_ssa::traits::{BuilderMethods, DebugInfoBuilderMethods, DebugInfoMethods};
-use rustc_middle::middle::cstore::CrateDepKind;
+use rustc_codegen_ssa::traits::{DebugInfoBuilderMethods, DebugInfoMethods};
 use rustc_middle::mir;
 use rustc_middle::ty::{Instance, Ty};
 use rustc_span::{SourceFile, Span, Symbol};
-use rustc_span::def_id::LOCAL_CRATE;
 use rustc_target::abi::Size;
 use rustc_target::abi::call::FnAbi;
 
@@ -20,25 +18,6 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
     }
 
     fn insert_reference_to_gdb_debug_scripts_section_global(&mut self) {
-        // TODO(antoyo): replace with gcc_jit_context_new_global_with_initializer() if it's added:
-        // https://gcc.gnu.org/pipermail/jit/2020q3/001225.html
-        //
-        // Call the function to initialize global values here.
-        // We assume this is only called for the main function.
-        use std::iter;
-
-        for crate_num in self.cx.tcx.crates(()).iter().copied().chain(iter::once(LOCAL_CRATE)) {
-            // FIXME(antoyo): better way to find if a crate is of proc-macro type?
-            if crate_num == LOCAL_CRATE || self.cx.tcx.dep_kind(crate_num) != CrateDepKind::MacrosOnly {
-                // NOTE: proc-macro crates are not included in the executable, so don't call their
-                // initialization routine.
-                let initializer_name = format!("__gccGlobalCrateInit{}", self.cx.tcx.crate_name(crate_num));
-                let codegen_init_func = self.context.new_function(None, FunctionType::Extern, self.context.new_type::<()>(), &[],
-                initializer_name, false);
-                self.llbb().add_eval(None, self.context.new_call(None, codegen_init_func, &[]));
-            }
-        }
-
         // TODO(antoyo): insert reference to gdb debug scripts section global.
     }