diff options
Diffstat (limited to 'src/symtab.h')
-rw-r--r-- | src/symtab.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/symtab.h b/src/symtab.h index 29c4868..448ffd9 100644 --- a/src/symtab.h +++ b/src/symtab.h @@ -1,5 +1,5 @@ -#ifndef ORYX_SYMTAB_H -#define ORYX_SYMTAB_H +#ifndef ORYX_TABLES_H +#define ORYX_TABLES_H #include <stdbool.h> @@ -10,6 +10,7 @@ #include "types.h" typedef struct symtab symtab_t; +typedef struct typetab typetab_t; typedef struct { bool exists; @@ -17,10 +18,29 @@ typedef struct { LLVMValueRef v; } symval_t; +typedef struct type { + uint8_t kind; + + union { + struct { + uint8_t size; /* number of bytes */ + bool isfloat; + bool issigned; + }; + struct { + struct type *params, *ret; + idx_t paramcnt; + }; + }; +} type_t; + /* Index the symbol table M with the key SV, returning a pointer to the value. If no entry exists and A is non-null, a pointer to a newly allocated (and zeroed) value is returned, NULL otherwise. */ symval_t *symtab_insert(symtab_t **m, strview_t sv, arena_t *a) __attribute__((nonnull(1))); -#endif /* !ORYX_SYMTAB_H */ +type_t **typetab_insert(typetab_t **m, strview_t sv, arena_t *a) + __attribute__((nonnull(1))); + +#endif /* !ORYX_TABLES_H */ |