aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLinus Torvalds <torvalds@home.transmeta.com>2003-04-07 15:05:19 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:19 -0700
commit29c908da161edd3d159a424cf010e0e91811fd9c (patch)
tree1b51324ab0492045a6cfa4eade1bd3b3e435c4a6
parentf5becbb76fbd294b2965fd3093718ac19e2db3c4 (diff)
downloadsparse-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.c5
-rw-r--r--symbol.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index 16b56058..dff5a413 100644
--- a/parse.c
+++ b/parse.c
@@ -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, ','))
diff --git a/symbol.c b/symbol.c
index f1a0e6a9..9f380715 100644
--- a/symbol.c
+++ b/symbol.c
@@ -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 },