Compare commits

..

7 Commits

Author SHA1 Message Date
David Mak f7fbc629aa core: Add ArrayLikeValue
For exposing LLVM values that can be accessed like an array.
2024-03-21 21:10:19 +08:00
David Mak 724651d2bb core: Allow unsized CodeGenerator to be passed to some codegen functions
Enables codegen_callback to call these codegen functions as well.
2024-03-21 15:46:10 +08:00
David Mak 2665668e21 core: Simplify typed value assertions 2024-03-21 15:46:10 +08:00
David Mak 9b1c559efb core: Add gen_for_callback_incrementing
Simplifies generation of monotonically increasing for loops.
2024-03-21 15:46:10 +08:00
David Mak 5ecc2a905e core: Add missing unchecked accessors for NDArrayDimsProxy 2024-03-21 15:46:10 +08:00
David Mak 2a8a5bbfea core: Split numpy into codegen and toplevel 2024-03-21 15:46:10 +08:00
David Mak 3ed8ce7215 core: Apply clippy suggestions 2024-03-21 15:46:10 +08:00
3 changed files with 3 additions and 5 deletions

View File

@ -699,7 +699,7 @@ impl Unifier {
self.set_a_to_b(a, x);
}
(TVar { fields: Some(fields), range, is_const_generic: false, .. }, TTuple { ty }) => {
let len = i32::try_from(ty.len()).unwrap();
let len = ty.len() as i32;
for (k, v) in fields {
match *k {
RecordKey::Int(i) => {

View File

@ -74,8 +74,7 @@ impl SymbolResolver for Resolver {
if let Some(id) = str_store.get(s) {
*id
} else {
let id = i32::try_from(str_store.len())
.expect("Symbol resolver string store size exceeds max capacity (i32::MAX)");
let id = str_store.len() as i32;
str_store.insert(s.to_string(), id);
id
}

View File

@ -247,8 +247,6 @@ fn handle_assignment_pattern(
}
fn main() {
const SIZE_T: u32 = usize::BITS;
let cli = CommandLineArgs::parse();
let CommandLineArgs {
file_name,
@ -289,6 +287,7 @@ fn main() {
// The default behavior for -O<n> where n>3 defaults to O3 for both Clang and GCC
_ => OptimizationLevel::Aggressive,
};
const SIZE_T: u32 = 64;
let program = match fs::read_to_string(file_name.clone()) {
Ok(program) => program,