Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 75a463a

Browse files
committed
Update Cranelift to 0.81.0
1 parent 583333a commit 75a463a

File tree

6 files changed

+33
-51
lines changed

6 files changed

+33
-51
lines changed

Cargo.lock

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.80.0", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = "0.80.0"
13-
cranelift-module = "0.80.0"
14-
cranelift-native = "0.80.0"
15-
cranelift-jit = { version = "0.80.0", optional = true }
16-
cranelift-object = "0.80.0"
11+
cranelift-codegen = { version = "0.81.0", features = ["unwind", "all-arch"] }
12+
cranelift-frontend = "0.81.0"
13+
cranelift-module = "0.81.0"
14+
cranelift-native = "0.81.0"
15+
cranelift-jit = { version = "0.81.0", optional = true }
16+
cranelift-object = "0.81.0"
1717
target-lexicon = "0.12.0"
1818
gimli = { version = "0.26.0", default-features = false, features = ["write"]}
1919
object = { version = "0.27.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }

src/allocator.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
use crate::prelude::*;
55

6-
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
76
use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
87

98
/// Returns whether an allocator shim was created
@@ -91,9 +90,7 @@ fn codegen_inner(
9190
bcx.seal_all_blocks();
9291
bcx.finalize();
9392
}
94-
module
95-
.define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
96-
.unwrap();
93+
module.define_function(func_id, &mut ctx).unwrap();
9794
unwind_context.add_function(func_id, &ctx, module.isa());
9895
}
9996

@@ -130,8 +127,6 @@ fn codegen_inner(
130127
bcx.seal_all_blocks();
131128
bcx.finalize();
132129
}
133-
module
134-
.define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
135-
.unwrap();
130+
module.define_function(func_id, &mut ctx).unwrap();
136131
unwind_context.add_function(func_id, &ctx, module.isa());
137132
}

src/base.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Codegen of a single function
22
3-
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
43
use rustc_ast::InlineAsmOptions;
54
use rustc_index::vec::IndexVec;
65
use rustc_middle::ty::adjustment::PointerCast;
@@ -175,9 +174,7 @@ fn compile_fn<'tcx>(
175174
// Define function
176175
tcx.sess.time("define function", || {
177176
context.want_disasm = crate::pretty_clif::should_write_ir(tcx);
178-
module
179-
.define_function(func_id, context, &mut NullTrapSink {}, &mut NullStackMapSink {})
180-
.unwrap()
177+
module.define_function(func_id, context).unwrap()
181178
});
182179

183180
// Write optimized function to file for debugging

src/driver/jit.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::lazy::SyncOnceCell;
77
use std::os::raw::{c_char, c_int};
88
use std::sync::{mpsc, Mutex};
99

10-
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
1110
use rustc_codegen_ssa::CrateInfo;
1211
use rustc_middle::mir::mono::MonoItem;
1312
use rustc_session::Session;
@@ -381,12 +380,5 @@ fn codegen_shim<'tcx>(cx: &mut CodegenCx<'tcx>, module: &mut JITModule, inst: In
381380
let ret_vals = trampoline_builder.func.dfg.inst_results(call_inst).to_vec();
382381
trampoline_builder.ins().return_(&ret_vals);
383382

384-
module
385-
.define_function(
386-
func_id,
387-
&mut cx.cached_context,
388-
&mut NullTrapSink {},
389-
&mut NullStackMapSink {},
390-
)
391-
.unwrap();
383+
module.define_function(func_id, &mut cx.cached_context).unwrap();
392384
}

src/main_shim.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
21
use rustc_hir::LangItem;
32
use rustc_middle::ty::subst::GenericArg;
43
use rustc_middle::ty::AssocKind;
@@ -152,8 +151,7 @@ pub(crate) fn maybe_create_entry_wrapper(
152151
bcx.seal_all_blocks();
153152
bcx.finalize();
154153
}
155-
m.define_function(cmain_func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
156-
.unwrap();
154+
m.define_function(cmain_func_id, &mut ctx).unwrap();
157155
unwind_context.add_function(cmain_func_id, &ctx, m.isa());
158156
}
159157
}

0 commit comments

Comments
 (0)