aboutsummaryrefslogtreecommitdiff
path: root/type.h
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-15 01:39:53 -0800
committerMichael Forney <mforney@mforney.org>2019-02-15 19:52:18 -0800
commit8ffedb1f24804c9c13121a12b3802610f2b6f9df (patch)
treeeafe054135582b264bf021e1b2d414351b023ca1 /type.h
parente477588215b222bf42d72385d9808db56e0bfce0 (diff)
Don't embed anonymous struct members into parent
While this works nicely for structs, when unions are involved it makes it impossible to find the next member to initialize without keeping track of extra data per member.
Diffstat (limited to 'type.h')
-rw-r--r--type.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/type.h b/type.h
index 82c3929..d02df31 100644
--- a/type.h
+++ b/type.h
@@ -45,6 +45,7 @@ struct member {
char *name;
struct type *type;
uint64_t offset;
+ struct member *next;
};
struct type {
@@ -84,7 +85,7 @@ struct type {
} func;
struct {
char *tag;
- struct array members;
+ struct member *members;
} structunion;
};
};
@@ -102,7 +103,7 @@ struct type *typecommonreal(struct type *, struct type *);
struct type *typeargpromote(struct type *);
struct type *typeintpromote(struct type *);
enum typeproperty typeprop(struct type *);
-struct member *typemember(struct type *, const char *name);
+struct type *typemember(struct type *, const char *, uint64_t *);
struct parameter *mkparam(char *, struct type *);