1
0
forked from M-Labs/nac3

[core] Expose {types,values}::ndarray modules

Allows better encapsulation of members in these modules rather than
allowing them to leak into types/values mod.
This commit is contained in:
David Mak 2024-12-12 11:30:14 +08:00
parent 3d0a1d281c
commit eb4b881690
12 changed files with 16 additions and 18 deletions

View File

@ -18,10 +18,10 @@ use nac3core::{
irrt::ndarray::call_ndarray_calc_size, irrt::ndarray::call_ndarray_calc_size,
llvm_intrinsics::{call_int_smax, call_memcpy_generic, call_stackrestore, call_stacksave}, llvm_intrinsics::{call_int_smax, call_memcpy_generic, call_stackrestore, call_stacksave},
stmt::{gen_block, gen_for_callback_incrementing, gen_if_callback, gen_with}, stmt::{gen_block, gen_for_callback_incrementing, gen_if_callback, gen_with},
types::NDArrayType, types::ndarray::NDArrayType,
values::{ values::{
ArrayLikeIndexer, ArrayLikeValue, ArraySliceValue, ListValue, NDArrayValue, ProxyValue, ndarray::NDArrayValue, ArrayLikeIndexer, ArrayLikeValue, ArraySliceValue, ListValue,
RangeValue, UntypedArrayLikeAccessor, ProxyValue, RangeValue, UntypedArrayLikeAccessor,
}, },
CodeGenContext, CodeGenerator, CodeGenContext, CodeGenerator,
}, },

View File

