diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-13 21:48:21 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-13 21:49:25 -0800 |
commit | 84ef3f01055c3a5177f5d0ad90e826bab2eb81bd (patch) | |
tree | fcc0897fd103ab204a3cde84311abb76341d6cc8 | |
parent | 0dd40e7482785238968dc2c9a36bc2bfd7896df4 (diff) |
Make __builtin_va_list a built-in declaration, not keyword
-rw-r--r-- | decl.c | 6 | ||||
-rw-r--r-- | decl.h | 6 | ||||
-rw-r--r-- | main.c | 1 | ||||
-rw-r--r-- | pp.c | 1 | ||||
-rw-r--r-- | token.c | 1 | ||||
-rw-r--r-- | token.h | 1 |
6 files changed, 7 insertions, 9 deletions
@@ -18,6 +18,7 @@ #include "token.h" #include "type.h" +struct declaration builtinvalist = {.kind = DECLTYPE, .type = &typevalist}; struct declaration builtinvastart = {.kind = DECLBUILTIN}; struct declaration builtinvaarg = {.kind = DECLBUILTIN}; struct declaration builtinvaend = {.kind = DECLBUILTIN}; @@ -309,11 +310,6 @@ declspecs(struct scope *s, enum storageclass *sc, enum funcspecifier *fs, int *a case T_ATOMIC: fatal("_Atomic is not yet supported"); break; - case T__BUILTIN_VA_LIST: - t = &typevalist; - ++ntypes; - next(); - break; case TSTRUCT: case TUNION: case TENUM: @@ -25,7 +25,11 @@ struct declaration { struct scope; struct function; -extern struct declaration builtinvastart, builtinvaarg, builtinvaend, builtinoffsetof; +extern struct declaration builtinvalist; +extern struct declaration builtinvastart; +extern struct declaration builtinvaarg; +extern struct declaration builtinvaend; +extern struct declaration builtinoffsetof; struct declaration *mkdecl(enum declarationkind, struct type *, enum linkage); _Bool decl(struct scope *, struct function *); @@ -53,6 +53,7 @@ main(int argc, char *argv[]) next(); } } else { + scopeputdecl(&filescope, "__builtin_va_list", &builtinvalist); scopeputdecl(&filescope, "__builtin_va_start", &builtinvastart); scopeputdecl(&filescope, "__builtin_va_arg", &builtinvaarg); scopeputdecl(&filescope, "__builtin_va_end", &builtinvaend); @@ -28,7 +28,6 @@ keyword(struct token *tok) {"_Noreturn", T_NORETURN}, {"_Static_assert", T_STATIC_ASSERT}, {"_Thread_local", T_THREAD_LOCAL}, - {"__builtin_va_list", T__BUILTIN_VA_LIST}, {"auto", TAUTO}, {"break", TBREAK}, {"case", TCASE}, @@ -52,7 +52,6 @@ static char *tokstr[] = { [T_NORETURN] = "_Noreturn", [T_STATIC_ASSERT] = "_Static_assert", [T_THREAD_LOCAL] = "_Thread_local", - [T__BUILTIN_VA_LIST] = "__builtin_va_list", /* punctuator */ [TLBRACK] = "[", @@ -54,7 +54,6 @@ enum tokenkind { T_NORETURN, T_STATIC_ASSERT, T_THREAD_LOCAL, - T__BUILTIN_VA_LIST, /* punctuator */ TLBRACK, |