mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-21 05:05:00 -07:00
Begin work on making the type info table be constantly initialized
This commit is contained in:
@@ -980,12 +980,12 @@ gb_internal LLVMTypeRef lb_type_padding_filler(lbModule *m, i64 padding, i64 pad
|
||||
|
||||
GB_ASSERT_MSG(elem != nullptr, "Invalid lb_type_padding_filler padding and padding_align: %lld", padding_align);
|
||||
if (len != 1) {
|
||||
return LLVMArrayType(elem, cast(unsigned)len);
|
||||
return llvm_array_type(elem, len);
|
||||
} else {
|
||||
return elem;
|
||||
}
|
||||
} else {
|
||||
return LLVMArrayType(lb_type(m, t_u8), cast(unsigned)padding);
|
||||
return llvm_array_type(lb_type(m, t_u8), padding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1437,6 +1437,17 @@ gb_internal lbValue lb_emit_ptr_offset(lbProcedure *p, lbValue ptr, lbValue inde
|
||||
return res;
|
||||
}
|
||||
|
||||
gb_internal lbValue lb_const_ptr_offset(lbModule *m, lbValue ptr, lbValue index) {
|
||||
LLVMValueRef indices[1] = {index.value};
|
||||
lbValue res = {};
|
||||
res.type = ptr.type;
|
||||
LLVMTypeRef type = lb_type(m, type_deref(res.type, true));
|
||||
|
||||
GB_ASSERT(lb_is_const(ptr) && lb_is_const(index));
|
||||
res.value = LLVMConstGEP2(type, ptr.value, indices, 1);
|
||||
return res;
|
||||
}
|
||||
|
||||
gb_internal lbValue lb_emit_matrix_epi(lbProcedure *p, lbValue s, isize row, isize column) {
|
||||
Type *t = s.type;
|
||||
GB_ASSERT(is_type_pointer(t));
|
||||
|
||||
Reference in New Issue
Block a user