forked from M-Labs/nac3
1
0
Fork 0

update inkwell. Closes #67

This commit is contained in:
Sebastien Bourdeauducq 2021-12-25 22:17:06 +08:00
parent 53f13b44cf
commit 9e3f75255e
11 changed files with 28 additions and 27 deletions

10
Cargo.lock generated
View File

@ -316,8 +316,9 @@ dependencies = [
[[package]]
name = "inkwell"
version = "0.1.0"
source = "git+https://github.com/TheDan64/inkwell?branch=master#d018ee22e4b5241dec2bc32ca67f3d4caaecee47"
version = "0.1.0-beta.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2223d0eba0ae6d40a3e4680c6a3209143471e1f38b41746ea309aa36dde9f90b"
dependencies = [
"either",
"inkwell_internals",
@ -330,8 +331,9 @@ dependencies = [
[[package]]
name = "inkwell_internals"
version = "0.3.0"
source = "git+https://github.com/TheDan64/inkwell?branch=master#d018ee22e4b5241dec2bc32ca67f3d4caaecee47"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c7090af3d300424caa81976b8c97bca41cd70e861272c072e188ae082fb49f9"
dependencies = [
"proc-macro2",
"quote",

View File

@ -10,4 +10,3 @@ members = [
[profile.release]
debug = true

View File

@ -16,7 +16,6 @@
})
];
};
cargoSha256 = "sha256-otKLhr58HYMjVXAof6AdObNpggPnvK6qOl7I+4LWIP8=";
msys2-python-tar = pkgs.fetchurl {
url = "https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-3.9.7-4-any.pkg.tar.zst";
sha256 = "0iwlgbk4b457yn9djwqswid55xhyyi35qymz1lfh42xwdpxdm47c";
@ -54,7 +53,9 @@
pkgs.rustPlatform.buildRustPackage {
name = "nac3artiq";
src = self;
inherit cargoSha256;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ pkgs.python3 llvm-nac3 ];
buildInputs = [ pkgs.python3 llvm-nac3 ];
cargoBuildFlags = [ "--package" "nac3artiq" ];
@ -75,7 +76,9 @@
pkgs-mingw.rustPlatform.buildRustPackage {
name = "nac3artiq";
src = self;
inherit cargoSha256;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ pkgs.zip ];
buildInputs = [ pkgs-mingw.zlib ];
configurePhase =

View File

@ -16,7 +16,6 @@ nac3parser = { path = "../nac3parser" }
nac3core = { path = "../nac3core" }
[dependencies.inkwell]
git = "https://github.com/TheDan64/inkwell"
branch = "master"
version = "0.1.0-beta.4"
default-features = false
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"]

View File

@ -68,7 +68,7 @@ impl<'b> CodeGenerator for ArtiqCodeGenerator<'b> {
});
let max = ctx
.builder
.build_call(smax, &[old_end, now], "smax")
.build_call(smax, &[old_end.into(), now.into()], "smax")
.try_as_basic_value()
.left()
.unwrap();
@ -185,7 +185,7 @@ impl<'b> CodeGenerator for ArtiqCodeGenerator<'b> {
});
let max = ctx
.builder
.build_call(smax, &[end_val, outer_end_val], "smax")
.build_call(smax, &[end_val.into(), outer_end_val.into()], "smax")
.try_as_basic_value()
.left()
.unwrap();

View File

@ -332,7 +332,7 @@ impl TimeFns for ExternTimeFns {
.get_function("at_mu")
.unwrap_or_else(|| ctx.module.add_function("at_mu", ctx.ctx.void_type().fn_type(&[ctx.ctx.i64_type().into()], false), None));
ctx.builder
.build_call(at_mu, &[t], "at_mu");
.build_call(at_mu, &[t.into()], "at_mu");
}
fn emit_delay_mu<'ctx, 'a>(&self, ctx: &mut CodeGenContext<'ctx, 'a>, dt: BasicValueEnum<'ctx>) {
@ -341,7 +341,7 @@ impl TimeFns for ExternTimeFns {
.get_function("delay_mu")
.unwrap_or_else(|| ctx.module.add_function("delay_mu", ctx.ctx.void_type().fn_type(&[ctx.ctx.i64_type().into()], false), None));
ctx.builder
.build_call(delay_mu, &[dt], "delay_mu");
.build_call(delay_mu, &[dt.into()], "delay_mu");
}
}

