Lines Matching refs:decl
1902 struct symbol *decl = alloc_symbol(token->pos, SYM_NODE);
1903 ctx.ident = &decl->ident;
1912 decl->ctype = ctx.ctype;
1913 decl->ctype.modifiers |= mod;
1914 decl->endpos = token->pos;
1915 add_symbol(list, decl);
2736 static struct token *parse_function_body(struct token *token, struct symbol *decl,
2740 struct symbol *base_type = decl->ctype.base_type;
2746 if (decl->ctype.modifiers & MOD_INLINE) {
2747 function_symbol_list = &decl->inline_symbol_list;
2750 function_symbol_list = &decl->symbol_list;
2756 if ((decl->ctype.modifiers & (MOD_EXTERN|MOD_INLINE)) == MOD_EXTERN) {
2758 warning(decl->pos, "function '%s' with external linkage has definition", show_ident(decl->ident));
2760 if (!(decl->ctype.modifiers & MOD_STATIC))
2761 decl->ctype.modifiers |= MOD_EXTERN;
2763 stmt = start_function(decl);
2771 end_function(decl);
2773 if (!(decl->ctype.modifiers & MOD_INLINE))
2774 add_symbol(list, decl);
2775 check_declaration(decl);
2776 decl->definition = decl;
2777 prev = decl->same_symbol;
2779 warning(decl->pos, "multiple definitions for function '%s'",
2780 show_ident(decl->ident));
2784 rebind_scope(prev, decl->scope);
2785 prev->definition = decl;
2792 warning(decl->pos, "function '%s' has computed goto but no targets?", show_ident(decl->ident));
2845 static struct token *parse_k_r_arguments(struct token *token, struct symbol *decl,
2851 warning(token->pos, "non-ANSI definition of function '%s'", show_ident(decl->ident));
2862 apply_k_r_types(args, decl);
2868 return parse_function_body(token, decl, list);
2891 struct symbol *decl;
2908 decl = alloc_symbol(token->pos, SYM_NODE);
2921 decl->ctype = ctx.ctype;
2922 decl->ctype.modifiers |= mod;
2923 decl->endpos = token->pos;
2936 decl->ctype.modifiers |= MOD_USERTYPE;
2938 bind_symbol(decl, ident, is_typedef ? NS_TYPEDEF: NS_SYMBOL);
2940 base_type = decl->ctype.base_type;
2957 sparse_error(decl->pos, "'%s()' has __auto_type return type",
2958 show_ident(decl->ident));
2962 warning(decl->pos, "'%s()' has implicit return type",
2963 show_ident(decl->ident));
2967 decl->ctype.modifiers |= ctx.f_modifiers;
2971 return parse_k_r_arguments(token, decl, list);
2973 return parse_function_body(token, decl, list);
2975 if (!(decl->ctype.modifiers & MOD_STATIC))
2976 decl->ctype.modifiers |= MOD_EXTERN;
2977 } else if (base_type == &void_ctype && !(decl->ctype.modifiers & MOD_EXTERN)) {
2981 warning(decl->pos, "'%s' has implicit type", show_ident(decl->ident));
2982 decl->ctype.base_type = &int_ctype;;
2988 token = initializer(&decl->initializer, next);
2994 validate_decl(decl);
2996 if (decl->initializer && decl->ctype.modifiers & MOD_EXTERN) {
2997 warning(decl->pos, "symbol with external linkage has initializer");
2998 decl->ctype.modifiers &= ~MOD_EXTERN;
3001 if (!(decl->ctype.modifiers & (MOD_EXTERN | MOD_INLINE))) {
3002 add_symbol(list, decl);
3003 fn_local_symbol(decl);
3006 check_declaration(decl);
3007 if (decl->same_symbol) {
3008 decl->definition = decl->same_symbol->definition;
3009 decl->op = decl->same_symbol->op;
3012 check_duplicates(decl);
3018 if (decl->ctype.base_type != &autotype_ctype)
3022 else if (!decl->initializer)
3024 else if (decl->initializer->type == EXPR_SYMBOL &&
3025 decl->initializer->symbol == decl)
3028 sparse_error(decl->pos, "__auto_type %s", msg);
3029 decl->ctype.base_type = &bad_ctype;
3038 decl = alloc_symbol(token->pos, SYM_NODE);
3045 decl->ctype = ctx.ctype;
3046 decl->ctype.modifiers |= mod;
3047 decl->endpos = token->pos;
3054 decl->ctype.modifiers |= MOD_USERTYPE;
3056 bind_symbol(decl, ident, is_typedef ? NS_TYPEDEF: NS_SYMBOL);
3059 base_type = decl->ctype.base_type;
3061 if (!(decl->ctype.modifiers & MOD_STATIC))
3062 decl->ctype.modifiers |= MOD_EXTERN;