[qfcc] Clean up make_qc_param

The code for it and make_param were nearly identical, but it turned out
that just setting up the symbol correctly was all that was needed before
passing the spec to make_param. This will make implementing parameter
qualifiers easier (less repetition).
This commit is contained in:
Bill Currie 2024-09-02 15:59:06 +09:00
parent 6f0c7eaba6
commit 4dd461d1e6

View file

@ -541,15 +541,9 @@ make_selector (const char *selector, const type_t *type, const char *name)
static param_t *
make_qc_param (specifier_t spec, symbol_t *sym)
{
if (spec.type_expr) {
auto param = new_generic_param (spec.type_expr, spec.sym->name);
return param;
} else {
spec = default_type (spec, spec.sym);
sym->type = spec.type;
auto param = new_param (0, spec.type, sym->name);
return param;
}
sym->type = nullptr;
spec.sym = sym;
return make_param (spec);
}
static param_t *