mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
Update cranelift
This commit is contained in:
parent
8598a34e45
commit
98dae86d21
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -114,7 +114,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-frontend 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -123,7 +123,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-bforest"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
]
|
||||
@ -131,7 +131,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-bforest 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-codegen-meta 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -145,7 +145,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen-meta"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
]
|
||||
@ -153,12 +153,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-entity"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-faerie"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-module 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -171,7 +171,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-frontend"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -181,7 +181,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-module"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -192,7 +192,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-native"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -202,7 +202,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-simplejit"
|
||||
version = "0.30.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#c0ee30f9a95bd80bd6485c21bad7e8e0b8c5caf0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#a1d8fbc8dda7984edcf334c8e3d0e4ecd6c04968"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-module 0.30.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
|
@ -179,7 +179,7 @@ fn trans_const_place<'a, 'tcx: 'a>(
|
||||
|
||||
fn data_id_for_alloc_id<B: Backend>(module: &mut Module<B>, alloc_id: AllocId) -> DataId {
|
||||
module
|
||||
.declare_data(&format!("__alloc_{}", alloc_id.0), Linkage::Local, false)
|
||||
.declare_data(&format!("__alloc_{}", alloc_id.0), Linkage::Local, false, None)
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
@ -190,15 +190,16 @@ fn data_id_for_static<'a, 'tcx: 'a, B: Backend>(
|
||||
linkage: Linkage,
|
||||
) -> DataId {
|
||||
let symbol_name = tcx.symbol_name(Instance::mono(tcx, def_id)).as_str();
|
||||
let ty = tcx.type_of(def_id);
|
||||
let is_mutable = if tcx.is_mutable_static(def_id) {
|
||||
true
|
||||
} else {
|
||||
!tcx.type_of(def_id)
|
||||
.is_freeze(tcx, ParamEnv::reveal_all(), DUMMY_SP)
|
||||
!ty.is_freeze(tcx, ParamEnv::reveal_all(), DUMMY_SP)
|
||||
};
|
||||
let align = tcx.layout_of(ParamEnv::reveal_all().and(ty)).unwrap().align.pref.bytes();
|
||||
|
||||
let data_id = module
|
||||
.declare_data(&*symbol_name, linkage, is_mutable)
|
||||
.declare_data(&*symbol_name, linkage, is_mutable, Some(align.try_into().unwrap()))
|
||||
.unwrap();
|
||||
|
||||
if linkage == Linkage::Preemptible {
|
||||
|
@ -57,6 +57,7 @@ mod vtable;
|
||||
mod prelude {
|
||||
pub use std::any::Any;
|
||||
pub use std::collections::{HashMap, HashSet};
|
||||
pub use std::convert::TryInto;
|
||||
|
||||
pub use syntax::ast::{FloatTy, IntTy, UintTy};
|
||||
pub use syntax::source_map::{Pos, Span, DUMMY_SP};
|
||||
@ -213,7 +214,8 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||
};
|
||||
|
||||
if std::env::var("SHOULD_RUN").is_ok() {
|
||||
let mut jit_module: Module<SimpleJITBackend> = Module::new(SimpleJITBuilder::new());
|
||||
let mut jit_module: Module<SimpleJITBackend> =
|
||||
Module::new(SimpleJITBuilder::new(cranelift_module::default_libcall_names()));
|
||||
assert_eq!(pointer_ty(tcx), jit_module.target_config().pointer_type());
|
||||
|
||||
let sig = Signature {
|
||||
@ -263,7 +265,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
|
||||
build_isa(tcx.sess),
|
||||
name + ".o",
|
||||
FaerieTrapCollection::Disabled,
|
||||
FaerieBuilder::default_libcall_names(),
|
||||
cranelift_module::default_libcall_names(),
|
||||
)
|
||||
.unwrap(),
|
||||
);
|
||||
|
@ -12,7 +12,7 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, impl cranelift_module::Backend>, ms
|
||||
let msg_bytes = format!("trap at {:?} ({}): {}\0", fx.instance, symbol_name, msg).into_bytes().into_boxed_slice();
|
||||
let mut data_ctx = DataContext::new();
|
||||
data_ctx.define(msg_bytes);
|
||||
let msg_id = fx.module.declare_data(&(symbol_name.as_str().to_string() + msg), Linkage::Local, false).unwrap();
|
||||
let msg_id = fx.module.declare_data(&(symbol_name.as_str().to_string() + msg), Linkage::Local, false, None).unwrap();
|
||||
|
||||
// Ignore DuplicateDefinition error, as the data will be the same
|
||||
let _ = fx.module.define_data(msg_id, &data_ctx);
|
||||
|
@ -136,6 +136,7 @@ fn build_vtable<'a, 'tcx: 'a>(
|
||||
&format!("vtable.{:?}.for.{:?}", trait_ref, ty),
|
||||
Linkage::Local,
|
||||
false,
|
||||
Some(fx.tcx.data_layout.pointer_align.pref.bytes().try_into().unwrap())
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user