View File

@ -14,8 +14,7 @@ rayon = "1.5.1"
nac3parser = { path = "../nac3parser" }
[dependencies.inkwell]
git = "https://github.com/TheDan64/inkwell"
branch = "master"
version = "0.1.0-beta.4"
default-features = false
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"]

View File

@ -420,7 +420,7 @@ pub fn gen_call<'ctx, 'a, G: CodeGenerator>(
};
param_vals = real_params
.into_iter()
.map(|p| p.to_basic_value_enum(ctx, generator))
.map(|p| p.to_basic_value_enum(ctx, generator).into())
.collect_vec();
instance_to_symbol.get(&key).cloned()
}
@ -437,7 +437,7 @@ pub fn gen_call<'ctx, 'a, G: CodeGenerator>(
if let Some(obj) = &obj {
args.insert(0, FuncArg { name: "self".into(), ty: obj.0, default_value: None });
}
let params = args.iter().map(|arg| ctx.get_llvm_type(generator, arg.ty)).collect_vec();
let params = args.iter().map(|arg| ctx.get_llvm_type(generator, arg.ty).into()).collect_vec();
let fun_ty = if ctx.unifier.unioned(fun.0.ret, ctx.primitives.none) {
ctx.ctx.void_type().fn_type(&params, false)
} else {

View File

@ -352,7 +352,7 @@ pub fn gen_func<'ctx, G: CodeGenerator>(
let params = args
.iter()
.map(|arg| {
get_llvm_type(context, generator, &mut unifier, top_level_ctx.as_ref(), &mut type_cache, arg.ty)
get_llvm_type(context, generator, &mut unifier, top_level_ctx.as_ref(), &mut type_cache, arg.ty).into()
})
.collect_vec();

View File

@ -214,7 +214,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
});
let val = ctx
.builder
.build_call(round_intrinsic, &[arg], "round")
.build_call(round_intrinsic, &[arg.into()], "round")
.try_as_basic_value()
.left()
.unwrap();
@ -251,7 +251,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
});
let val = ctx
.builder
.build_call(round_intrinsic, &[arg], "round")
.build_call(round_intrinsic, &[arg.into()], "round")
.try_as_basic_value()
.left()
.unwrap();
@ -431,7 +431,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
});
let val = ctx
.builder
.build_call(floor_intrinsic, &[arg], "floor")
.build_call(floor_intrinsic, &[arg.into()], "floor")
.try_as_basic_value()
.left()
.unwrap();
@ -468,7 +468,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
});
let val = ctx
.builder
.build_call(floor_intrinsic, &[arg], "floor")
.build_call(floor_intrinsic, &[arg.into()], "floor")
.try_as_basic_value()
.left()
.unwrap();
@ -505,7 +505,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
});
let val = ctx
.builder
.build_call(ceil_intrinsic, &[arg], "ceil")
.build_call(ceil_intrinsic, &[arg.into()], "ceil")
.try_as_basic_value()
.left()
.unwrap();
@ -542,7 +542,7 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
});
let val = ctx
.builder
.build_call(ceil_intrinsic, &[arg], "ceil")
.build_call(ceil_intrinsic, &[arg.into()], "ceil")
.try_as_basic_value()
.left()
.unwrap();

View File

@ -10,7 +10,6 @@ nac3parser = { path = "../nac3parser" }
nac3core = { path = "../nac3core" }
[dependencies.inkwell]
git = "https://github.com/TheDan64/inkwell"
branch = "master"
version = "0.1.0-beta.4"
default-features = false
features = ["llvm12-0", "target-x86", "target-arm", "target-riscv", "no-libffi-linking"]