Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sig fix #12

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo-copy.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "craneliftc"
version = "0.5.1"
version = "0.5.2"
edition = "2021"
description = "light c compatible ffi wrapper around cranelift"
license-file = "LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ name = "craneliftc"
crate-type = ["staticlib", "cdylib"]

[dependencies]
cranelift = "0"
cranelift = "0.110.1"
paste = "1.0.11"

12 changes: 3 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ pub enum CCallConv {
AppleAarch64,
Probestack,
WasmtimeSystemV,
WasmtimeFastcall,
WasmtimeAppleAarch64,
}
macro_rules! easy_type {
($val:ident, $typ:ident, $($variant:ident,)*) => {
Expand Down Expand Up @@ -337,6 +335,7 @@ fn convert_CType(td: CType) -> Type {

#[allow(non_snake_case)]
fn convert_CCallConv(ccd: CCallConv) -> CallConv {
use cranelift::prelude::isa::CallConv;
return easy_enum!(
ccd,
CCallConv,
Expand All @@ -349,8 +348,6 @@ fn convert_CCallConv(ccd: CCallConv) -> CallConv {
AppleAarch64,
Probestack,
WasmtimeSystemV,
WasmtimeFastcall,
WasmtimeAppleAarch64,
);
}

Expand Down Expand Up @@ -618,7 +615,7 @@ pub extern "C" fn CL_Signature_returns_push(sig: *mut Signature, abi: *mut AbiPa
#[allow(non_snake_case)]
pub extern "C" fn CL_Signature_params_push(sig: *mut Signature, abi: *mut AbiParam) -> () {
assert!(!abi.is_null());
assert!(!abi.is_null());
assert!(!sig.is_null());
let usig = unsafe { &mut *sig };
let uabi = unsafe { Box::from_raw(abi) };
usig.params.push(*uabi);
Expand Down Expand Up @@ -920,7 +917,6 @@ instr_zero_inst!(nop);

// (code) -> inst
instr_one_code_inst!(trap);
instr_one_code_inst!(resumable_trap);

// (value, code) -> inst
instr_two_value_code_inst!(trapz);
Expand All @@ -941,12 +937,12 @@ instr_two_type_value_value!(sextend);
instr_two_type_value_value!(fpromote);
instr_two_type_value_value!(fdemote);
instr_two_type_value_value!(fcvt_to_uint);
instr_two_type_value_value!(fcvt_to_uint_sat);
instr_two_type_value_value!(fcvt_to_sint);
instr_two_type_value_value!(fcvt_to_sint_sat);
instr_two_type_value_value!(x86_cvtt2dq);
instr_two_type_value_value!(fcvt_from_uint);
instr_two_type_value_value!(fcvt_from_sint);
instr_two_type_value_value!(fcvt_low_from_sint);

// (type) -> value
instr_one_type_value!(get_stack_pointer);
Expand Down Expand Up @@ -1027,9 +1023,7 @@ instr_two_value_value_value!(fmul);
instr_two_value_value_value!(fdiv);
instr_two_value_value_value!(fcopysign);
instr_two_value_value_value!(fmin);
instr_two_value_value_value!(fmin_pseudo);
instr_two_value_value_value!(fmax);
instr_two_value_value_value!(fmax_pseudo);
instr_two_value_value_value!(snarrow);
instr_two_value_value_value!(unarrow);
instr_two_value_value_value!(uunarrow);
Expand Down
Loading
Loading