Re: [rfc][13/37] Eliminate builtin_type_ macros: Update EVAL_SKIP dummy return type

Ulrich Weigand
2008-09-07T15:40:11Z

Joel Brobecker wrote:

> On another related note, the "goto nosideret" seems to be misused
> to me. We seem to always have:
>
> goto nosideret;
> [...]
>
> nosideret:
> return value_from_longest (builtin_type_long, (LONGEST) 1);
>
> If we have a value_dummy() function, we can replace all gotos with
> a "return value_dummy ()", and get rid of the label. I think it will
> be more readable.

I tried to have evaluate_subexp return NULL for the EVAL_SKIP case,
but that caused frequently-used constructe like this to break:

arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);

if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
return arg1;

I guess with a bit of effort those could be fixed.

Another approach might be to use "allocate_value (builtin_void_type)"
as the dummy return value for the EVAL_SKIP case.

> This can be done as a followup patch, though...

Agreed.