cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 84ef3f01055c3a5177f5d0ad90e826bab2eb81bd
parent 0dd40e7482785238968dc2c9a36bc2bfd7896df4
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 13 Feb 2019 21:48:21 -0800

Make __builtin_va_list a built-in declaration, not keyword

Diffstat:
Mdecl.c | 6+-----
Mdecl.h | 6+++++-
Mmain.c | 1+
Mpp.c | 1-
Mtoken.c | 1-
Mtoken.h | 1-
6 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/decl.c b/decl.c @@ -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: diff --git a/decl.h b/decl.h @@ -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 *); diff --git a/main.c b/main.c @@ -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); diff --git a/pp.c b/pp.c @@ -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}, diff --git a/token.c b/token.c @@ -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] = "[", diff --git a/token.h b/token.h @@ -54,7 +54,6 @@ enum tokenkind { T_NORETURN, T_STATIC_ASSERT, T_THREAD_LOCAL, - T__BUILTIN_VA_LIST, /* punctuator */ TLBRACK,