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
);
55 } END_FOR_EACH_PTR(arg
);
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]", "[explicitly-signed]",
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 { &schar_ctype
, "signed char" },
166 { &uchar_ctype
, "unsigned char" },
167 { & short_ctype
, "short" },
168 { &sshort_ctype
, "signed short" },
169 { &ushort_ctype
, "unsigned short" },
170 { & int_ctype
, "int" },
171 { &sint_ctype
, "signed int" },
172 { &uint_ctype
, "unsigned int" },
173 { &slong_ctype
, "signed long" },
174 { & long_ctype
, "long" },
175 { &ulong_ctype
, "unsigned long" },
176 { & llong_ctype
, "long long" },
177 { &sllong_ctype
, "signed long long" },
178 { &ullong_ctype
, "unsigned long long" },
180 { &void_ctype
, "void" },
181 { &bool_ctype
, "bool" },
182 { &string_ctype
, "string" },
184 { &float_ctype
, "float" },
185 { &double_ctype
, "double" },
186 { &ldouble_ctype
,"long double" },
187 { &incomplete_ctype
, "incomplete type" },
188 { &label_ctype
, "label type" },
194 for (i
= 0; i
< sizeof(typenames
)/sizeof(typenames
[0]); i
++) {
195 if (typenames
[i
].sym
== sym
) {
196 int len
= strlen(typenames
[i
].name
);
197 *--name
->start
= ' ';
199 memcpy(name
->start
, typenames
[i
].name
, len
);
213 prepend(name
, "struct %s ", show_ident(sym
->ident
));
217 prepend(name
, "union %s ", show_ident(sym
->ident
));
221 prepend(name
, "enum %s ", show_ident(sym
->ident
));
225 append(name
, "%s", show_ident(sym
->ident
));
229 append(name
, ":%d", sym
->fieldwidth
);
233 append(name
, "label(%s:%p)", show_ident(sym
->ident
), sym
);
243 prepend(name
, "unknown type %d", sym
->type
);
247 mod
= modifier_string(sym
->ctype
.modifiers
);
248 modlen
= strlen(mod
);
249 name
->start
-= modlen
;
250 memcpy(name
->start
, mod
, modlen
);
252 do_show_type(sym
->ctype
.base_type
, name
);
256 append(name
, "<asn:%d>", sym
->ctype
.as
);
263 append(name
, " )( ... )");
267 append(name
, "[%lld]", get_expression_value(sym
->array_size
));
271 prepend(name
, "restricted ");
279 void show_type(struct symbol
*sym
)
282 struct type_name name
;
284 name
.start
= name
.end
= array
+100;
285 do_show_type(sym
, &name
);
287 printf("%s", name
.start
);
290 const char *show_typename(struct symbol
*sym
)
292 static char array
[200];
293 struct type_name name
;
295 name
.start
= name
.end
= array
+100;
296 do_show_type(sym
, &name
);
301 void show_symbol(struct symbol
*sym
)
308 if (sym
->ctype
.alignment
)
309 printf(".align %ld\n", sym
->ctype
.alignment
);
312 type
= sym
->ctype
.base_type
;
317 * Show actual implementation information
319 switch (type
->type
) {
321 symbol_iterate(type
->symbol_list
, show_struct_member
, NULL
);
325 symbol_iterate(type
->symbol_list
, show_struct_member
, NULL
);
329 struct statement
*stmt
= type
->stmt
;
333 val
= show_statement(stmt
);
335 printf("\tmov.%d\t\tretval,%d\n", stmt
->ret
->bit_size
, val
);
345 if (sym
->initializer
) {
347 show_expression(sym
->initializer
);
351 static int show_symbol_init(struct symbol
*sym
);
353 static int new_pseudo(void)
359 static int new_label(void)
361 static int label
= 0;
365 static void show_switch_statement(struct statement
*stmt
)
367 int val
= show_expression(stmt
->switch_expression
);
369 printf("\tswitch v%d\n", val
);
372 * Debugging only: Check that the case list is correct
373 * by printing it out.
375 * This is where a _real_ back-end would go through the
376 * cases to decide whether to use a lookup table or a
377 * series of comparisons etc
379 printf("# case table:\n");
380 FOR_EACH_PTR(stmt
->switch_case
->symbol_list
, sym
) {
381 struct statement
*case_stmt
= sym
->stmt
;
382 struct expression
*expr
= case_stmt
->case_expression
;
383 struct expression
*to
= case_stmt
->case_to
;
388 if (expr
->type
== EXPR_VALUE
) {
389 printf(" case %lld", expr
->value
);
391 if (to
->type
== EXPR_VALUE
) {
392 printf(" .. %lld", to
->value
);
400 printf(": .L%p\n", sym
->bb_target
);
401 } END_FOR_EACH_PTR(sym
);
402 printf("# end case table\n");
404 show_statement(stmt
->switch_statement
);
406 if (stmt
->switch_break
->used
)
407 printf(".L%p:\n", stmt
->switch_break
->bb_target
);
410 static void show_symbol_decl(struct symbol_list
*syms
)
413 FOR_EACH_PTR(syms
, sym
) {
414 show_symbol_init(sym
);
415 } END_FOR_EACH_PTR(sym
);
418 static int show_return_stmt(struct statement
*stmt
);
421 * Print out a statement
423 int show_statement(struct statement
*stmt
)
427 switch (stmt
->type
) {
429 return show_return_stmt(stmt
);
430 case STMT_COMPOUND
: {
434 show_symbol_decl(stmt
->syms
);
435 FOR_EACH_PTR(stmt
->stmts
, s
) {
436 last
= show_statement(s
);
437 } END_FOR_EACH_PTR(s
);
440 printf(".L%p:\n", stmt
->ret
);
441 addr
= show_symbol_expr(stmt
->ret
);
442 bits
= stmt
->ret
->bit_size
;
444 printf("\tld.%d\t\tv%d,[v%d]\n", bits
, last
, addr
);
449 case STMT_EXPRESSION
:
450 return show_expression(stmt
->expression
);
453 struct expression
*cond
= stmt
->if_conditional
;
455 /* This is only valid if nobody can jump into the "dead" statement */
457 if (cond
->type
== EXPR_VALUE
) {
458 struct statement
*s
= stmt
->if_true
;
465 val
= show_expression(cond
);
466 target
= new_label();
467 printf("\tje\t\tv%d,.L%d\n", val
, target
);
468 show_statement(stmt
->if_true
);
469 if (stmt
->if_false
) {
470 int last
= new_label();
471 printf("\tjmp\t\t.L%d\n", last
);
472 printf(".L%d:\n", target
);
474 show_statement(stmt
->if_false
);
476 printf(".L%d:\n", target
);
480 show_switch_statement(stmt
);
484 printf(".L%p:\n", stmt
->case_label
);
485 show_statement(stmt
->case_statement
);
488 case STMT_ITERATOR
: {
489 struct statement
*pre_statement
= stmt
->iterator_pre_statement
;
490 struct expression
*pre_condition
= stmt
->iterator_pre_condition
;
491 struct statement
*statement
= stmt
->iterator_statement
;
492 struct statement
*post_statement
= stmt
->iterator_post_statement
;
493 struct expression
*post_condition
= stmt
->iterator_post_condition
;
494 int val
, loop_top
= 0, loop_bottom
= 0;
496 show_symbol_decl(stmt
->iterator_syms
);
497 show_statement(pre_statement
);
499 if (pre_condition
->type
== EXPR_VALUE
) {
500 if (!pre_condition
->value
) {
501 loop_bottom
= new_label();
502 printf("\tjmp\t\t.L%d\n", loop_bottom
);
505 loop_bottom
= new_label();
506 val
= show_expression(pre_condition
);
507 printf("\tje\t\tv%d, .L%d\n", val
, loop_bottom
);
510 if (!post_condition
|| post_condition
->type
!= EXPR_VALUE
|| post_condition
->value
) {
511 loop_top
= new_label();
512 printf(".L%d:\n", loop_top
);
514 show_statement(statement
);
515 if (stmt
->iterator_continue
->used
)
516 printf(".L%p:\n", stmt
->iterator_continue
);
517 show_statement(post_statement
);
518 if (!post_condition
) {
519 printf("\tjmp\t\t.L%d\n", loop_top
);
520 } else if (post_condition
->type
== EXPR_VALUE
) {
521 if (post_condition
->value
)
522 printf("\tjmp\t\t.L%d\n", loop_top
);
524 val
= show_expression(post_condition
);
525 printf("\tjne\t\tv%d, .L%d\n", val
, loop_top
);
527 if (stmt
->iterator_break
->used
)
528 printf(".L%p:\n", stmt
->iterator_break
);
530 printf(".L%d:\n", loop_bottom
);
537 printf(".L%p:\n", stmt
->label_identifier
);
538 show_statement(stmt
->label_statement
);
542 if (stmt
->goto_expression
) {
543 int val
= show_expression(stmt
->goto_expression
);
544 printf("\tgoto\t\t*v%d\n", val
);
546 printf("\tgoto\t\t.L%p\n", stmt
->goto_label
->bb_target
);
550 printf("\tasm( .... )\n");
557 static void show_one_statement(struct statement
*stmt
, void *sep
, int flags
)
559 show_statement(stmt
);
560 if (!(flags
& ITERATE_LAST
))
561 printf("%s", (const char *)sep
);
564 void show_statement_list(struct statement_list
*stmt
, const char *sep
)
566 statement_iterate(stmt
, show_one_statement
, (void *)sep
);
569 static void show_one_expression(struct expression
*expr
, void *sep
, int flags
)
571 show_expression(expr
);
572 if (!(flags
& ITERATE_LAST
))
573 printf("%s", (const char *)sep
);
576 void show_expression_list(struct expression_list
*list
, const char *sep
)
578 expression_iterate(list
, show_one_expression
, (void *)sep
);
581 static int show_call_expression(struct expression
*expr
)
583 struct symbol
*direct
;
584 struct expression
*arg
, *fn
;
589 warning(expr
->pos
, "\tcall with no type!");
594 FOR_EACH_PTR_REVERSE(expr
->args
, arg
) {
595 int new = show_expression(arg
);
596 int size
= arg
->ctype
->bit_size
;
597 printf("\tpush.%d\t\tv%d\n", size
, new);
598 framesize
+= size
>> 3;
599 } END_FOR_EACH_PTR_REVERSE(arg
);
603 /* Remove dereference, if any */
605 if (fn
->type
== EXPR_PREOP
) {
606 if (fn
->unop
->type
== EXPR_SYMBOL
) {
607 struct symbol
*sym
= fn
->unop
->symbol
;
608 if (sym
->ctype
.base_type
->type
== SYM_FN
)
613 printf("\tcall\t\t%s\n", show_ident(direct
->ident
));
615 fncall
= show_expression(fn
);
616 printf("\tcall\t\t*v%d\n", fncall
);
619 printf("\tadd.%d\t\tvSP,vSP,$%d\n", bits_in_pointer
, framesize
);
621 retval
= new_pseudo();
622 printf("\tmov.%d\t\tv%d,retval\n", expr
->ctype
->bit_size
, retval
);
626 static int show_binop(struct expression
*expr
)
628 int left
= show_expression(expr
->left
);
629 int right
= show_expression(expr
->right
);
630 int new = new_pseudo();
632 static const char *name
[] = {
633 ['+'] = "add", ['-'] = "sub",
634 ['*'] = "mul", ['/'] = "div",
635 ['%'] = "mod", ['&'] = "and",
636 ['|'] = "lor", ['^'] = "xor"
638 unsigned int op
= expr
->op
;
640 opname
= show_special(op
);
641 if (op
< sizeof(name
)/sizeof(*name
))
643 printf("\t%s.%d\t\tv%d,v%d,v%d\n", opname
,
644 expr
->ctype
->bit_size
,
649 static int show_slice(struct expression
*expr
)
651 int target
= show_expression(expr
->base
);
652 int new = new_pseudo();
653 printf("\tslice.%d\t\tv%d,v%d,%d\n", expr
->r_nrbits
, target
, new, expr
->r_bitpos
);
657 static int show_regular_preop(struct expression
*expr
)
659 int target
= show_expression(expr
->unop
);
660 int new = new_pseudo();
661 static const char *name
[] = {
662 ['!'] = "nonzero", ['-'] = "neg",
665 unsigned int op
= expr
->op
;
668 opname
= show_special(op
);
669 if (op
< sizeof(name
)/sizeof(*name
))
671 printf("\t%s.%d\t\tv%d,v%d\n", opname
, expr
->ctype
->bit_size
, new, target
);
676 * FIXME! Not all accesses are memory loads. We should
677 * check what kind of symbol is behind the dereference.
679 static int show_address_gen(struct expression
*expr
)
681 if (expr
->type
== EXPR_PREOP
)
682 return show_expression(expr
->unop
);
683 return show_expression(expr
->address
);
686 static int show_load_gen(int bits
, struct expression
*expr
, int addr
)
688 int new = new_pseudo();
690 printf("\tld.%d\t\tv%d,[v%d]\n", bits
, new, addr
);
691 if (expr
->type
== EXPR_PREOP
)
696 printf("\tshr.%d\t\tv%d,v%d,$%d\n", bits
, new, new, expr
->bitpos
);
697 printf("\tandi.%d\t\tv%d,v%d,$%llu\n", bits
, new, new, (1ULL << expr
->nrbits
)-1);
701 static void show_store_gen(int bits
, int value
, struct expression
*expr
, int addr
)
703 /* FIXME!!! Bitfield store! */
704 printf("\tst.%d\t\tv%d,[v%d]\n", bits
, value
, addr
);
707 static int show_assignment(struct expression
*expr
)
709 struct expression
*target
= expr
->left
;
715 bits
= expr
->ctype
->bit_size
;
716 val
= show_expression(expr
->right
);
717 addr
= show_address_gen(target
);
718 show_store_gen(bits
, val
, target
, addr
);
722 static int show_return_stmt(struct statement
*stmt
)
724 struct expression
*expr
= stmt
->ret_value
;
725 struct symbol
*target
= stmt
->ret_target
;
727 if (expr
&& expr
->ctype
) {
728 int val
= show_expression(expr
);
729 int bits
= expr
->ctype
->bit_size
;
730 int addr
= show_symbol_expr(target
);
731 show_store_gen(bits
, val
, NULL
, addr
);
733 printf("\tret\t\t(%p)\n", target
);
737 static int show_initialization(struct symbol
*sym
, struct expression
*expr
)
744 bits
= expr
->ctype
->bit_size
;
745 val
= show_expression(expr
);
746 addr
= show_symbol_expr(sym
);
747 // FIXME! The "target" expression is for bitfield store information.
748 // Leave it NULL, which works fine.
749 show_store_gen(bits
, val
, NULL
, addr
);
753 static int show_access(struct expression
*expr
)
755 int addr
= show_address_gen(expr
);
756 return show_load_gen(expr
->ctype
->bit_size
, expr
, addr
);
759 static int show_inc_dec(struct expression
*expr
, int postop
)
761 int addr
= show_address_gen(expr
->unop
);
763 const char *opname
= expr
->op
== SPECIAL_INCREMENT
? "add" : "sub";
764 int bits
= expr
->ctype
->bit_size
;
766 retval
= show_load_gen(bits
, expr
->unop
, addr
);
770 printf("\t%s.%d\t\tv%d,v%d,$1\n", opname
, bits
, new, retval
);
771 show_store_gen(bits
, new, expr
->unop
, addr
);
775 static int show_preop(struct expression
*expr
)
778 * '*' is an lvalue access, and is fundamentally different
779 * from an arithmetic operation. Maybe it should have an
780 * expression type of its own..
783 return show_access(expr
);
784 if (expr
->op
== SPECIAL_INCREMENT
|| expr
->op
== SPECIAL_DECREMENT
)
785 return show_inc_dec(expr
, 0);
786 return show_regular_preop(expr
);
789 static int show_postop(struct expression
*expr
)
791 return show_inc_dec(expr
, 1);
794 static int show_symbol_expr(struct symbol
*sym
)
796 int new = new_pseudo();
798 if (sym
->ctype
.modifiers
& (MOD_TOPLEVEL
| MOD_EXTERN
| MOD_STATIC
)) {
799 printf("\tmovi.%d\t\tv%d,$%s\n", bits_in_pointer
, new, show_ident(sym
->ident
));
802 if (sym
->ctype
.modifiers
& MOD_ADDRESSABLE
) {
803 printf("\taddi.%d\t\tv%d,vFP,$%lld\n", bits_in_pointer
, new, sym
->value
);
806 printf("\taddi.%d\t\tv%d,vFP,$offsetof(%s:%p)\n", bits_in_pointer
, new, show_ident(sym
->ident
), sym
);
810 static int show_symbol_init(struct symbol
*sym
)
812 struct expression
*expr
= sym
->initializer
;
817 bits
= expr
->ctype
->bit_size
;
818 val
= show_expression(expr
);
819 addr
= show_symbol_expr(sym
);
820 show_store_gen(bits
, val
, NULL
, addr
);
825 static int type_is_signed(struct symbol
*sym
)
827 if (sym
->type
== SYM_NODE
)
828 sym
= sym
->ctype
.base_type
;
829 if (sym
->type
== SYM_PTR
)
831 return !(sym
->ctype
.modifiers
& MOD_UNSIGNED
);
834 static int show_cast_expr(struct expression
*expr
)
836 struct symbol
*old_type
, *new_type
;
837 int op
= show_expression(expr
->cast_expression
);
838 int oldbits
, newbits
;
841 old_type
= expr
->cast_expression
->ctype
;
842 new_type
= expr
->cast_type
;
844 oldbits
= old_type
->bit_size
;
845 newbits
= new_type
->bit_size
;
846 if (oldbits
>= newbits
)
849 is_signed
= type_is_signed(old_type
);
851 printf("\tsext%d.%d\tv%d,v%d\n", oldbits
, newbits
, new, op
);
853 printf("\tandl.%d\t\tv%d,v%d,$%lu\n", newbits
, new, op
, (1UL << oldbits
)-1);
858 static int show_value(struct expression
*expr
)
860 int new = new_pseudo();
861 unsigned long long value
= expr
->value
;
863 printf("\tmovi.%d\t\tv%d,$%llu\n", expr
->ctype
->bit_size
, new, value
);
867 static int show_fvalue(struct expression
*expr
)
869 int new = new_pseudo();
870 long double value
= expr
->fvalue
;
872 printf("\tmovf.%d\t\tv%d,$%Lf\n", expr
->ctype
->bit_size
, new, value
);
876 static int show_string_expr(struct expression
*expr
)
878 int new = new_pseudo();
880 printf("\tmovi.%d\t\tv%d,&%s\n", bits_in_pointer
, new, show_string(expr
->string
));
884 static int show_bitfield_expr(struct expression
*expr
)
886 return show_access(expr
);
889 int show_label_expr(struct expression
*expr
)
891 int new = new_pseudo();
892 printf("\tmovi.%d\t\tv%d,.L%p\n",bits_in_pointer
, new, expr
->label_symbol
);
896 static int show_conditional_expr(struct expression
*expr
)
898 int cond
= show_expression(expr
->conditional
);
899 int true = show_expression(expr
->cond_true
);
900 int false = show_expression(expr
->cond_false
);
901 int new = new_pseudo();
905 printf("[v%d]\tcmov.%d\t\tv%d,v%d,v%d\n", cond
, expr
->ctype
->bit_size
, new, true, false);
909 static int show_statement_expr(struct expression
*expr
)
911 return show_statement(expr
->statement
);
914 static int show_position_expr(struct expression
*expr
, struct symbol
*base
)
916 int new = show_expression(expr
->init_expr
);
917 struct symbol
*ctype
= expr
->init_sym
;
919 printf("\tinsert v%d at [%d:%d] of %s\n", new,
920 expr
->init_offset
, ctype
->bit_offset
,
921 show_ident(base
->ident
));
925 static int show_initializer_expr(struct expression
*expr
, struct symbol
*ctype
)
927 struct expression
*entry
;
929 FOR_EACH_PTR(expr
->expr_list
, entry
) {
930 // Nested initializers have their positions already
931 // recursively calculated - just output them too
932 if (entry
->type
== EXPR_INITIALIZER
) {
933 show_initializer_expr(entry
, ctype
);
937 // Ignore initializer indexes and identifiers - the
938 // evaluator has taken them into account
939 if (entry
->type
== EXPR_IDENTIFIER
|| entry
->type
== EXPR_INDEX
)
941 if (entry
->type
== EXPR_POS
) {
942 show_position_expr(entry
, ctype
);
945 show_initialization(ctype
, entry
);
946 } END_FOR_EACH_PTR(entry
);
950 int show_symbol_expr_init(struct symbol
*sym
)
952 struct expression
*expr
= sym
->initializer
;
955 show_expression(expr
);
956 return show_symbol_expr(sym
);
960 * Print out an expression. Return the pseudo that contains the
963 int show_expression(struct expression
*expr
)
969 struct position
*pos
= &expr
->pos
;
970 printf("\tno type at %s:%d:%d\n",
971 input_streams
[pos
->stream
].name
,
972 pos
->line
, pos
->pos
);
976 switch (expr
->type
) {
978 return show_call_expression(expr
);
980 case EXPR_ASSIGNMENT
:
981 return show_assignment(expr
);
987 return show_binop(expr
);
989 return show_preop(expr
);
991 return show_postop(expr
);
993 return show_symbol_expr(expr
->symbol
);
997 warning(expr
->pos
, "invalid expression after evaluation");
1000 return show_cast_expr(expr
);
1002 return show_value(expr
);
1004 return show_fvalue(expr
);
1006 return show_string_expr(expr
);
1008 return show_bitfield_expr(expr
);
1009 case EXPR_INITIALIZER
:
1010 return show_initializer_expr(expr
, expr
->ctype
);
1012 case EXPR_CONDITIONAL
:
1013 return show_conditional_expr(expr
);
1014 case EXPR_STATEMENT
:
1015 return show_statement_expr(expr
);
1017 return show_label_expr(expr
);
1019 return show_slice(expr
);
1021 // None of these should exist as direct expressions: they are only
1022 // valid as sub-expressions of initializers.
1024 warning(expr
->pos
, "unable to show plain initializer position expression");
1026 case EXPR_IDENTIFIER
:
1027 warning(expr
->pos
, "unable to show identifier expression");
1030 warning(expr
->pos
, "unable to show index expression");
1033 warning(expr
->pos
, "unable to show type expression");