lint1.h revision 1.220 1 /* $NetBSD: lint1.h,v 1.220 2024/03/09 13:20:55 rillig Exp $ */
2
3 /*
4 * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
5 * Copyright (c) 1994, 1995 Jochen Pohl
6 * All Rights Reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Jochen Pohl for
19 * The NetBSD Project.
20 * 4. The name of the author may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 #include "lint.h"
36 #include "op.h"
37
38 /*
39 * A memory pool collects allocated objects that must be available until:
40 * - the end of a block,
41 * - the end of an expression, or
42 * - the end of the translation unit.
43 */
44 typedef struct memory_pool {
45 struct memory_pool_item {
46 void *p;
47 #ifdef DEBUG_MEM
48 size_t size;
49 const char *descr;
50 #endif
51 } *items;
52 size_t len;
53 size_t cap;
54 } memory_pool;
55
56 /* See saved_lwarn in cgram.y. */
57 #define LWARN_ALL (-2)
58 #define LWARN_NONE (-1)
59
60 /*
61 * Describes the position of a declaration or anything else.
62 *
63 * FIXME: Just a single file:lineno pair is not enough to accurately describe
64 * the position of a symbol. The whole inclusion path at that point must be
65 * stored as well. This makes a difference for symbols from included
66 * headers, see print_stack_trace.
67 */
68 typedef struct {
69 const char *p_file;
70 int p_line;
71 int p_uniq; /* uniquifier */
72 } pos_t;
73
74 typedef struct {
75 bool tq_const;
76 bool tq_restrict;
77 bool tq_volatile;
78 bool tq_atomic;
79 } type_qualifiers;
80
81 /* A bool, integer or floating-point value. */
82 typedef struct {
83 tspec_t v_tspec;
84 /*
85 * Set if an integer constant is unsigned only in C90 and later, but
86 * not in traditional C.
87 *
88 * See the operators table in oper.c, columns "l r".
89 */
90 bool v_unsigned_since_c90;
91 bool v_char_constant;
92 union {
93 int64_t integer;
94 long double floating;
95 } u;
96 } val_t;
97
98 typedef struct sym sym_t;
99
100 /*
101 * Structures of type struct_or_union uniquely identify structures. This can't
102 * be done in structures of type type_t, because these are copied if they must
103 * be modified. So it would not be possible to check if two structures are
104 * identical by comparing the pointers to the type structures.
105 *
106 * If the structure has no tag name, its first typedef name is used to identify
107 * the structure in lint2.
108 */
109 typedef struct {
110 unsigned int sou_size_in_bits;
111 unsigned int sou_align_in_bits;
112 bool sou_incomplete:1;
113 sym_t *sou_first_member;
114 sym_t *sou_tag;
115 sym_t *sou_first_typedef;
116 } struct_or_union;
117
118 /* The same as in struct_or_union, only for enums. */
119 typedef struct {
120 bool en_incomplete:1;
121 sym_t *en_first_enumerator;
122 sym_t *en_tag;
123 sym_t *en_first_typedef;
124 } enumeration;
125
126 /* The type of an expression, object or function. */
127 struct lint1_type {
128 tspec_t t_tspec; /* type specifier */
129 bool t_incomplete_array:1;
130 bool t_const:1;
131 bool t_volatile:1;
132 bool t_proto:1; /* function prototype (u.params valid) */
133 bool t_vararg:1; /* prototype with '...' */
134 bool t_typedef:1; /* type defined with typedef */
135 bool t_typeof:1; /* type defined with GCC's __typeof__ */
136 bool t_bitfield:1;
137 /*
138 * Either the type is currently an enum (having t_tspec ENUM), or it
139 * is an integer type (typically INT) that has been implicitly
140 * converted from an enum type. In both cases, u.enumer is valid.
141 */
142 bool t_is_enum:1;
143 bool t_packed:1;
144 union {
145 int dimension; /* if ARRAY */
146 struct_or_union *sou;
147 enumeration *enumer;
148 sym_t *params; /* if t_proto */
149 } u;
150 unsigned int t_bit_field_width:8;
151 unsigned int t_bit_field_offset:24;
152 struct lint1_type *t_subt; /*- element type (if ARRAY),
153 * return value (if FUNC),
154 * target type (if PTR) */
155 };
156
157 typedef enum {
158 SK_VCFT, /* variable, constant, function, type */
159 SK_MEMBER, /* member of a struct or union */
160 SK_TAG,
161 SK_LABEL
162 } symbol_kind;
163
164 /* storage classes and related things */
165 typedef enum {
166 NO_SCL,
167 EXTERN, /* external symbols (independent of decl_t) */
168 STATIC, /* static symbols (local and global) */
169 AUTO, /* automatic symbols (except register) */
170 REG, /* register */
171 TYPEDEF,
172 THREAD_LOCAL,
173 STRUCT_TAG,
174 UNION_TAG,
175 ENUM_TAG,
176 STRUCT_MEMBER,
177 UNION_MEMBER,
178 BOOL_CONST,
179 ENUM_CONST,
180 ABSTRACT, /* abstract symbol (sizeof, casts, unnamed
181 * argument) */
182 } scl_t;
183
184 /* C23 6.7.4 */
185 typedef enum {
186 FS_INLINE, /* since C99 */
187 FS_NORETURN, /* since C11 */
188 } function_specifier;
189
190 /* A type, variable, keyword; basically anything that has a name. */
191 struct sym {
192 const char *s_name;
193 const char *s_rename; /* renamed symbol's given name */
194 pos_t s_def_pos; /* position of last (prototype) definition,
195 * prototype declaration, no-prototype-def.,
196 * tentative definition or declaration, in this
197 * order */
198 pos_t s_set_pos; /* position of first initialization */
199 pos_t s_use_pos; /* position of first use */
200 symbol_kind s_kind;
201 const struct keyword *s_keyword;
202 bool s_bitfield:1;
203 bool s_set:1;
204 bool s_used:1;
205 bool s_param:1;
206 bool s_register:1;
207 bool s_defparam:1; /* undefined symbol in old-style function
208 * definition */
209 bool s_return_type_implicit_int:1;
210 bool s_osdef:1; /* symbol stems from old-style function def. */
211 bool s_inline:1;
212 sym_t *s_ext_sym; /* for locally declared external symbols, the
213 * pointer to the external symbol with the same
214 * name */
215 def_t s_def; /* declared, tentative defined, defined */
216 scl_t s_scl;
217 int s_block_level; /* level of declaration, -1 if not in symbol
218 * table */
219 type_t *s_type;
220 union {
221 bool s_bool_constant;
222 int s_enum_constant;
223 struct {
224 struct_or_union *sm_containing_type;
225 unsigned int sm_offset_in_bits;
226 } s_member;
227 struct {
228 int sk_token;
229 union {
230 /* if T_TYPE or T_STRUCT_OR_UNION */
231 tspec_t sk_tspec;
232 /* if T_QUAL */
233 type_qualifiers sk_type_qualifier;
234 /* if T_FUNCTION_SPECIFIER */
235 function_specifier function_specifier;
236 } u;
237 } s_keyword;
238 sym_t *s_old_style_params; /* parameters in an old-style
239 * function definition */
240 } u;
241 sym_t *s_symtab_next; /* next symbol in the same symtab bucket */
242 sym_t **s_symtab_ref; /* pointer to s_symtab_next of the previous
243 * symbol */
244 sym_t *s_next; /* next struct/union member, enumerator,
245 * parameter */
246 sym_t *s_level_next; /* next symbol declared on the same level */
247 };
248
249 /*
250 * Used to keep some information about symbols before they are entered
251 * into the symbol table.
252 */
253 typedef struct {
254 const char *sb_name; /* name of symbol */
255 size_t sb_len; /* length (without '\0') */
256 sym_t *sb_sym; /* symbol table entry */
257 } sbuf_t;
258
259
260 typedef struct {
261 struct tnode *func;
262 struct tnode **args;
263 size_t args_len;
264 size_t args_cap;
265 } function_call;
266
267 typedef struct tnode tnode_t;
268
269 /* An expression, forming an abstract syntax tree. */
270 struct tnode {
271 op_t tn_op;
272 type_t *tn_type;
273 bool tn_lvalue:1;
274 bool tn_cast:1; /* if tn_op == CVT, it's an explicit cast */
275 bool tn_parenthesized:1;
276 bool tn_sys:1; /* comes from a system header */
277 bool tn_system_dependent:1; /* depends on sizeof or offsetof */
278 union {
279 struct {
280 tnode_t *_tn_left; /* (left) operand */
281 tnode_t *_tn_right; /* right operand */
282 } tn_s;
283 sym_t *_tn_sym; /* symbol if op == NAME */
284 val_t _tn_val; /* value if op == CON */
285 buffer *_tn_string; /* string if op == STRING; for
286 * character strings, 'data' points to
287 * the concatenated string literals in
288 * source form, and 'len' is the
289 * length of the concatenation; for
290 * wide strings, 'data' is NULL and
291 * 'len' is the number of resulting
292 * characters */
293 function_call *_tn_call;
294 } tn_u;
295 };
296
297 #define tn_left tn_u.tn_s._tn_left
298 #define tn_right tn_u.tn_s._tn_right
299 #define tn_sym tn_u._tn_sym
300 #define tn_val tn_u._tn_val
301 #define tn_string tn_u._tn_string
302 #define tn_call tn_u._tn_call
303
304 struct generic_association {
305 type_t *ga_arg; /* NULL means default or error */
306 tnode_t *ga_result; /* NULL means error */
307 struct generic_association *ga_prev;
308 };
309
310 typedef struct {
311 bool has_dim;
312 int dim;
313 } array_size;
314
315 typedef enum decl_level_kind {
316 DLK_EXTERN, /* global types, variables or functions */
317 DLK_STRUCT, /* struct members */
318 DLK_UNION, /* union members */
319 DLK_ENUM, /* enum constants */
320 DLK_OLD_STYLE_PARAMS, /* parameters in an old-style function
321 * definition */
322 DLK_PROTO_PARAMS, /* parameters in a prototype function
323 * definition */
324 DLK_AUTO, /* local types or variables */
325 DLK_ABSTRACT /* abstract (unnamed) declaration; type name;
326 * used in casts and sizeof */
327 } decl_level_kind;
328
329 /*
330 * A declaration level collects information for a declarator in a struct,
331 * union or enum declaration, a parameter declaration list, or a plain
332 * declaration in or outside a function body.
333 *
334 * For nested declarations, the global 'dcs' holds all information needed for
335 * the current level, the outer levels are available via 'd_enclosing'.
336 */
337 typedef struct decl_level {
338 decl_level_kind d_kind;
339 tspec_t d_abstract_type;/* VOID, BOOL, CHAR, INT or COMPLEX */
340 tspec_t d_complex_mod; /* FLOAT or DOUBLE */
341 tspec_t d_sign_mod; /* SIGNED or UNSIGN */
342 tspec_t d_rank_mod; /* SHORT, LONG or LLONG */
343 scl_t d_scl; /* storage class */
344 type_t *d_type; /* after dcs_end_type, the pointer to the type
345 * used for all declarators */
346 sym_t *d_redeclared_symbol;
347 unsigned int d_sou_size_in_bits; /* size of the structure or
348 * union being built, without
349 * trailing padding */
350 unsigned int d_sou_align_in_bits; /* alignment of the structure
351 * or union being built */
352 type_qualifiers d_qual; /* in declaration specifiers */
353 bool d_inline:1; /* inline in declaration specifiers */
354 bool d_multiple_storage_classes:1; /* reported in dcs_end_type */
355 bool d_invalid_type_combination:1;
356 bool d_nonempty_decl:1; /* in a function declaration, whether at
357 * least one tag was declared */
358 bool d_no_type_specifier:1;
359 bool d_asm:1; /* set if d_ctx == AUTO and asm() present */
360 bool d_packed:1;
361 bool d_used:1;
362 type_t *d_tag_type; /* during a member or enumerator declaration,
363 * the tag type to which the member belongs */
364 sym_t *d_func_params; /* during a function declaration, the
365 * parameters, stored in the enclosing level */
366 pos_t d_func_def_pos; /* position of the function definition */
367 sym_t *d_first_dlsym; /* first symbol declared at this level */
368 sym_t **d_last_dlsym; /* points to s_level_next in the last symbol
369 declaration at this level */
370 sym_t *d_func_proto_syms; /* symbols defined in prototype, such
371 * as tagged types or parameter names,
372 * may overlap d_func_params */
373 struct decl_level *d_enclosing; /* the enclosing declaration level */
374 } decl_level;
375
376 typedef struct {
377 sym_t *first;
378 bool vararg:1;
379 bool prototype:1;
380 } parameter_list;
381
382 /*
383 * A sequence of asterisks and qualifiers, from right to left. For example,
384 * 'const ***volatile **const volatile' results in [c-v-, ----, --v-, ----,
385 * ----]. The leftmost 'const' is not included in this list, it is stored in
386 * dcs->d_qual instead.
387 */
388 typedef struct qual_ptr {
389 type_qualifiers qualifiers;
390 struct qual_ptr *p_next;
391 } qual_ptr;
392
393 /* The values of the 'case' labels. */
394 typedef struct {
395 val_t *vals;
396 size_t len;
397 size_t cap;
398 } case_labels;
399
400 typedef enum {
401 CS_DO_WHILE,
402 CS_FOR,
403 CS_FUNCTION_BODY,
404 CS_IF,
405 CS_SWITCH,
406 CS_WHILE
407 } control_statement_kind;
408
409 /*
410 * Used to keep information about nested control statements.
411 */
412 typedef struct control_statement {
413 control_statement_kind c_kind; /* to ensure proper nesting */
414 bool c_loop:1; /* 'continue' and 'break' are valid */
415 bool c_switch:1; /* 'case' and 'break' are valid */
416 bool c_break:1; /* the loop/switch has a reachable 'break'
417 * statement */
418 bool c_continue:1; /* the loop has a reachable 'continue'
419 * statement */
420 bool c_default:1; /* the switch has a 'default' label */
421 bool c_maybe_endless:1; /* the controlling expression is
422 * always true (as in 'for (;;)' or
423 * 'while (1)'), there may be break
424 * statements though */
425 bool c_always_then:1;
426 bool c_reached_end_of_then:1;
427 bool c_had_return_noval:1; /* had "return;" */
428 bool c_had_return_value:1; /* had "return expr;" */
429
430 type_t *c_switch_type; /* type of switch expression */
431 tnode_t *c_switch_expr;
432 case_labels c_case_labels; /* list of case values */
433
434 memory_pool c_for_expr3_mem; /* saved memory for end of loop
435 * expression in for() */
436 tnode_t *c_for_expr3; /* end of loop expr in for() */
437 pos_t c_for_expr3_pos; /* position of end of loop expr */
438 pos_t c_for_expr3_csrc_pos; /* same for csrc_pos */
439
440 struct control_statement *c_surrounding;
441 } control_statement;
442
443 typedef struct {
444 size_t lo; /* inclusive */
445 size_t hi; /* inclusive */
446 } range_t;
447
448 typedef enum designator_kind {
449 DK_MEMBER, /* .member */
450 DK_SUBSCRIPT, /* [subscript] */
451 DK_SCALAR /* no textual representation, not generated by
452 * the parser; used for scalar initializer
453 * expressions surrounded by braces */
454 } designator_kind;
455
456 /*
457 * A single component on the path from the "current object" of a brace level
458 * to the sub-object that is initialized by an expression.
459 *
460 * C99 6.7.8p6, 6.7.8p7
461 */
462 typedef struct designator {
463 designator_kind dr_kind;
464 const sym_t *dr_member; /* for DK_MEMBER */
465 size_t dr_subscript; /* for DK_SUBSCRIPT */
466 bool dr_done;
467 } designator;
468
469 /*
470 * The path from the "current object" of a brace level to the sub-object that
471 * is initialized by an expression. Examples of designations are '.member'
472 * or '.member[123].member.member[1][1]'.
473 *
474 * C99 6.7.8p6, 6.7.8p7
475 */
476 typedef struct designation {
477 designator *dn_items;
478 size_t dn_len;
479 size_t dn_cap;
480 } designation;
481
482 typedef enum {
483 LC_ARGSUSED,
484 LC_BITFIELDTYPE,
485 LC_CONSTCOND,
486 LC_FALLTHROUGH,
487 LC_LINTLIBRARY,
488 LC_LINTED,
489 LC_LONGLONG,
490 LC_NOTREACHED,
491 LC_PRINTFLIKE,
492 LC_PROTOLIB,
493 LC_SCANFLIKE,
494 LC_VARARGS,
495 } lint_comment;
496
497 typedef struct {
498 size_t start;
499 size_t end;
500 uint64_t value;
501 bool escaped; /* \n, \003, \x24 */
502 bool named_escape; /* \a, \n, etc. */
503 bool literal_escape; /* \?, \\, etc. */
504 uint8_t octal_digits; /* 1 to 3; 0 means not applicable */
505 uint8_t hex_digits; /* 1 to 3; 0 means not applicable */
506 bool next_literal; /* when a new string literal begins */
507 bool invalid_escape; /* single-character escape, recoverable */
508 bool overflow; /* for octal and hex escapes */
509 bool missing_hex_digits;
510 bool unescaped_newline; /* stops iterating */
511 } quoted_iterator;
512
513 #include "externs1.h"
514
515 #define lint_assert(cond) \
516 do { \
517 if (!(cond)) \
518 assert_failed(__FILE__, __LINE__, __func__, #cond); \
519 } while (false)
520
521 #ifdef DEBUG
522 # include "err-msgs.h"
523
524 /* ARGSUSED */
525 static inline void __printflike(1, 2)
526 check_printf(const char *fmt, ...)
527 {
528 }
529
530 # define wrap_check_printf_at(func, msgid, pos, args...) \
531 do { \
532 check_printf(__CONCAT(MSG_, msgid), ##args); \
533 (func)(msgid, pos, ##args); \
534 } while (false)
535
536 # define error_at(msgid, pos, args...) \
537 wrap_check_printf_at(error_at, msgid, pos, ##args)
538 # define warning_at(msgid, pos, args...) \
539 wrap_check_printf_at(warning_at, msgid, pos, ##args)
540 # define message_at(msgid, pos, args...) \
541 wrap_check_printf_at(message_at, msgid, pos, ##args)
542
543 # define wrap_check_printf(func, cond, msgid, args...) \
544 ({ \
545 if (/* CONSTCOND */cond) \
546 debug_step("%s:%d: %s %d '%s' in %s", \
547 __FILE__, __LINE__, #func, msgid, \
548 __CONCAT(MSG_, msgid), __func__); \
549 check_printf(__CONCAT(MSG_, msgid), ##args); \
550 (func)(msgid, ##args); \
551 /* LINTED 129 */ \
552 })
553
554 # define error(msgid, args...) wrap_check_printf(error, \
555 true, msgid, ##args)
556 # define warning(msgid, args...) wrap_check_printf(warning, \
557 true, msgid, ##args)
558 # define gnuism(msgid, args...) wrap_check_printf(gnuism, \
559 !allow_gcc || (!allow_trad && !allow_c99), msgid, ##args)
560 # define c99ism(msgid, args...) wrap_check_printf(c99ism, \
561 !allow_c99 && (!allow_gcc || !allow_trad), msgid, ##args)
562 # define c11ism(msgid, args...) wrap_check_printf(c11ism, \
563 !allow_c11 && !allow_gcc, msgid, ##args)
564 # define c23ism(msgid, args...) wrap_check_printf(c23ism, \
565 !allow_c23, msgid, ##args)
566 #endif
567
568 #ifdef DEBUG
569 # define query_message(query_id, args...) \
570 do { \
571 debug_step("%s:%d: query %d '%s' in %s", \
572 __FILE__, __LINE__, \
573 query_id, __CONCAT(MSG_Q, query_id), __func__); \
574 check_printf(__CONCAT(MSG_Q, query_id), ##args); \
575 (query_message)(query_id, ##args); \
576 } while (false)
577 #else
578 # define query_message(...) \
579 do { \
580 if (any_query_enabled) \
581 (query_message)(__VA_ARGS__); \
582 } while (false)
583 #endif
584
585 /* Copies curr_pos, keeping things unique. */
586 static inline pos_t
587 unique_curr_pos(void)
588 {
589 pos_t curr = curr_pos;
590 curr_pos.p_uniq++;
591 if (curr_pos.p_file == csrc_pos.p_file)
592 csrc_pos.p_uniq++;
593 return curr;
594 }
595
596 static inline bool
597 is_nonzero_val(const val_t *val)
598 {
599 return is_floating(val->v_tspec)
600 ? val->u.floating != 0.0
601 : val->u.integer != 0;
602 }
603
604 static inline bool
605 constant_is_nonzero(const tnode_t *tn)
606 {
607 lint_assert(tn->tn_op == CON);
608 lint_assert(tn->tn_type->t_tspec == tn->tn_val.v_tspec);
609 return is_nonzero_val(&tn->tn_val);
610 }
611
612 static inline bool
613 is_zero(const tnode_t *tn)
614 {
615 return tn != NULL && tn->tn_op == CON && !is_nonzero_val(&tn->tn_val);
616 }
617
618 static inline bool
619 is_nonzero(const tnode_t *tn)
620 {
621 return tn != NULL && tn->tn_op == CON && is_nonzero_val(&tn->tn_val);
622 }
623
624 static inline const char *
625 op_name(op_t op)
626 {
627 return modtab[op].m_name;
628 }
629
630 static inline bool
631 is_binary(const tnode_t *tn)
632 {
633 return modtab[tn->tn_op].m_binary;
634 }
635
636 static inline uint64_t
637 bit(unsigned i)
638 {
639 /*
640 * TODO: Add proper support for INT128. This involves changing val_t to
641 * 128 bits.
642 */
643 if (i >= 64)
644 return 0; /* XXX: not correct for INT128 and UINT128 */
645
646 lint_assert(i < 64);
647 return (uint64_t)1 << i;
648 }
649
650 static inline bool
651 msb(int64_t si, tspec_t t)
652 {
653 return ((uint64_t)si & bit(size_in_bits(t) - 1)) != 0;
654 }
655
656 static inline uint64_t
657 value_bits(unsigned bitsize)
658 {
659 lint_assert(bitsize > 0);
660
661 /* for long double (80 or 128), double _Complex (128) */
662 /*
663 * XXX: double _Complex does not have 128 bits of precision, therefore
664 * it should never be necessary to query the value bits of such a type;
665 * see d_c99_complex_split.c to trigger this case.
666 */
667 if (bitsize >= 64)
668 return ~(uint64_t)0;
669
670 return ~(~(uint64_t)0 << bitsize);
671 }
672
673 /* C99 6.7.8p7 */
674 static inline bool
675 is_struct_or_union(tspec_t t)
676 {
677 return t == STRUCT || t == UNION;
678 }
679
680 static inline bool
681 is_member(const sym_t *sym)
682 {
683 return sym->s_scl == STRUCT_MEMBER || sym->s_scl == UNION_MEMBER;
684 }
685
686 static inline void
687 set_sym_kind(symbol_kind kind)
688 {
689 if (yflag)
690 debug_step("%s: %s -> %s", __func__,
691 symbol_kind_name(sym_kind), symbol_kind_name(kind));
692 sym_kind = kind;
693 }
694