diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-22 12:58:13 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-22 12:58:13 -0800 |
commit | 4df0c2114cd0afd7aded5e67bd9e9af35b149fab (patch) | |
tree | 5820fb19ec0ccf2dc4a212e46114771f944984d9 /decl.h | |
parent | a1a5214bbae2b1b4c988e5f3d1b6415b64a890c6 (diff) |
Keep track of built-in kind in declaration
Also, populate filescope with builtins outside of main.
Diffstat (limited to 'decl.h')
-rw-r--r-- | decl.h | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -12,27 +12,34 @@ enum linkage { LINKEXTERN, }; +enum builtinkind { + BUILTINVALIST, + BUILTINVASTART, + BUILTINVAARG, + BUILTINVACOPY, + BUILTINVAEND, + BUILTINOFFSETOF, + BUILTINALLOCA, +}; + struct declaration { enum declarationkind kind; enum linkage linkage; struct type *type; struct value *value; + + /* objects and functions */ struct list link; int align; /* may be more strict than type requires */ _Bool tentative, defined; + + /* built-ins */ + enum builtinkind builtin; }; struct scope; struct function; -extern struct declaration builtinvalist; -extern struct declaration builtinvastart; -extern struct declaration builtinvaarg; -extern struct declaration builtinvacopy; -extern struct declaration builtinvaend; -extern struct declaration builtinoffsetof; -extern struct declaration builtinalloca; - struct declaration *mkdecl(enum declarationkind, struct type *, enum linkage); _Bool decl(struct scope *, struct function *); struct type *typename(struct scope *); |