diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-07 15:05:19 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:00:19 -0700 |
| commit | 29c908da161edd3d159a424cf010e0e91811fd9c (patch) | |
| tree | 1b51324ab0492045a6cfa4eade1bd3b3e435c4a6 | |
| parent | f5becbb76fbd294b2965fd3093718ac19e2db3c4 (diff) | |
| download | sparse-dev-29c908da161edd3d159a424cf010e0e91811fd9c.tar.gz | |
Don't add inline functions to the top-level parse tree. They'll
show up inside the parse tree if they are actually used.
| -rw-r--r-- | parse.c | 5 | ||||
| -rw-r--r-- | symbol.c | 3 |
2 files changed, 5 insertions, 3 deletions
@@ -899,7 +899,8 @@ static struct token *external_declaration(struct token *token, struct symbol_lis symbol_iterate(base_type->arguments, declare_argument, decl); token = compound_statement(token->next, base_type->stmt); end_function_scope(); - add_symbol(list, decl); + if (!(decl->ctype.modifiers & MOD_INLINE)) + add_symbol(list, decl); return expect(token, '}', "at end of function"); } decl->ctype.modifiers |= MOD_EXTERN; @@ -913,7 +914,7 @@ static struct token *external_declaration(struct token *token, struct symbol_lis } token = initializer(&decl->initializer, token->next); } - if (!is_typedef && !(decl->ctype.modifiers & MOD_EXTERN)) + if (!is_typedef && !(decl->ctype.modifiers & (MOD_EXTERN | MOD_INLINE))) add_symbol(list, decl); if (!match_op(token, ',')) @@ -317,10 +317,11 @@ struct sym_init { { "union", NULL, MOD_UNIONOF }, { "enum", NULL, MOD_ENUMOF }, - /* Ignored for now.. */ { "inline", NULL, MOD_INLINE }, { "__inline", NULL, MOD_INLINE }, { "__inline__", NULL, MOD_INLINE }, + + /* Ignored for now.. */ { "restrict", NULL, 0 }, { "__restrict", NULL, 0 }, |
