Tue Mar 29 21:14:04 1994 Per Bothner (bothner@kalessin.cygnus.com)
+ * ch-exp.y: Implement SIZE(mode_name) and SIZE(expression).
+
* ch-lang.c (chill_is_varying_struct): Magic string is
was "<var_length>" is now "__var_length" (more portable).
%type <voidval> lower_element
%type <voidval> upper_element
%type <voidval> first_element
-%type <voidval> mode_argument
+%type <tval> mode_argument
%type <voidval> upper_lower_argument
%type <voidval> length_argument
%type <voidval> array_mode_name
{
$$ = 0; /* FIXME */
}
- | SIZE '(' location ')'
- {
- $$ = 0; /* FIXME */
- }
+ | SIZE '(' expression ')'
+ { write_exp_elt_opcode (UNOP_SIZEOF); }
| SIZE '(' mode_argument ')'
- {
- $$ = 0; /* FIXME */
- }
+ { write_exp_elt_opcode (OP_LONG);
+ write_exp_elt_type (builtin_type_int);
+ write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
+ write_exp_elt_opcode (OP_LONG); }
| UPPER '(' upper_lower_argument ')'
{
$$ = 0; /* FIXME */
mode_argument : mode_name
{
- $$ = 0; /* FIXME */
+ $$ = $1.type;
}
| array_mode_name '(' expression ')'
{