Compare commits

..

2 Commits

Author SHA1 Message Date
David Mak ae2c1a7ee5 core: Refactor VarMap to IndexMap
This is the only Map I can find that preserves insertion order while
also deduplicating elements by key.
2024-03-22 15:40:29 +08:00
David Mak 8585cc55fd core: Add ArrayLikeValue
For exposing LLVM values that can be accessed like an array.
2024-03-22 15:40:12 +08:00
1 changed files with 1 additions and 2 deletions

View File

@ -200,8 +200,7 @@ type ValueDowncastFn<'ctx, T> = Box<dyn Fn(&mut CodeGenContext<'ctx, '_>, BasicV
type ValueUpcastFn<'ctx, T> = Box<dyn Fn(&mut CodeGenContext<'ctx, '_>, T) -> BasicValueEnum<'ctx>>;
/// An adapter for constraining untyped array values as typed values.
#[allow(clippy::type_complexity)]
pub struct TypedArrayLikeAdapter<'ctx, T, Adapted: ArrayLikeValue<'ctx>> {
pub struct TypedArrayLikeAdapter<'ctx, T, Adapted: ArrayLikeValue<'ctx> = ArraySliceValue<'ctx>> {
adapted: Adapted,
downcast_fn: ValueDowncastFn<'ctx, T>,
upcast_fn: ValueUpcastFn<'ctx, T>,