]> git.lizzy.rs Git - rust.git/blobdiff - src/debuginfo.rs
Disable long running libcore tests
[rust.git] / src / debuginfo.rs
index 8661532a3595e6e2d4a659a3bd763fffbe3c2c75..31959fa19c588b9265143b9e73b3a168fae07ad4 100644 (file)
@@ -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_middle::ty::{Instance, PolyExistentialTraitRef, 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 @@ fn dbg_var_addr(&mut self, _dbg_var: Self::DIVariable, _scope_metadata: Self::DI
     }
 
     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.
     }
 
@@ -52,7 +31,7 @@ fn set_dbg_loc(&mut self, _dbg_loc: Self::DILocation) {
 }
 
 impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
-    fn create_vtable_metadata(&self, _ty: Ty<'tcx>, _vtable: Self::Value) {
+    fn create_vtable_metadata(&self, _ty: Ty<'tcx>, _trait_ref: Option<PolyExistentialTraitRef<'tcx>>, _vtable: Self::Value) {
         // TODO(antoyo)
     }