On Tue, Dec 11, 2018 at 2:15 AM Tom de Vries <[email protected]> wrote:
>
> Factor out the common handling of DW_AT_abstract_origin and
> DW_AT_specification from read_function_entry and read_referenced_name.
>
> 2018-12-10 Tom de Vries <[email protected]>
>
> * dwarf.c (read_referenced_name_1): New function. Factor out of ...
> (read_referenced_name): ... here, and ...
> (read_function_entry): ... here.
> +static const char *read_referenced_name (struct dwarf_data *, struct unit *,
> + uint64_t, backtrace_error_callback,
> + void *);
> +
We don't need this declaration. Only add a static declaration if
there is a forward reference.
> +/* Read the name of a function from a DIE referenced by ATTR with VAL. */
> +
> +static const char *
> +read_referenced_name_1 (struct dwarf_data *ddata, struct unit *u,
> + struct attr *attr, struct attr_val *val,
> + backtrace_error_callback error_callback, void *data)
> +{
Let's not use a name ending in "_1". That is a cop-out. Pick a
meaningful name. Perhaps read_referenced_name_from_attr.
Ian