diff options
| author | 2022-08-04 10:07:13 +0200 | |
|---|---|---|
| committer | 2022-08-04 10:07:13 +0200 | |
| commit | c5d837d2cd9a57e453da9eaab0e41e0c185e084e (patch) | |
| tree | 60539ae58df6738772f1e63e2aa58dd8002803e4 /bootstrap/all.h | |
| parent | bb1d4b4a3e51a06fb0530dfc271a97a6cd88cc73 (diff) | |
fold & more
Diffstat (limited to 'bootstrap/all.h')
| -rw-r--r-- | bootstrap/all.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bootstrap/all.h b/bootstrap/all.h index 6b5fd7d..762e978 100644 --- a/bootstrap/all.h +++ b/bootstrap/all.h @@ -237,8 +237,11 @@ struct expr { struct span span; const struct type *ty; union { - u64 i; // also for bool lit - double f; + union { + i64 i; // also for bool lit + u64 u; + double f; + }; struct { const char *d; u64 n; @@ -405,6 +408,13 @@ bool typeeql(const struct type *lhs, const struct type *rhs); bool completetype(const struct type *); void putprimtypes(struct env *); void visittypes(void (*visitor)(const struct type *, void *), void *arg); +const struct type *constify(const struct type *ty); +const struct type *unconstify(const struct type *ty); +const struct type *constifychild(const struct type *ty); +int numtype2rank(const struct type *a); +const struct type * rank2numtype(int r); +bool isnumtype(const struct type *a); +const struct type *typeof2(const struct type *a, const struct type *b); /** env.c **/ struct decl *envfind(const struct env *, const char *name); @@ -419,3 +429,6 @@ void pritoktree(struct toktree); /** cgen.c **/ void cgen(FILE *, const struct transunit *); + +/** fold.c **/ +int fold(struct expr *); |