mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
update inkwell to ease the llvm13 transition
This commit is contained in:
parent
7fb00140c1
commit
40246607aa
8 changed files with 88 additions and 39 deletions
|
@ -10,7 +10,7 @@ use bumpalo::collections::Vec;
|
|||
use inkwell::basic_block::BasicBlock;
|
||||
use inkwell::context::Context;
|
||||
use inkwell::module::Linkage;
|
||||
use inkwell::types::{AnyTypeEnum, BasicType, BasicTypeEnum};
|
||||
use inkwell::types::{AnyTypeEnum, BasicMetadataTypeEnum, BasicType, BasicTypeEnum};
|
||||
use inkwell::values::{
|
||||
BasicValue, BasicValueEnum, FunctionValue, IntValue, PointerValue, StructValue,
|
||||
};
|
||||
|
@ -567,9 +567,11 @@ fn call_help<'a, 'ctx, 'env>(
|
|||
let call = match call_mode {
|
||||
CallMode::Inc(inc_amount) => {
|
||||
env.builder
|
||||
.build_call(function, &[value, inc_amount.into()], "increment")
|
||||
.build_call(function, &[value.into(), inc_amount.into()], "increment")
|
||||
}
|
||||
CallMode::Dec => env.builder.build_call(function, &[value], "decrement"),
|
||||
CallMode::Dec => env
|
||||
.builder
|
||||
.build_call(function, &[value.into()], "decrement"),
|
||||
};
|
||||
|
||||
call.set_call_convention(FAST_CALL_CONV);
|
||||
|
@ -1053,6 +1055,11 @@ pub fn build_header_help<'a, 'ctx, 'env>(
|
|||
arguments: &[BasicTypeEnum<'ctx>],
|
||||
) -> FunctionValue<'ctx> {
|
||||
use inkwell::types::AnyTypeEnum::*;
|
||||
|
||||
let it = arguments.iter().map(|x| BasicMetadataTypeEnum::from(*x));
|
||||
let vec = Vec::from_iter_in(it, env.arena);
|
||||
let arguments = vec.as_slice();
|
||||
|
||||
let fn_type = match return_type {
|
||||
ArrayType(t) => t.fn_type(arguments, false),
|
||||
FloatType(t) => t.fn_type(arguments, false),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue