4 * Copyright (C) 2003 Transmeta Corp.
5 * 2003-2004 Linus Torvalds
7 * Licensed under the Open Software License version 1.1
9 * Print out results of parsing for debugging and testing.
25 #include "expression.h"
28 static int show_symbol_expr(struct symbol
*sym
);
29 static int show_string_expr(struct expression
*expr
);
31 static void do_debug_symbol(struct symbol
*sym
, int indent
)
33 static const char indent_string
[] = " ";
34 static const char *typestr
[] = {
35 [SYM_UNINITIALIZED
] = "none",
36 [SYM_PREPROCESSOR
] = "cpp.",
37 [SYM_BASETYPE
] = "base",
42 [SYM_STRUCT
] = "strt",
45 [SYM_TYPEDEF
] = "tdef",
46 [SYM_TYPEOF
] = "tpof",
47 [SYM_MEMBER
] = "memb",
48 [SYM_BITFIELD
] = "bitf",
50 [SYM_RESTRICT
] = "rstr",
56 fprintf(stderr
, "%.*s%s%3d:%lu %lx %s (as: %d, context: %x:%x) %p (%s:%d:%d)\n",
57 indent
, indent_string
, typestr
[sym
->type
],
58 sym
->bit_size
, sym
->ctype
.alignment
,
59 sym
->ctype
.modifiers
, show_ident(sym
->ident
),
60 sym
->ctype
.as
, sym
->ctype
.in_context
, sym
->ctype
.out_context
,
61 sym
, stream_name(sym
->pos
.stream
), sym
->pos
.line
, sym
->pos
.pos
);
62 if (sym
->type
== SYM_FN
) {
65 FOR_EACH_PTR(sym
->arguments
, arg
) {
66 fprintf(stderr
, "< arg%d:\n", i
);
67 do_debug_symbol(arg
, 0);
68 fprintf(stderr
, " end arg%d >\n", i
);
70 } END_FOR_EACH_PTR(arg
);
72 do_debug_symbol(sym
->ctype
.base_type
, indent
+2);
75 void debug_symbol(struct symbol
*sym
)
77 do_debug_symbol(sym
, 0);
81 * Symbol type printout. The type system is by far the most
82 * complicated part of C - everything else is trivial.
84 const char *modifier_string(unsigned long mod
)
86 static char buffer
[100];
88 const char *res
,**ptr
, *names
[] = {
89 "auto", "register", "static", "extern",
90 "const", "volatile", "[signed]", "[unsigned]",
91 "[char]", "[short]", "[long]", "[long]",
92 "[typdef]", "[structof]", "[unionof]", "[enum]",
93 "[typeof]", "[attribute]", "inline", "[addressable]",
94 "[nocast]", "[noderef]", "[accessed]", "[toplevel]",
95 "[label]", "[assigned]", "[type]", "[safe]",
96 "[usertype]", "[force]", "[explicitly-signed]",
100 while ((res
= *ptr
++) != NULL
) {
103 while ((c
= *res
++) != '\0')
113 void show_struct_member(struct symbol
*sym
)
115 printf("\t%s:%d:%ld at offset %ld.%d", show_ident(sym
->ident
), sym
->bit_size
, sym
->ctype
.alignment
, sym
->offset
, sym
->bit_offset
);
119 void show_symbol_list(struct symbol_list
*list
, const char *sep
)
122 const char *prepend
= "";
124 FOR_EACH_PTR(list
, sym
) {
128 } END_FOR_EACH_PTR(sym
);
136 static void prepend(struct type_name
*name
, const char *fmt
, ...)
138 static char buffer
[512];
143 n
= vsprintf(buffer
, fmt
, args
);
147 memcpy(name
->start
, buffer
, n
);
150 static void append(struct type_name
*name
, const char *fmt
, ...)
152 static char buffer
[512];
157 n
= vsprintf(buffer
, fmt
, args
);
160 memcpy(name
->end
, buffer
, n
);
164 static void do_show_type(struct symbol
*sym
, struct type_name
*name
)
168 static struct ctype_name
{
172 { & char_ctype
, "char" },
173 { &schar_ctype
, "signed char" },
174 { &uchar_ctype
, "unsigned char" },
175 { & short_ctype
, "short" },
176 { &sshort_ctype
, "signed short" },
177 { &ushort_ctype
, "unsigned short" },
178 { & int_ctype
, "int" },
179 { &sint_ctype
, "signed int" },
180 { &uint_ctype
, "unsigned int" },
181 { &slong_ctype
, "signed long" },
182 { & long_ctype
, "long" },
183 { &ulong_ctype
, "unsigned long" },
184 { & llong_ctype
, "long long" },
185 { &sllong_ctype
, "signed long long" },
186 { &ullong_ctype
, "unsigned long long" },
188 { &void_ctype
, "void" },
189 { &bool_ctype
, "bool" },
190 { &string_ctype
, "string" },
192 { &float_ctype
, "float" },
193 { &double_ctype
, "double" },
194 { &ldouble_ctype
,"long double" },
195 { &incomplete_ctype
, "incomplete type" },
196 { &label_ctype
, "label type" },
197 { &bad_ctype
, "bad type" },
203 for (i
= 0; i
< sizeof(typenames
)/sizeof(typenames
[0]); i
++) {
204 if (typenames
[i
].sym
== sym
) {
205 int len
= strlen(typenames
[i
].name
);
206 *--name
->start
= ' ';
208 memcpy(name
->start
, typenames
[i
].name
, len
);
222 prepend(name
, "struct %s ", show_ident(sym
->ident
));
226 prepend(name
, "union %s ", show_ident(sym
->ident
));
230 prepend(name
, "enum %s ", show_ident(sym
->ident
));
234 append(name
, "%s", show_ident(sym
->ident
));
238 append(name
, ":%d", sym
->bit_size
);
242 append(name
, "label(%s:%p)", show_ident(sym
->ident
), sym
);
252 prepend(name
, "unknown type %d", sym
->type
);
256 mod
= modifier_string(sym
->ctype
.modifiers
);
257 modlen
= strlen(mod
);
258 name
->start
-= modlen
;
259 memcpy(name
->start
, mod
, modlen
);
261 do_show_type(sym
->ctype
.base_type
, name
);
265 append(name
, "<asn:%d>", sym
->ctype
.as
);
272 append(name
, " )( ... )");
276 append(name
, "[%lld]", get_expression_value(sym
->array_size
));
280 prepend(name
, "restricted ");
288 void show_type(struct symbol
*sym
)
291 struct type_name name
;
293 name
.start
= name
.end
= array
+100;
294 do_show_type(sym
, &name
);
296 printf("%s", name
.start
);
299 const char *show_typename(struct symbol
*sym
)
301 static char array
[200];
302 struct type_name name
;
304 name
.start
= name
.end
= array
+100;
305 do_show_type(sym
, &name
);
310 void show_symbol(struct symbol
*sym
)
317 if (sym
->ctype
.alignment
)
318 printf(".align %ld\n", sym
->ctype
.alignment
);
321 type
= sym
->ctype
.base_type
;
326 * Show actual implementation information
328 switch (type
->type
) {
329 struct symbol
*member
;
334 FOR_EACH_PTR(type
->symbol_list
, member
) {
335 show_struct_member(member
);
336 } END_FOR_EACH_PTR(member
);
341 struct statement
*stmt
= type
->stmt
;
345 val
= show_statement(stmt
);
347 printf("\tmov.%d\t\tretval,%d\n", stmt
->ret
->bit_size
, val
);
357 if (sym
->initializer
) {
359 show_expression(sym
->initializer
);
363 static int show_symbol_init(struct symbol
*sym
);
365 static int new_pseudo(void)
371 static int new_label(void)
373 static int label
= 0;
377 static void show_switch_statement(struct statement
*stmt
)
379 int val
= show_expression(stmt
->switch_expression
);
381 printf("\tswitch v%d\n", val
);
384 * Debugging only: Check that the case list is correct
385 * by printing it out.
387 * This is where a _real_ back-end would go through the
388 * cases to decide whether to use a lookup table or a
389 * series of comparisons etc
391 printf("# case table:\n");
392 FOR_EACH_PTR(stmt
->switch_case
->symbol_list
, sym
) {
393 struct statement
*case_stmt
= sym
->stmt
;
394 struct expression
*expr
= case_stmt
->case_expression
;
395 struct expression
*to
= case_stmt
->case_to
;
400 if (expr
->type
== EXPR_VALUE
) {
401 printf(" case %lld", expr
->value
);
403 if (to
->type
== EXPR_VALUE
) {
404 printf(" .. %lld", to
->value
);
412 printf(": .L%p\n", sym
->bb_target
);
413 } END_FOR_EACH_PTR(sym
);
414 printf("# end case table\n");
416 show_statement(stmt
->switch_statement
);
418 if (stmt
->switch_break
->used
)
419 printf(".L%p:\n", stmt
->switch_break
->bb_target
);
422 static void show_symbol_decl(struct symbol_list
*syms
)
425 FOR_EACH_PTR(syms
, sym
) {
426 show_symbol_init(sym
);
427 } END_FOR_EACH_PTR(sym
);
430 static int show_return_stmt(struct statement
*stmt
);
433 * Print out a statement
435 int show_statement(struct statement
*stmt
)
439 switch (stmt
->type
) {
441 return show_return_stmt(stmt
);
442 case STMT_COMPOUND
: {
446 show_symbol_decl(stmt
->syms
);
447 FOR_EACH_PTR(stmt
->stmts
, s
) {
448 last
= show_statement(s
);
449 } END_FOR_EACH_PTR(s
);
452 printf(".L%p:\n", stmt
->ret
);
453 addr
= show_symbol_expr(stmt
->ret
);
454 bits
= stmt
->ret
->bit_size
;
456 printf("\tld.%d\t\tv%d,[v%d]\n", bits
, last
, addr
);
461 case STMT_EXPRESSION
:
462 return show_expression(stmt
->expression
);
465 struct expression
*cond
= stmt
->if_conditional
;
467 /* This is only valid if nobody can jump into the "dead" statement */
469 if (cond
->type
== EXPR_VALUE
) {
470 struct statement
*s
= stmt
->if_true
;
477 val
= show_expression(cond
);
478 target
= new_label();
479 printf("\tje\t\tv%d,.L%d\n", val
, target
);
480 show_statement(stmt
->if_true
);
481 if (stmt
->if_false
) {
482 int last
= new_label();
483 printf("\tjmp\t\t.L%d\n", last
);
484 printf(".L%d:\n", target
);
486 show_statement(stmt
->if_false
);
488 printf(".L%d:\n", target
);
492 show_switch_statement(stmt
);
496 printf(".L%p:\n", stmt
->case_label
);
497 show_statement(stmt
->case_statement
);
500 case STMT_ITERATOR
: {
501 struct statement
*pre_statement
= stmt
->iterator_pre_statement
;
502 struct expression
*pre_condition
= stmt
->iterator_pre_condition
;
503 struct statement
*statement
= stmt
->iterator_statement
;
504 struct statement
*post_statement
= stmt
->iterator_post_statement
;
505 struct expression
*post_condition
= stmt
->iterator_post_condition
;
506 int val
, loop_top
= 0, loop_bottom
= 0;
508 show_symbol_decl(stmt
->iterator_syms
);
509 show_statement(pre_statement
);
511 if (pre_condition
->type
== EXPR_VALUE
) {
512 if (!pre_condition
->value
) {
513 loop_bottom
= new_label();
514 printf("\tjmp\t\t.L%d\n", loop_bottom
);
517 loop_bottom
= new_label();
518 val
= show_expression(pre_condition
);
519 printf("\tje\t\tv%d, .L%d\n", val
, loop_bottom
);
522 if (!post_condition
|| post_condition
->type
!= EXPR_VALUE
|| post_condition
->value
) {
523 loop_top
= new_label();
524 printf(".L%d:\n", loop_top
);
526 show_statement(statement
);
527 if (stmt
->iterator_continue
->used
)
528 printf(".L%p:\n", stmt
->iterator_continue
);
529 show_statement(post_statement
);
530 if (!post_condition
) {
531 printf("\tjmp\t\t.L%d\n", loop_top
);
532 } else if (post_condition
->type
== EXPR_VALUE
) {
533 if (post_condition
->value
)
534 printf("\tjmp\t\t.L%d\n", loop_top
);
536 val
= show_expression(post_condition
);
537 printf("\tjne\t\tv%d, .L%d\n", val
, loop_top
);
539 if (stmt
->iterator_break
->used
)
540 printf(".L%p:\n", stmt
->iterator_break
);
542 printf(".L%d:\n", loop_bottom
);
549 printf(".L%p:\n", stmt
->label_identifier
);
550 show_statement(stmt
->label_statement
);
554 if (stmt
->goto_expression
) {
555 int val
= show_expression(stmt
->goto_expression
);
556 printf("\tgoto\t\t*v%d\n", val
);
558 printf("\tgoto\t\t.L%p\n", stmt
->goto_label
->bb_target
);
562 printf("\tasm( .... )\n");
564 case STMT_INTERNAL
: {
565 int val
= show_expression(stmt
->expression
);
566 printf("\tINTERNAL( %d )\n", val
);
573 static int show_call_expression(struct expression
*expr
)
575 struct symbol
*direct
;
576 struct expression
*arg
, *fn
;
581 warning(expr
->pos
, "\tcall with no type!");
586 FOR_EACH_PTR_REVERSE(expr
->args
, arg
) {
587 int new = show_expression(arg
);
588 int size
= arg
->ctype
->bit_size
;
589 printf("\tpush.%d\t\tv%d\n", size
, new);
590 framesize
+= size
>> 3;
591 } END_FOR_EACH_PTR_REVERSE(arg
);
595 /* Remove dereference, if any */
597 if (fn
->type
== EXPR_PREOP
) {
598 if (fn
->unop
->type
== EXPR_SYMBOL
) {
599 struct symbol
*sym
= fn
->unop
->symbol
;
600 if (sym
->ctype
.base_type
->type
== SYM_FN
)
605 printf("\tcall\t\t%s\n", show_ident(direct
->ident
));
607 fncall
= show_expression(fn
);
608 printf("\tcall\t\t*v%d\n", fncall
);
611 printf("\tadd.%d\t\tvSP,vSP,$%d\n", bits_in_pointer
, framesize
);
613 retval
= new_pseudo();
614 printf("\tmov.%d\t\tv%d,retval\n", expr
->ctype
->bit_size
, retval
);
618 static int show_binop(struct expression
*expr
)
620 int left
= show_expression(expr
->left
);
621 int right
= show_expression(expr
->right
);
622 int new = new_pseudo();
624 static const char *name
[] = {
625 ['+'] = "add", ['-'] = "sub",
626 ['*'] = "mul", ['/'] = "div",
627 ['%'] = "mod", ['&'] = "and",
628 ['|'] = "lor", ['^'] = "xor"
630 unsigned int op
= expr
->op
;
632 opname
= show_special(op
);
633 if (op
< sizeof(name
)/sizeof(*name
))
635 printf("\t%s.%d\t\tv%d,v%d,v%d\n", opname
,
636 expr
->ctype
->bit_size
,
641 static int show_slice(struct expression
*expr
)
643 int target
= show_expression(expr
->base
);
644 int new = new_pseudo();
645 printf("\tslice.%d\t\tv%d,v%d,%d\n", expr
->r_nrbits
, target
, new, expr
->r_bitpos
);
649 static int show_regular_preop(struct expression
*expr
)
651 int target
= show_expression(expr
->unop
);
652 int new = new_pseudo();
653 static const char *name
[] = {
654 ['!'] = "nonzero", ['-'] = "neg",
657 unsigned int op
= expr
->op
;
660 opname
= show_special(op
);
661 if (op
< sizeof(name
)/sizeof(*name
))
663 printf("\t%s.%d\t\tv%d,v%d\n", opname
, expr
->ctype
->bit_size
, new, target
);
668 * FIXME! Not all accesses are memory loads. We should
669 * check what kind of symbol is behind the dereference.
671 static int show_address_gen(struct expression
*expr
)
673 return show_expression(expr
->unop
);
676 static int show_load_gen(int bits
, struct expression
*expr
, int addr
)
678 int new = new_pseudo();
680 printf("\tld.%d\t\tv%d,[v%d]\n", bits
, new, addr
);
684 static void show_store_gen(int bits
, int value
, struct expression
*expr
, int addr
)
686 /* FIXME!!! Bitfield store! */
687 printf("\tst.%d\t\tv%d,[v%d]\n", bits
, value
, addr
);
690 static int show_assignment(struct expression
*expr
)
692 struct expression
*target
= expr
->left
;
698 bits
= expr
->ctype
->bit_size
;
699 val
= show_expression(expr
->right
);
700 addr
= show_address_gen(target
);
701 show_store_gen(bits
, val
, target
, addr
);
705 static int show_return_stmt(struct statement
*stmt
)
707 struct expression
*expr
= stmt
->ret_value
;
708 struct symbol
*target
= stmt
->ret_target
;
710 if (expr
&& expr
->ctype
) {
711 int val
= show_expression(expr
);
712 int bits
= expr
->ctype
->bit_size
;
713 int addr
= show_symbol_expr(target
);
714 show_store_gen(bits
, val
, NULL
, addr
);
716 printf("\tret\t\t(%p)\n", target
);
720 static int show_initialization(struct symbol
*sym
, struct expression
*expr
)
727 bits
= expr
->ctype
->bit_size
;
728 val
= show_expression(expr
);
729 addr
= show_symbol_expr(sym
);
730 // FIXME! The "target" expression is for bitfield store information.
731 // Leave it NULL, which works fine.
732 show_store_gen(bits
, val
, NULL
, addr
);
736 static int show_access(struct expression
*expr
)
738 int addr
= show_address_gen(expr
);
739 return show_load_gen(expr
->ctype
->bit_size
, expr
, addr
);
742 static int show_inc_dec(struct expression
*expr
, int postop
)
744 int addr
= show_address_gen(expr
->unop
);
746 const char *opname
= expr
->op
== SPECIAL_INCREMENT
? "add" : "sub";
747 int bits
= expr
->ctype
->bit_size
;
749 retval
= show_load_gen(bits
, expr
->unop
, addr
);
753 printf("\t%s.%d\t\tv%d,v%d,$1\n", opname
, bits
, new, retval
);
754 show_store_gen(bits
, new, expr
->unop
, addr
);
758 static int show_preop(struct expression
*expr
)
761 * '*' is an lvalue access, and is fundamentally different
762 * from an arithmetic operation. Maybe it should have an
763 * expression type of its own..
766 return show_access(expr
);
767 if (expr
->op
== SPECIAL_INCREMENT
|| expr
->op
== SPECIAL_DECREMENT
)
768 return show_inc_dec(expr
, 0);
769 return show_regular_preop(expr
);
772 static int show_postop(struct expression
*expr
)
774 return show_inc_dec(expr
, 1);
777 static int show_symbol_expr(struct symbol
*sym
)
779 int new = new_pseudo();
781 if (sym
->initializer
&& sym
->initializer
->type
== EXPR_STRING
)
782 return show_string_expr(sym
->initializer
);
784 if (sym
->ctype
.modifiers
& (MOD_TOPLEVEL
| MOD_EXTERN
| MOD_STATIC
)) {
785 printf("\tmovi.%d\t\tv%d,$%s\n", bits_in_pointer
, new, show_ident(sym
->ident
));
788 if (sym
->ctype
.modifiers
& MOD_ADDRESSABLE
) {
789 printf("\taddi.%d\t\tv%d,vFP,$%lld\n", bits_in_pointer
, new, sym
->value
);
792 printf("\taddi.%d\t\tv%d,vFP,$offsetof(%s:%p)\n", bits_in_pointer
, new, show_ident(sym
->ident
), sym
);
796 static int show_symbol_init(struct symbol
*sym
)
798 struct expression
*expr
= sym
->initializer
;
803 bits
= expr
->ctype
->bit_size
;
804 val
= show_expression(expr
);
805 addr
= show_symbol_expr(sym
);
806 show_store_gen(bits
, val
, NULL
, addr
);
811 static int type_is_signed(struct symbol
*sym
)
813 if (sym
->type
== SYM_NODE
)
814 sym
= sym
->ctype
.base_type
;
815 if (sym
->type
== SYM_PTR
)
817 return !(sym
->ctype
.modifiers
& MOD_UNSIGNED
);
820 static int show_cast_expr(struct expression
*expr
)
822 struct symbol
*old_type
, *new_type
;
823 int op
= show_expression(expr
->cast_expression
);
824 int oldbits
, newbits
;
827 old_type
= expr
->cast_expression
->ctype
;
828 new_type
= expr
->cast_type
;
830 oldbits
= old_type
->bit_size
;
831 newbits
= new_type
->bit_size
;
832 if (oldbits
>= newbits
)
835 is_signed
= type_is_signed(old_type
);
837 printf("\tsext%d.%d\tv%d,v%d\n", oldbits
, newbits
, new, op
);
839 printf("\tandl.%d\t\tv%d,v%d,$%lu\n", newbits
, new, op
, (1UL << oldbits
)-1);
844 static int show_value(struct expression
*expr
)
846 int new = new_pseudo();
847 unsigned long long value
= expr
->value
;
849 printf("\tmovi.%d\t\tv%d,$%llu\n", expr
->ctype
->bit_size
, new, value
);
853 static int show_fvalue(struct expression
*expr
)
855 int new = new_pseudo();
856 long double value
= expr
->fvalue
;
858 printf("\tmovf.%d\t\tv%d,$%Lf\n", expr
->ctype
->bit_size
, new, value
);
862 static int show_string_expr(struct expression
*expr
)
864 int new = new_pseudo();
866 printf("\tmovi.%d\t\tv%d,&%s\n", bits_in_pointer
, new, show_string(expr
->string
));
870 int show_label_expr(struct expression
*expr
)
872 int new = new_pseudo();
873 printf("\tmovi.%d\t\tv%d,.L%p\n",bits_in_pointer
, new, expr
->label_symbol
);
877 static int show_conditional_expr(struct expression
*expr
)
879 int cond
= show_expression(expr
->conditional
);
880 int true = show_expression(expr
->cond_true
);
881 int false = show_expression(expr
->cond_false
);
882 int new = new_pseudo();
884 printf("[v%d]\tcmov.%d\t\tv%d,v%d,v%d\n", cond
, expr
->ctype
->bit_size
, new, true, false);
888 static int show_statement_expr(struct expression
*expr
)
890 return show_statement(expr
->statement
);
893 static int show_position_expr(struct expression
*expr
, struct symbol
*base
)
895 int new = show_expression(expr
->init_expr
);
896 struct symbol
*ctype
= expr
->init_expr
->ctype
;
899 bit_offset
= ctype
? ctype
->bit_offset
: -1;
901 printf("\tinsert v%d at [%d:%d] of %s\n", new,
902 expr
->init_offset
, bit_offset
,
903 show_ident(base
->ident
));
907 static int show_initializer_expr(struct expression
*expr
, struct symbol
*ctype
)
909 struct expression
*entry
;
911 FOR_EACH_PTR(expr
->expr_list
, entry
) {
914 // Nested initializers have their positions already
915 // recursively calculated - just output them too
916 if (entry
->type
== EXPR_INITIALIZER
) {
917 show_initializer_expr(entry
, ctype
);
921 // Initializer indexes and identifiers should
922 // have been evaluated to EXPR_POS
923 if (entry
->type
== EXPR_IDENTIFIER
) {
924 printf(" AT '%s':\n", show_ident(entry
->expr_ident
));
925 entry
= entry
->ident_expression
;
929 if (entry
->type
== EXPR_INDEX
) {
930 printf(" AT '%d..%d:\n", entry
->idx_from
, entry
->idx_to
);
931 entry
= entry
->idx_expression
;
934 if (entry
->type
== EXPR_POS
) {
935 show_position_expr(entry
, ctype
);
938 show_initialization(ctype
, entry
);
939 } END_FOR_EACH_PTR(entry
);
943 int show_symbol_expr_init(struct symbol
*sym
)
945 struct expression
*expr
= sym
->initializer
;
948 show_expression(expr
);
949 return show_symbol_expr(sym
);
953 * Print out an expression. Return the pseudo that contains the
956 int show_expression(struct expression
*expr
)
962 struct position
*pos
= &expr
->pos
;
963 printf("\tno type at %s:%d:%d\n",
964 stream_name(pos
->stream
),
965 pos
->line
, pos
->pos
);
969 switch (expr
->type
) {
971 return show_call_expression(expr
);
973 case EXPR_ASSIGNMENT
:
974 return show_assignment(expr
);
980 return show_binop(expr
);
982 return show_preop(expr
);
984 return show_postop(expr
);
986 return show_symbol_expr(expr
->symbol
);
991 warning(expr
->pos
, "invalid expression after evaluation");
994 case EXPR_IMPLIED_CAST
:
995 return show_cast_expr(expr
);
997 return show_value(expr
);
999 return show_fvalue(expr
);
1001 return show_string_expr(expr
);
1002 case EXPR_INITIALIZER
:
1003 return show_initializer_expr(expr
, expr
->ctype
);
1005 case EXPR_CONDITIONAL
:
1006 return show_conditional_expr(expr
);
1007 case EXPR_STATEMENT
:
1008 return show_statement_expr(expr
);
1010 return show_label_expr(expr
);
1012 return show_slice(expr
);
1014 // None of these should exist as direct expressions: they are only
1015 // valid as sub-expressions of initializers.
1017 warning(expr
->pos
, "unable to show plain initializer position expression");
1019 case EXPR_IDENTIFIER
:
1020 warning(expr
->pos
, "unable to show identifier expression");
1023 warning(expr
->pos
, "unable to show index expression");
1026 warning(expr
->pos
, "unable to show type expression");