[PATCH 11/21] kill create_arglist()
Al Viro <[email protected]> Mon, 16 Mar 2026 07:04:05 +0000
| Newsgroups | org.kernel.vger.linux-sparse |
|---|---|
| Message-ID | <[email protected]> |
we don't need the fake arglist for __has_extension() and its ilk anymore; just set the ->arglist to &eof_token_entry to indicate that arguments are expected and set ->fixed_args and ->vararg to tell how much. Signed-off-by: Al Viro <[email protected]> --- pre-process.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/pre-process.c b/pre-process.c index bd049620..aaf60293 100644 --- a/pre-process.c +++ b/pre-process.c @@ -2071,36 +2071,6 @@ static bool expand_has_feature(struct token *token, struct arg *args) return 1; } -static void create_arglist(struct symbol *sym, int count) -{ - struct token *token; - struct token **next; - - if (!count) - return; - - token = __alloc_token(0); - token_type(token) = TOKEN_ARG_COUNT; - sym->arglist = token; - sym->fixed_args = count; - sym->vararg = 0; - next = &token->next; - - while (count--) { - struct token *id, *uses; - id = __alloc_token(0); - token_type(id) = TOKEN_IDENT; - uses = __alloc_token(0); - token_type(uses) = TOKEN_ARG_COUNT; - uses->count.quoted = 1; - - *next = id; - id->next = uses; - next = &uses->next; - } - *next = &eof_token_entry; -} - static void init_preprocessor(void) { int i; @@ -2172,8 +2142,11 @@ static void init_preprocessor(void) struct symbol *sym; sym = create_symbol(stream, dynamic[i].name, SYM_NODE, NS_MACRO); sym->expand_simple = dynamic[i].expand_simple; - if ((sym->expand = dynamic[i].expand) != NULL) - create_arglist(sym, 1); + if ((sym->expand = dynamic[i].expand) != NULL) { + sym->fixed_args = 1; + sym->vararg = false; + sym->arglist = &eof_token_entry; + } } counter_macro = 0; -- 2.47.3