aboutsummaryrefslogtreecommitdiff
path: root/decl.h
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-22 12:58:13 -0800
committerMichael Forney <mforney@mforney.org>2019-02-22 12:58:13 -0800
commit4df0c2114cd0afd7aded5e67bd9e9af35b149fab (patch)
tree5820fb19ec0ccf2dc4a212e46114771f944984d9 /decl.h
parenta1a5214bbae2b1b4c988e5f3d1b6415b64a890c6 (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.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/decl.h b/decl.h
index 0fb081b..5b8b83d 100644
--- a/decl.h
+++ b/decl.h
@@ -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 *);