aboutsummaryrefslogtreecommitdiff
path: root/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'type.c')
-rw-r--r--type.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/type.c b/type.c
index 1d28213..2653310 100644
--- a/type.c
+++ b/type.c
@@ -39,6 +39,8 @@ struct type typefloat = FLTTYPE(TYPEFLOAT, 4);
struct type typedouble = FLTTYPE(TYPEDOUBLE, 8);
struct type typeldouble = FLTTYPE(TYPELDOUBLE, 16);
+struct type *typeadjvalist;
+
struct type *
mktype(enum typekind kind, enum typeprop prop)
{
@@ -216,6 +218,22 @@ typecommonreal(struct type *t1, unsigned w1, struct type *t2, unsigned w2)
fatal("internal error; could not find common real type");
}
+/* function parameter type adjustment (C11 6.7.6.3p7) */
+struct type *
+typeadjust(struct type *t)
+{
+ switch (t->kind) {
+ case TYPEARRAY:
+ t = mkpointertype(t->base, t->qual);
+ break;
+ case TYPEFUNC:
+ t = mkpointertype(t, QUALNONE);
+ break;
+ }
+
+ return t;
+}
+
struct member *
typemember(struct type *t, const char *name, uint64_t *offset)
{