summaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2026-07-17 12:40:59 -0700
committerCarson Fleming <cflems@cflems.net>2026-07-17 12:40:59 -0700
commit424be65858999a894a18e1972fa9649fbc4c1df8 (patch)
treea878fe623546a2e3fcaf204d5977991995b21c3c /ast.h
parent155d1971b7cd56d3206808c36c6b40357bc31cbb (diff)
downloadccc-424be65858999a894a18e1972fa9649fbc4c1df8.tar.gz
improve type system sorta
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/ast.h b/ast.h
index a2d576b..1eda481 100644
--- a/ast.h
+++ b/ast.h
@@ -6,12 +6,9 @@
struct stmt_node;
struct expr_node;
-struct type_node {
- bool is_unsigned;
- bool is_short;
- bool is_long;
+struct type_ref_node {
unsigned char ptr_level;
- struct type_def* def;
+ const struct type_def* def_ref;
};
struct int_lit_node {
@@ -35,8 +32,8 @@ struct var_ref_node {
};
struct var_decl_node {
- struct type_node type;
- char* ident;
+ struct type_ref_node type;
+ struct var_def* def_ref;
};
struct lval_node {
@@ -108,10 +105,7 @@ struct expr_node {
struct binary_node binary;
} inner;
- struct {
- bool is_signed;
- unsigned long long sz;
- } evaluated_type;
+ const struct type_def* resolved_type;
};
struct group_node {
@@ -125,7 +119,7 @@ struct args_decl_node {
};
struct fn_decl_node {
- struct type_node return_type;
+ struct type_ref_node return_type;
char* name;
struct args_decl_node* args;
struct group_node body;