-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;
}
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.
}
}
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)
}