Merge commit '9809f5d219
' into libgccjit-codegen
This commit is contained in:
commit
7f32dd546f
19 changed files with 534 additions and 534 deletions
|
@ -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.
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue