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,
llvm_intrinsics::{call_int_smax, call_memcpy_generic, call_stackrestore, call_stacksave},
stmt::{gen_block, gen_for_callback_incrementing, gen_if_callback, gen_with},
types::NDArrayType,
types::ndarray::NDArrayType,
values::{
ArrayLikeIndexer, ArrayLikeValue, ArraySliceValue, ListValue, NDArrayValue, ProxyValue,
RangeValue, UntypedArrayLikeAccessor,
ndarray::NDArrayValue, ArrayLikeIndexer, ArrayLikeValue, ArraySliceValue, ListValue,
ProxyValue, RangeValue, UntypedArrayLikeAccessor,
},
CodeGenContext, CodeGenerator,
},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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