summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2026-08-06 00:24:49 -0400
committerCarson Fleming <cflems@cflems.net>2026-08-06 00:24:49 -0400
commitb48e27f5cc31af65d8bb92d4b81cd03a60c5bcdb (patch)
tree0901fba9ff451968d758ed47b57ff99d1330fb8a /scope.h
parenta207a7f39514f03ddfafbe39e52a3fae57a414b4 (diff)
downloadccc-b48e27f5cc31af65d8bb92d4b81cd03a60c5bcdb.tar.gz
clean up yesterday's hacks + functions in type system
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/scope.h b/scope.h
index 4f7ac3a..c0c3d3b 100644
--- a/scope.h
+++ b/scope.h
@@ -5,35 +5,36 @@
#include "type.h"
#include "hashmap.h"
+struct type_alias {
+ const char* name;
+ struct type type;
+};
+
struct storage_location {
enum {
STO_REG,
STO_LABEL,
STO_STACK,
STO_IMM,
- /* I would like to solve functions using the type system
- * and kill STO_FN and STO_UNRESOLVED in favor of STO_LABEL. */
- STO_FN,
- STO_UNRESOLVED,
} type;
union {
struct reg* reg;
const char* label;
sintegral_t bp_offset;
integral_t value;
- struct fn_decl_node* decl;
};
};
-struct type_alias {
- const char* name;
- struct type type;
+struct fn_def {
+ const struct fn_decl_node* decl;
+ bool resolved;
};
struct var_def {
const struct type* type;
char* name;
- struct storage_location loc;
+ struct fn_def fn;
+ struct storage_location storage;
};
struct scope {