diff options
| author | gingerBill <bill@gingerbill.org> | 2020-05-02 18:45:57 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-05-02 18:45:57 +0100 |
| commit | e27f5796d61aa1e1dbd4b2d52e9f580fd24d3fc2 (patch) | |
| tree | cfd4d3ccf48628950525cf55ae618400ae0e2543 /src/types.cpp | |
| parent | ba4363d67832b7f192492e1354b273296cc0c755 (diff) | |
Add experimental atom op tables for llvm-backend
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/types.cpp b/src/types.cpp index 92634d9d9..990ca8387 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1,5 +1,6 @@ struct Scope; struct Ast; +struct Entity; enum BasicKind { Basic_Invalid, @@ -123,6 +124,21 @@ enum StructSoaKind { StructSoa_Dynamic = 3, }; +enum TypeAtomOpKind { + TypeAtomOp_Invalid, + + TypeAtomOp_index_get, + TypeAtomOp_index_set, + TypeAtomOp_slice, + TypeAtomOp_index_get_ptr, + + TypeAtomOp_COUNT, +}; + +struct TypeAtomOpTable { + Entity *op[TypeAtomOp_COUNT]; +}; + struct TypeStruct { Array<Entity *> fields; Array<String> tags; @@ -135,6 +151,12 @@ struct TypeStruct { i64 custom_align; Entity * names; + + TypeAtomOpTable *atom_op_table; + + Type * soa_elem; + i64 soa_count; + StructSoaKind soa_kind; bool are_offsets_set; bool are_offsets_being_processed; @@ -142,10 +164,6 @@ struct TypeStruct { bool is_raw_union; bool is_polymorphic; bool is_poly_specialized; - - StructSoaKind soa_kind; - Type * soa_elem; - i64 soa_count; }; struct TypeUnion { @@ -157,6 +175,9 @@ struct TypeUnion { i64 tag_size; Type * polymorphic_params; // Type_Tuple Type * polymorphic_parent; + + TypeAtomOpTable *atom_op_table; + bool no_nil; bool maybe; bool is_polymorphic; |