4 * Copyright (C) 2003 Transmeta Corp.
7 * Licensed under the Open Software License version 1.1
9 * Print out results of parsing for debugging and testing.
24 #include "expression.h"
27 static int show_symbol_expr(struct symbol
*sym
);
29 static void do_debug_symbol(struct symbol
*sym
, int indent
)
31 static const char indent_string
[] = " ";
32 static const char *typestr
[] = {
33 "base", "node", "ptr.", "fn..",
34 "arry", "strt", "unin", "enum",
35 "tdef", "tpof", "memb", "bitf",
41 fprintf(stderr
, "%.*s%s%3d:%lu %lx %s (as: %d, context: %x:%x) %p (%s:%d:%d)\n",
42 indent
, indent_string
, typestr
[sym
->type
],
43 sym
->bit_size
, sym
->ctype
.alignment
,
44 sym
->ctype
.modifiers
, show_ident(sym
->ident
),
45 sym
->ctype
.as
, sym
->ctype
.context
, sym
->ctype
.contextmask
,
46 sym
, input_streams
[sym
->pos
.stream
].name
, sym
->pos
.line
, sym
->pos
.pos
);
47 if (sym
->type
== SYM_FN
) {
50 FOR_EACH_PTR(sym
->arguments
, arg
) {
51 fprintf(stderr
, "< arg%d:\n", i
);
52 do_debug_symbol(arg
, 0);
53 fprintf(stderr
, " end arg%d >\n", i
);
57 do_debug_symbol(sym
->ctype
.base_type
, indent
+2);
60 void debug_symbol(struct symbol
*sym
)
62 do_debug_symbol(sym
, 0);
66 * Symbol type printout. The type system is by far the most
67 * complicated part of C - everything else is trivial.
69 const char *modifier_string(unsigned long mod
)
71 static char buffer
[100];
73 const char *res
,**ptr
, *names
[] = {
74 "auto", "register", "static", "extern",
75 "const", "volatile", "[signed]", "[unsigned]",
76 "[char]", "[short]", "[long]", "[long]",
77 "[typdef]", "[structof]", "[unionof]", "[enum]",
78 "[typeof]", "[attribute]", "inline", "[addressable]",
79 "[nocast]", "[noderef]", "[accessed]", "[toplevel]",
80 "[label]", "[assigned]", "[type]", "[safe]",
81 "[usertype]", "[force]",
85 while ((res
= *ptr
++) != NULL
) {
88 while ((c
= *res
++) != '\0')
98 void show_struct_member(struct symbol
*sym
, void *data
, int flags
)
100 if (flags
& ITERATE_FIRST
)
102 printf("%s:%d:%ld at offset %ld", show_ident(sym
->ident
), sym
->bit_size
, sym
->ctype
.alignment
, sym
->offset
);
104 printf("[%d..%d]", sym
->bit_offset
, sym
->bit_offset
+sym
->fieldwidth
-1);
105 if (flags
& ITERATE_LAST
)
111 static void show_one_symbol(struct symbol
*sym
, void *sep
, int flags
)
114 if (!(flags
& ITERATE_LAST
))
115 printf("%s", (const char *)sep
);
118 void show_symbol_list(struct symbol_list
*list
, const char *sep
)
120 symbol_iterate(list
, show_one_symbol
, (void *)sep
);
128 static void prepend(struct type_name
*name
, const char *fmt
, ...)
130 static char buffer
[512];
135 n
= vsprintf(buffer
, fmt
, args
);
139 memcpy(name
->start
, buffer
, n
);
142 static void append(struct type_name
*name
, const char *fmt
, ...)
144 static char buffer
[512];
149 n
= vsprintf(buffer
, fmt
, args
);
152 memcpy(name
->end
, buffer
, n
);
156 static void do_show_type(struct symbol
*sym
, struct type_name
*name
)
160 static struct ctype_name
{
164 { & char_ctype
, "char" },
165 { &uchar_ctype
, "unsigned char" },
166 { & short_ctype
, "short" },
167 { &ushort_ctype
, "unsigned short" },
168 { & int_ctype
, "int" },
169 { &uint_ctype
, "unsigned int" },
170 { & long_ctype
, "long" },
171 { &ulong_ctype
, "unsigned long" },
172 { & llong_ctype
, "long long" },
173 { &ullong_ctype
, "unsigned long long" },
175 { &void_ctype
, "void" },
176 { &bool_ctype
, "bool" },
177 { &string_ctype
, "string" },
179 { &float_ctype
, "float" },
180 { &double_ctype
, "double" },
181 { &ldouble_ctype
,"long double" },
182 { &incomplete_ctype
, "incomplete type" },
188 for (i
= 0; i
< sizeof(typenames
)/sizeof(typenames
[0]); i
++) {
189 if (typenames
[i
].sym
== sym
) {
190 int len
= strlen(typenames
[i
].name
);
191 *--name
->start
= ' ';
193 memcpy(name
->start
, typenames
[i
].name
, len
);
207 prepend(name
, "struct %s ", show_ident(sym
->ident
));
211 prepend(name
, "union %s ", show_ident(sym
->ident
));
215 prepend(name
, "enum %s ", show_ident(sym
->ident
));
219 append(name
, "%s", show_ident(sym
->ident
));
223 append(name
, ":%d", sym
->fieldwidth
);
227 append(name
, "label(%s:%p)", show_ident(sym
->ident
), sym
);
234 prepend(name
, "unknown type %d", sym
->type
);
238 mod
= modifier_string(sym
->ctype
.modifiers
);
239 modlen
= strlen(mod
);
240 name
->start
-= modlen
;
241 memcpy(name
->start
, mod
, modlen
);
243 do_show_type(sym
->ctype
.base_type
, name
);
247 append(name
, "<asn:%d>", sym
->ctype
.as
);
254 append(name
, " )( ... )");
258 append(name
, "[%lld]", get_expression_value(sym
->array_size
));
265 void show_type(struct symbol
*sym
)
268 struct type_name name
;
270 name
.start
= name
.end
= array
+100;
271 do_show_type(sym
, &name
);
273 printf("%s", name
.start
);
276 const char *show_typename(struct symbol
*sym
)
278 static char array
[200];
279 struct type_name name
;
281 name
.start
= name
.end
= array
+100;
282 do_show_type(sym
, &name
);
287 void show_symbol(struct symbol
*sym
)
294 if (sym
->ctype
.alignment
)
295 printf(".align %ld\n", sym
->ctype
.alignment
);
298 type
= sym
->ctype
.base_type
;
303 * Show actual implementation information
305 switch (type
->type
) {
307 symbol_iterate(type
->symbol_list
, show_struct_member
, NULL
);
311 symbol_iterate(type
->symbol_list
, show_struct_member
, NULL
);
315 struct statement
*stmt
= type
->stmt
;
319 val
= show_statement(stmt
);
321 printf("\tmov.%d\t\tretval,%d\n", stmt
->ret
->bit_size
, val
);
331 if (sym
->initializer
) {
333 show_expression(sym
->initializer
);
337 static int show_symbol_init(struct symbol
*sym
);
339 static int new_pseudo(void)
345 static int new_label(void)
347 static int label
= 0;
351 static void show_switch_statement(struct statement
*stmt
)
353 int val
= show_expression(stmt
->switch_expression
);
355 printf("\tswitch v%d\n", val
);
358 * Debugging only: Check that the case list is correct
359 * by printing it out.
361 * This is where a _real_ back-end would go through the
362 * cases to decide whether to use a lookup table or a
363 * series of comparisons etc
365 printf("# case table:\n");
366 FOR_EACH_PTR(stmt
->switch_case
->symbol_list
, sym
) {
367 struct statement
*case_stmt
= sym
->stmt
;
368 struct expression
*expr
= case_stmt
->case_expression
;
369 struct expression
*to
= case_stmt
->case_to
;
374 if (expr
->type
== EXPR_VALUE
) {
375 printf(" case %lld", expr
->value
);
377 if (to
->type
== EXPR_VALUE
) {
378 printf(" .. %lld", to
->value
);
386 printf(": .L%p\n", sym
->bb_target
);
388 printf("# end case table\n");
390 show_statement(stmt
->switch_statement
);
392 if (stmt
->switch_break
->used
)
393 printf(".L%p:\n", stmt
->switch_break
->bb_target
);
396 static void show_symbol_decl(struct symbol_list
*syms
)
399 FOR_EACH_PTR(syms
, sym
) {
400 show_symbol_init(sym
);
404 static int show_return_stmt(struct statement
*stmt
);
407 * Print out a statement
409 int show_statement(struct statement
*stmt
)
413 switch (stmt
->type
) {
415 return show_return_stmt(stmt
);
416 case STMT_COMPOUND
: {
420 show_symbol_decl(stmt
->syms
);
421 FOR_EACH_PTR(stmt
->stmts
, s
) {
422 last
= show_statement(s
);
426 printf(".L%p:\n", stmt
->ret
);
427 addr
= show_symbol_expr(stmt
->ret
);
428 bits
= stmt
->ret
->bit_size
;
430 printf("\tld.%d\t\tv%d,[v%d]\n", bits
, last
, addr
);
435 case STMT_EXPRESSION
:
436 return show_expression(stmt
->expression
);
439 struct expression
*cond
= stmt
->if_conditional
;
441 /* This is only valid if nobody can jump into the "dead" statement */
443 if (cond
->type
== EXPR_VALUE
) {
444 struct statement
*s
= stmt
->if_true
;
451 val
= show_expression(cond
);
452 target
= new_label();
453 printf("\tje\t\tv%d,.L%d\n", val
, target
);
454 show_statement(stmt
->if_true
);
455 if (stmt
->if_false
) {
456 int last
= new_label();
457 printf("\tjmp\t\t.L%d\n", last
);
458 printf(".L%d:\n", target
);
460 show_statement(stmt
->if_false
);
462 printf(".L%d:\n", target
);
466 show_switch_statement(stmt
);
470 printf(".L%p:\n", stmt
->case_label
);
471 show_statement(stmt
->case_statement
);
474 case STMT_ITERATOR
: {
475 struct statement
*pre_statement
= stmt
->iterator_pre_statement
;
476 struct expression
*pre_condition
= stmt
->iterator_pre_condition
;
477 struct statement
*statement
= stmt
->iterator_statement
;
478 struct statement
*post_statement
= stmt
->iterator_post_statement
;
479 struct expression
*post_condition
= stmt
->iterator_post_condition
;
480 int val
, loop_top
= 0, loop_bottom
= 0;
482 show_symbol_decl(stmt
->iterator_syms
);
483 show_statement(pre_statement
);
485 if (pre_condition
->type
== EXPR_VALUE
) {
486 if (!pre_condition
->value
) {
487 loop_bottom
= new_label();
488 printf("\tjmp\t\t.L%d\n", loop_bottom
);
491 loop_bottom
= new_label();
492 val
= show_expression(pre_condition
);
493 printf("\tje\t\tv%d, .L%d\n", val
, loop_bottom
);
496 if (!post_condition
|| post_condition
->type
!= EXPR_VALUE
|| post_condition
->value
) {
497 loop_top
= new_label();
498 printf(".L%d:\n", loop_top
);
500 show_statement(statement
);
501 if (stmt
->iterator_continue
->used
)
502 printf(".L%p:\n", stmt
->iterator_continue
);
503 show_statement(post_statement
);
504 if (!post_condition
) {
505 printf("\tjmp\t\t.L%d\n", loop_top
);
506 } else if (post_condition
->type
== EXPR_VALUE
) {
507 if (post_condition
->value
)
508 printf("\tjmp\t\t.L%d\n", loop_top
);
510 val
= show_expression(post_condition
);
511 printf("\tjne\t\tv%d, .L%d\n", val
, loop_top
);
513 if (stmt
->iterator_break
->used
)
514 printf(".L%p:\n", stmt
->iterator_break
);
516 printf(".L%d:\n", loop_bottom
);
523 printf(".L%p:\n", stmt
->label_identifier
);
524 show_statement(stmt
->label_statement
);
528 if (stmt
->goto_expression
) {
529 int val
= show_expression(stmt
->goto_expression
);
530 printf("\tgoto\t\t*v%d\n", val
);
532 printf("\tgoto\t\t.L%p\n", stmt
->goto_label
->bb_target
);
536 printf("\tasm( .... )\n");
543 static void show_one_statement(struct statement
*stmt
, void *sep
, int flags
)
545 show_statement(stmt
);
546 if (!(flags
& ITERATE_LAST
))
547 printf("%s", (const char *)sep
);
550 void show_statement_list(struct statement_list
*stmt
, const char *sep
)
552 statement_iterate(stmt
, show_one_statement
, (void *)sep
);
555 static void show_one_expression(struct expression
*expr
, void *sep
, int flags
)
557 show_expression(expr
);
558 if (!(flags
& ITERATE_LAST
))
559 printf("%s", (const char *)sep
);
562 void show_expression_list(struct expression_list
*list
, const char *sep
)
564 expression_iterate(list
, show_one_expression
, (void *)sep
);
567 static int show_call_expression(struct expression
*expr
)
569 struct symbol
*direct
;
570 struct expression
*arg
, *fn
;
575 warn(expr
->pos
, "\tcall with no type!");
580 FOR_EACH_PTR_REVERSE(expr
->args
, arg
) {
581 int new = show_expression(arg
);
582 int size
= arg
->ctype
->bit_size
;
583 printf("\tpush.%d\t\tv%d\n", size
, new);
584 framesize
+= size
>> 3;
585 } END_FOR_EACH_PTR_REVERSE
;
589 /* Remove dereference, if any */
591 if (fn
->type
== EXPR_PREOP
) {
592 if (fn
->unop
->type
== EXPR_SYMBOL
) {
593 struct symbol
*sym
= fn
->unop
->symbol
;
594 if (sym
->ctype
.base_type
->type
== SYM_FN
)
599 printf("\tcall\t\t%s\n", show_ident(direct
->ident
));
601 fncall
= show_expression(fn
);
602 printf("\tcall\t\t*v%d\n", fncall
);
605 printf("\tadd.%d\t\tvSP,vSP,$%d\n", bits_in_pointer
, framesize
);
607 retval
= new_pseudo();
608 printf("\tmov.%d\t\tv%d,retval\n", expr
->ctype
->bit_size
, retval
);
612 static int show_binop(struct expression
*expr
)
614 int left
= show_expression(expr
->left
);
615 int right
= show_expression(expr
->right
);
616 int new = new_pseudo();
618 static const char *name
[] = {
619 ['+'] = "add", ['-'] = "sub",
620 ['*'] = "mul", ['/'] = "div",
621 ['%'] = "mod", ['&'] = "and",
622 ['|'] = "lor", ['^'] = "xor"
624 unsigned int op
= expr
->op
;
626 opname
= show_special(op
);
627 if (op
< sizeof(name
)/sizeof(*name
))
629 printf("\t%s.%d\t\tv%d,v%d,v%d\n", opname
,
630 expr
->ctype
->bit_size
,
635 static int show_regular_preop(struct expression
*expr
)
637 int target
= show_expression(expr
->unop
);
638 int new = new_pseudo();
639 static const char *name
[] = {
640 ['!'] = "nonzero", ['-'] = "neg",
643 unsigned int op
= expr
->op
;
646 opname
= show_special(op
);
647 if (op
< sizeof(name
)/sizeof(*name
))
649 printf("\t%s.%d\t\tv%d,v%d\n", opname
, expr
->ctype
->bit_size
, new, target
);
654 * FIXME! Not all accesses are memory loads. We should
655 * check what kind of symbol is behind the dereference.
657 static int show_address_gen(struct expression
*expr
)
659 if (expr
->type
== EXPR_PREOP
)
660 return show_expression(expr
->unop
);
661 return show_expression(expr
->address
);
664 static int show_load_gen(int bits
, struct expression
*expr
, int addr
)
666 int new = new_pseudo();
668 printf("\tld.%d\t\tv%d,[v%d]\n", bits
, new, addr
);
669 if (expr
->type
== EXPR_PREOP
)
674 printf("\tshr.%d\t\tv%d,v%d,$%d\n", bits
, new, new, expr
->bitpos
);
675 printf("\tandi.%d\t\tv%d,v%d,$%llu\n", bits
, new, new, (1ULL << expr
->nrbits
)-1);
679 static void show_store_gen(int bits
, int value
, struct expression
*expr
, int addr
)
681 /* FIXME!!! Bitfield store! */
682 printf("\tst.%d\t\tv%d,[v%d]\n", bits
, value
, addr
);
685 static int show_assignment(struct expression
*expr
)
687 struct expression
*target
= expr
->left
;
693 bits
= expr
->ctype
->bit_size
;
694 val
= show_expression(expr
->right
);
695 addr
= show_address_gen(target
);
696 show_store_gen(bits
, val
, target
, addr
);
700 static int show_return_stmt(struct statement
*stmt
)
702 struct expression
*expr
= stmt
->ret_value
;
703 struct symbol
*target
= stmt
->ret_target
;
705 if (expr
&& expr
->ctype
) {
706 int val
= show_expression(expr
);
707 int bits
= expr
->ctype
->bit_size
;
708 int addr
= show_symbol_expr(target
);
709 show_store_gen(bits
, val
, NULL
, addr
);
711 printf("\tret\t\t(%p)\n", target
);
715 static int show_initialization(struct symbol
*sym
, struct expression
*expr
)
722 bits
= expr
->ctype
->bit_size
;
723 val
= show_expression(expr
);
724 addr
= show_symbol_expr(sym
);
725 // FIXME! The "target" expression is for bitfield store information.
726 // Leave it NULL, which works fine.
727 show_store_gen(bits
, val
, NULL
, addr
);
731 static int show_access(struct expression
*expr
)
733 int addr
= show_address_gen(expr
);
734 return show_load_gen(expr
->ctype
->bit_size
, expr
, addr
);
737 static int show_inc_dec(struct expression
*expr
, int postop
)
739 int addr
= show_address_gen(expr
->unop
);
741 const char *opname
= expr
->op
== SPECIAL_INCREMENT
? "add" : "sub";
742 int bits
= expr
->ctype
->bit_size
;
744 retval
= show_load_gen(bits
, expr
->unop
, addr
);
748 printf("\t%s.%d\t\tv%d,v%d,$1\n", opname
, bits
, new, retval
);
749 show_store_gen(bits
, new, expr
->unop
, addr
);
753 static int show_preop(struct expression
*expr
)
756 * '*' is an lvalue access, and is fundamentally different
757 * from an arithmetic operation. Maybe it should have an
758 * expression type of its own..
761 return show_access(expr
);
762 if (expr
->op
== SPECIAL_INCREMENT
|| expr
->op
== SPECIAL_DECREMENT
)
763 return show_inc_dec(expr
, 0);
764 return show_regular_preop(expr
);
767 static int show_postop(struct expression
*expr
)
769 return show_inc_dec(expr
, 1);
772 static int show_symbol_expr(struct symbol
*sym
)
774 int new = new_pseudo();
776 if (sym
->ctype
.modifiers
& (MOD_TOPLEVEL
| MOD_EXTERN
| MOD_STATIC
)) {
777 printf("\tmovi.%d\t\tv%d,$%s\n", bits_in_pointer
, new, show_ident(sym
->ident
));
780 if (sym
->ctype
.modifiers
& MOD_ADDRESSABLE
) {
781 printf("\taddi.%d\t\tv%d,vFP,$%lld\n", bits_in_pointer
, new, sym
->value
);
784 printf("\taddi.%d\t\tv%d,vFP,$offsetof(%s:%p)\n", bits_in_pointer
, new, show_ident(sym
->ident
), sym
);
788 static int show_symbol_init(struct symbol
*sym
)
790 struct expression
*expr
= sym
->initializer
;
795 bits
= expr
->ctype
->bit_size
;
796 val
= show_expression(expr
);
797 addr
= show_symbol_expr(sym
);
798 show_store_gen(bits
, val
, NULL
, addr
);
803 static int type_is_signed(struct symbol
*sym
)
805 if (sym
->type
== SYM_NODE
)
806 sym
= sym
->ctype
.base_type
;
807 if (sym
->type
== SYM_PTR
)
809 return !(sym
->ctype
.modifiers
& MOD_UNSIGNED
);
812 static int show_cast_expr(struct expression
*expr
)
814 struct symbol
*old_type
, *new_type
;
815 int op
= show_expression(expr
->cast_expression
);
816 int oldbits
, newbits
;
819 old_type
= expr
->cast_expression
->ctype
;
820 new_type
= expr
->cast_type
;
822 oldbits
= old_type
->bit_size
;
823 newbits
= new_type
->bit_size
;
824 if (oldbits
>= newbits
)
827 is_signed
= type_is_signed(old_type
);
829 printf("\tsext%d.%d\tv%d,v%d\n", oldbits
, newbits
, new, op
);
831 printf("\tandl.%d\t\tv%d,v%d,$%lu\n", newbits
, new, op
, (1UL << oldbits
)-1);
836 static int show_value(struct expression
*expr
)
838 int new = new_pseudo();
839 unsigned long long value
= expr
->value
;
841 printf("\tmovi.%d\t\tv%d,$%llu\n", expr
->ctype
->bit_size
, new, value
);
845 static int show_fvalue(struct expression
*expr
)
847 int new = new_pseudo();
848 long double value
= expr
->fvalue
;
850 printf("\tmovf.%d\t\tv%d,$%Lf\n", expr
->ctype
->bit_size
, new, value
);
854 static int show_string_expr(struct expression
*expr
)
856 int new = new_pseudo();
858 printf("\tmovi.%d\t\tv%d,&%s\n", bits_in_pointer
, new, show_string(expr
->string
));
862 static int show_bitfield_expr(struct expression
*expr
)
864 return show_access(expr
);
867 int show_label_expr(struct expression
*expr
)
869 int new = new_pseudo();
870 printf("\tmovi.%d\t\tv%d,.L%p\n",bits_in_pointer
, new, expr
->label_symbol
);
874 static int show_conditional_expr(struct expression
*expr
)
876 int cond
= show_expression(expr
->conditional
);
877 int true = show_expression(expr
->cond_true
);
878 int false = show_expression(expr
->cond_false
);
879 int new = new_pseudo();
883 printf("[v%d]\tcmov.%d\t\tv%d,v%d,v%d\n", cond
, expr
->ctype
->bit_size
, new, true, false);
887 static int show_statement_expr(struct expression
*expr
)
889 return show_statement(expr
->statement
);
892 static int show_position_expr(struct expression
*expr
, struct symbol
*base
)
894 int new = show_expression(expr
->init_expr
);
895 struct symbol
*ctype
= expr
->init_sym
;
897 printf("\tinsert v%d at [%d:%d] of %s\n", new,
898 expr
->init_offset
, ctype
->bit_offset
,
899 show_ident(base
->ident
));
903 static int show_initializer_expr(struct expression
*expr
, struct symbol
*ctype
)
905 struct expression
*entry
;
907 FOR_EACH_PTR(expr
->expr_list
, entry
) {
908 // Nested initializers have their positions already
909 // recursively calculated - just output them too
910 if (entry
->type
== EXPR_INITIALIZER
) {
911 show_initializer_expr(entry
, ctype
);
915 // Ignore initializer indexes and identifiers - the
916 // evaluator has taken them into account
917 if (entry
->type
== EXPR_IDENTIFIER
|| entry
->type
== EXPR_INDEX
)
919 if (entry
->type
== EXPR_POS
) {
920 show_position_expr(entry
, ctype
);
923 show_initialization(ctype
, entry
);
928 int show_symbol_expr_init(struct symbol
*sym
)
930 struct expression
*expr
= sym
->initializer
;
933 show_expression(expr
);
934 return show_symbol_expr(sym
);
938 * Print out an expression. Return the pseudo that contains the
941 int show_expression(struct expression
*expr
)
947 struct position
*pos
= &expr
->pos
;
948 printf("\tno type at %s:%d:%d\n",
949 input_streams
[pos
->stream
].name
,
950 pos
->line
, pos
->pos
);
954 switch (expr
->type
) {
956 return show_call_expression(expr
);
958 case EXPR_ASSIGNMENT
:
959 return show_assignment(expr
);
965 return show_binop(expr
);
967 return show_preop(expr
);
969 return show_postop(expr
);
971 return show_symbol_expr(expr
->symbol
);
975 warn(expr
->pos
, "invalid expression after evaluation");
978 return show_cast_expr(expr
);
980 return show_value(expr
);
982 return show_fvalue(expr
);
984 return show_string_expr(expr
);
986 return show_bitfield_expr(expr
);
987 case EXPR_INITIALIZER
:
988 return show_initializer_expr(expr
, expr
->ctype
);
989 case EXPR_CONDITIONAL
:
990 return show_conditional_expr(expr
);
992 return show_statement_expr(expr
);
994 return show_label_expr(expr
);
996 // None of these should exist as direct expressions: they are only
997 // valid as sub-expressions of initializers.
999 warn(expr
->pos
, "unable to show plain initializer position expression");
1001 case EXPR_IDENTIFIER
:
1002 warn(expr
->pos
, "unable to show identifier expression");
1005 warn(expr
->pos
, "unable to show index expression");
1008 warn(expr
->pos
, "unable to show type expression");