Patch: make --enable-mapped-location work

Diego Novillo dnovillo@google.com
Tue Sep 4 18:02:00 GMT 2007


On 8/31/07, Tom Tromey <tromey@redhat.com> wrote:

> I think it would be worthwhile to discuss when
> --enable-mapped-location should be made the default.  It is not quite
> ready (in addition to fortran, Ada must be converted, and there is a
> possible Java regression).  However, it is reasonably close.

Once Ada and Fortran are fixed, I would prefer that we remove the
switch completely, to avoid all the ifdef pollution.

>
> +const cpp_token *
> +cpp_get_token_with_location (cpp_reader *pfile, source_location *loc)

Comments.

> +void
> +cpp_set_line_map (cpp_reader *pfile, struct line_maps *line_table)
> +{
> +  pfile->line_table = line_table;
> +}
> +

Likewise.


> -const char **
> +#ifdef USE_MAPPED_LOCATION
> +
> +const char *
>  expr_filename (const_tree node)
> +
> +int
> +expr_lineno (const_tree node)
>
>  int *
>  expr_lineno (const_tree node)

Likewise.

> +
> +#ifdef USE_MAPPED_LOCATION
> +#define EXPR_FILENAME(NODE) (expr_filename ((NODE)))
> +#define EXPR_LINENO(NODE) (expr_lineno ((NODE)))
> +#else
> +/* Note that these can only be used as lvalues when
> +   #!USE_MAPPED_LOCATION.  */

Perhaps it's not terribly important, but what about making both
versions non-lvalues?  For consistency, mostly.


> +static void *
> +realloc_for_line_map (void *ptr, size_t len)
> +{
> +  return ggc_realloc (ptr, len);
> +}

Comment.

The rest looks OK.  Thanks for fixing this.



More information about the Gcc-patches mailing list