mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 12:48:14 +00:00
Begin work adding bit_field
This commit is contained in:
@@ -181,6 +181,13 @@ Type_Info_Matrix :: struct {
|
||||
Type_Info_Soa_Pointer :: struct {
|
||||
elem: ^Type_Info,
|
||||
}
|
||||
Type_Info_Bit_Field :: struct {
|
||||
backing_type: ^Type_Info,
|
||||
names: []string,
|
||||
types: []^Type_Info,
|
||||
bit_sizes: []uintptr,
|
||||
bit_offsets: []uintptr,
|
||||
}
|
||||
|
||||
Type_Info_Flag :: enum u8 {
|
||||
Comparable = 0,
|
||||
@@ -223,6 +230,7 @@ Type_Info :: struct {
|
||||
Type_Info_Relative_Multi_Pointer,
|
||||
Type_Info_Matrix,
|
||||
Type_Info_Soa_Pointer,
|
||||
Type_Info_Bit_Field,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -256,6 +264,7 @@ Typeid_Kind :: enum u8 {
|
||||
Relative_Multi_Pointer,
|
||||
Matrix,
|
||||
Soa_Pointer,
|
||||
Bit_Field,
|
||||
}
|
||||
#assert(len(Typeid_Kind) < 32)
|
||||
|
||||
|
||||
@@ -459,6 +459,20 @@ print_type :: proc "contextless" (ti: ^Type_Info) {
|
||||
}
|
||||
print_byte(']')
|
||||
|
||||
case Type_Info_Bit_Field:
|
||||
print_string("bit_field ")
|
||||
print_type(info.backing_type)
|
||||
print_string(" {")
|
||||
for name, i in info.names {
|
||||
if i > 0 { print_string(", ") }
|
||||
print_string(name)
|
||||
print_string(": ")
|
||||
print_type(info.types[i])
|
||||
print_string(" | ")
|
||||
print_u64(u64(info.bit_sizes[i]))
|
||||
}
|
||||
print_byte('}')
|
||||
|
||||
|
||||
case Type_Info_Simd_Vector:
|
||||
print_string("#simd[")
|
||||
|
||||
Reference in New Issue
Block a user