@ -15,7 +15,7 @@ use pyo3::{
use nac3core::{ use nac3core::{
codegen::{ codegen::{
types::{NDArrayType, ProxyType}, types::{ndarray::NDArrayType, ProxyType},
CodeGenContext, CodeGenerator, CodeGenContext, CodeGenerator,
}, },
inkwell::{ inkwell::{

View File

@ -15,7 +15,7 @@ use super::{
numpy::ndarray_elementwise_unaryop_impl, numpy::ndarray_elementwise_unaryop_impl,
stmt::gen_for_callback_incrementing, stmt::gen_for_callback_incrementing,
values::{ values::{
ArrayLikeValue, NDArrayValue, ProxyValue, RangeValue, TypedArrayLikeAccessor, ndarray::NDArrayValue, ArrayLikeValue, ProxyValue, RangeValue, TypedArrayLikeAccessor,
UntypedArrayLikeAccessor, UntypedArrayLikeMutator, UntypedArrayLikeAccessor, UntypedArrayLikeMutator,
}, },
CodeGenContext, CodeGenerator, CodeGenContext, CodeGenerator,

View File

@ -34,7 +34,7 @@ use super::{
}, },
types::ListType, types::ListType,
values::{ values::{
ArrayLikeIndexer, ArrayLikeValue, ListValue, NDArrayValue, ProxyValue, RangeValue, ndarray::NDArrayValue, ArrayLikeIndexer, ArrayLikeValue, ListValue, ProxyValue, RangeValue,
TypedArrayLikeAccessor, UntypedArrayLikeAccessor, TypedArrayLikeAccessor, UntypedArrayLikeAccessor,
}, },
CodeGenContext, CodeGenTask, CodeGenerator, CodeGenContext, CodeGenTask, CodeGenerator,

View File

@ -10,8 +10,8 @@ use crate::codegen::{
macros::codegen_unreachable, macros::codegen_unreachable,
stmt::gen_for_callback_incrementing, stmt::gen_for_callback_incrementing,
values::{ values::{
ArrayLikeIndexer, ArrayLikeValue, ArraySliceValue, NDArrayValue, TypedArrayLikeAccessor, ndarray::NDArrayValue, ArrayLikeIndexer, ArrayLikeValue, ArraySliceValue,
TypedArrayLikeAdapter, UntypedArrayLikeAccessor, TypedArrayLikeAccessor, TypedArrayLikeAdapter, UntypedArrayLikeAccessor,
}, },
CodeGenContext, CodeGenerator, CodeGenContext, CodeGenerator,
}; };

View File

@ -38,7 +38,7 @@ use crate::{
}; };
use concrete_type::{ConcreteType, ConcreteTypeEnum, ConcreteTypeStore}; use concrete_type::{ConcreteType, ConcreteTypeEnum, ConcreteTypeStore};
pub use generator::{CodeGenerator, DefaultCodeGenerator}; pub use generator::{CodeGenerator, DefaultCodeGenerator};
use types::{ListType, NDArrayType, ProxyType, RangeType}; use types::{ndarray::NDArrayType, ListType, ProxyType, RangeType};
pub mod builtin_fns; pub mod builtin_fns;
pub mod concrete_type; pub mod concrete_type;

View File

@ -18,9 +18,9 @@ use super::{
llvm_intrinsics::{self, call_memcpy_generic}, llvm_intrinsics::{self, call_memcpy_generic},
macros::codegen_unreachable, macros::codegen_unreachable,
stmt::{gen_for_callback_incrementing, gen_for_range_callback, gen_if_else_expr_callback}, stmt::{gen_for_callback_incrementing, gen_for_range_callback, gen_if_else_expr_callback},
types::{ListType, NDArrayType, ProxyType}, types::{ndarray::NDArrayType, ListType, ProxyType},
values::{ values::{
ArrayLikeIndexer, ArrayLikeValue, ListValue, NDArrayValue, ProxyValue, ndarray::NDArrayValue, ArrayLikeIndexer, ArrayLikeValue, ListValue, ProxyValue,
TypedArrayLikeAccessor, TypedArrayLikeAdapter, TypedArrayLikeMutator, TypedArrayLikeAccessor, TypedArrayLikeAdapter, TypedArrayLikeMutator,
UntypedArrayLikeAccessor, UntypedArrayLikeMutator, UntypedArrayLikeAccessor, UntypedArrayLikeMutator,
}, },

View File

@ -17,7 +17,7 @@ use parking_lot::RwLock;
use super::{ use super::{
concrete_type::ConcreteTypeStore, concrete_type::ConcreteTypeStore,
types::{ListType, NDArrayType, ProxyType, RangeType}, types::{ndarray::NDArrayType, ListType, ProxyType, RangeType},
CodeGenContext, CodeGenLLVMOptions, CodeGenTargetMachineOptions, CodeGenTask, CodeGenerator, CodeGenContext, CodeGenLLVMOptions, CodeGenTargetMachineOptions, CodeGenTask, CodeGenerator,
DefaultCodeGenerator, WithCall, WorkerRegistry, DefaultCodeGenerator, WithCall, WorkerRegistry,
}; };

View File

@ -23,11 +23,10 @@ use super::{
{CodeGenContext, CodeGenerator}, {CodeGenContext, CodeGenerator},
}; };
pub use list::*; pub use list::*;
pub use ndarray::*;
pub use range::*; pub use range::*;
mod list; mod list;
mod ndarray; pub mod ndarray;
mod range; mod range;
pub mod structure; pub mod structure;

View File

@ -13,7 +13,7 @@ use super::{
ProxyType, ProxyType,
}; };
use crate::codegen::{ use crate::codegen::{
values::{ArraySliceValue, NDArrayValue, ProxyValue}, values::{ndarray::NDArrayValue, ArraySliceValue, ProxyValue},
{CodeGenContext, CodeGenerator}, {CodeGenContext, CodeGenerator},
}; };

View File

@ -4,12 +4,11 @@ use super::types::ProxyType;
use crate::codegen::CodeGenerator; use crate::codegen::CodeGenerator;
pub use array::*; pub use array::*;
pub use list::*; pub use list::*;
pub use ndarray::*;
pub use range::*; pub use range::*;
mod array; mod array;
mod list; mod list;
mod ndarray; pub mod ndarray;
mod range; mod range;
/// A LLVM type that is used to represent a non-primitive value in NAC3. /// A LLVM type that is used to represent a non-primitive value in NAC3.

View File

@ -12,7 +12,7 @@ use crate::codegen::{
irrt, irrt,
llvm_intrinsics::call_int_umin, llvm_intrinsics::call_int_umin,
stmt::gen_for_callback_incrementing, stmt::gen_for_callback_incrementing,
types::{structure::StructField, NDArrayType}, types::{ndarray::NDArrayType, structure::StructField},
CodeGenContext, CodeGenerator, CodeGenContext, CodeGenerator,
}; };