diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-10-30 13:56:38 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-10-30 13:56:38 +0100 |
| commit | 803e95a883a5d3881f662d60cd1a24309bafd4de (patch) | |
| tree | 8096027380d95ac992dd1cbf22576040eff6b750 /src/prc1/triplet | |
| parent | 49d1b87b246f50e5eca25419656188befb4cb85e (diff) | |
| download | prc-803e95a883a5d3881f662d60cd1a24309bafd4de.tar.gz | |
WIP
Diffstat (limited to 'src/prc1/triplet')
| -rw-r--r-- | src/prc1/triplet/prv.h | 12 | ||||
| -rw-r--r-- | src/prc1/triplet/x86_64-linux-gnu.c | 31 |
2 files changed, 29 insertions, 14 deletions
diff --git a/src/prc1/triplet/prv.h b/src/prc1/triplet/prv.h index 342036c..6445ebf 100644 --- a/src/prc1/triplet/prv.h +++ b/src/prc1/triplet/prv.h @@ -1,3 +1,13 @@ +#ifndef TRIPLET_PRV_H +#define TRIPLET_PRV_H + #include "parse.h" -extern const struct type x86_64_linux_gnu[12]; +struct triplet +{ + struct type builtins[12], ptr; +}; + +extern const struct triplet x86_64_linux_gnu; + +#endif diff --git a/src/prc1/triplet/x86_64-linux-gnu.c b/src/prc1/triplet/x86_64-linux-gnu.c index c22bc93..a0f8687 100644 --- a/src/prc1/triplet/x86_64-linux-gnu.c +++ b/src/prc1/triplet/x86_64-linux-gnu.c @@ -1,18 +1,23 @@ #include "triplet/prv.h" #include "parse.h" -const struct type x86_64_linux_gnu[] = +const struct triplet x86_64_linux_gnu = { - {.type = BUILTIN, .u.b = {"void"}}, - {.type = BUILTIN, .u.b = {"char"}, .sz = 1, .sign = 1, .align = 1}, - {.type = BUILTIN, .u.b = {"schar"}, .sz = 1, .sign = 1, .align = 1}, - {.type = BUILTIN, .u.b = {"short"}, .sz = 2, .sign = 1, .align = 2}, - {.type = BUILTIN, .u.b = {"int"}, .sz = 4, .sign = 1, .align = 4}, - {.type = BUILTIN, .u.b = {"long"}, .sz = 8, .sign = 1, .align = 8}, - {.type = BUILTIN, .u.b = {"longlong"}, .sz = 8, .sign = 1, .align = 8}, - {.type = BUILTIN, .u.b = {"uchar"}, .sz = 1, .align = 1}, - {.type = BUILTIN, .u.b = {"ushort"}, .sz = 2, .align = 2}, - {.type = BUILTIN, .u.b = {"uint"}, .sz = 4, .align = 4}, - {.type = BUILTIN, .u.b = {"ulong"}, .sz = 8, .align = 8}, - {.type = BUILTIN, .u.b = {"ulonglong"}, .sz = 8, .align = 8} + .builtins = + { + {.type = BUILTIN, .u.b = {"void"}}, + {.type = BUILTIN, .u.b = {"char"}, .sz = 1, .sign = 1, .align = 1}, + {.type = BUILTIN, .u.b = {"schar"}, .sz = 1, .sign = 1, .align = 1}, + {.type = BUILTIN, .u.b = {"short"}, .sz = 2, .sign = 1, .align = 2}, + {.type = BUILTIN, .u.b = {"int"}, .sz = 4, .sign = 1, .align = 4}, + {.type = BUILTIN, .u.b = {"long"}, .sz = 8, .sign = 1, .align = 8}, + {.type = BUILTIN, .u.b = {"longlong"}, .sz = 8, .sign = 1, .align = 8}, + {.type = BUILTIN, .u.b = {"uchar"}, .sz = 1, .align = 1}, + {.type = BUILTIN, .u.b = {"ushort"}, .sz = 2, .align = 2}, + {.type = BUILTIN, .u.b = {"uint"}, .sz = 4, .align = 4}, + {.type = BUILTIN, .u.b = {"ulong"}, .sz = 8, .align = 8}, + {.type = BUILTIN, .u.b = {"ulonglong"}, .sz = 8, .align = 8} + }, + + .ptr = {.type = P, .sz = 8, .align = 8} }; |
