Change tav to be a pointer internally

This commit is contained in:
gingerBill
2022-12-22 11:53:13 +00:00
parent b9a2426e57
commit e98f1a28e6
11 changed files with 140 additions and 133 deletions
+5 -2
View File
@@ -754,7 +754,7 @@ struct AstCommonStuff {
u8 state_flags;
u8 viral_state_flags;
i32 file_id;
TypeAndValue tav; // TODO(bill): Make this a pointer to minimize 'Ast' size
TypeAndValue *tav_; // TODO(bill): Make this a pointer to minimize 'Ast' size
};
struct Ast {
@@ -762,7 +762,7 @@ struct Ast {
u8 state_flags;
u8 viral_state_flags;
i32 file_id;
TypeAndValue tav; // TODO(bill): Make this a pointer to minimize 'Ast' size
TypeAndValue *tav_; // TODO(bill): Make this a pointer to minimize 'Ast' size
// IMPORTANT NOTE(bill): This must be at the end since the AST is allocated to be size of the variant
union {
@@ -771,6 +771,9 @@ struct Ast {
#undef AST_KIND
};
gb_inline TypeAndValue &tav() const {
return *this->tav_;
}
// NOTE(bill): I know I dislike methods but this is hopefully a temporary thing
// for refactoring purposes