PATCH: get --enable-mapped-location building
Ian Lance Taylor
iant@google.com
Thu Nov 2 07:17:00 GMT 2006
Seems to me that you should just use the USE_MAPPED_LOCATION code
unconditionally, and remove the other code.
That patch is approved if it works.
Ian
Ben Elliston <bje@au1.ibm.com> writes:
> I sent the wrong patch. Let's try again:
>
> Index: tree-ssa.c
> ===================================================================
> --- tree-ssa.c (revision 118397)
> +++ tree-ssa.c (working copy)
> @@ -1155,6 +1155,9 @@ warn_uninit (tree t, const char *gmsgid,
> tree def = SSA_NAME_DEF_STMT (t);
> tree context = (tree) data;
> location_t *locus, *fun_locus;
> +#ifdef USE_MAPPED_LOCATION
> + expanded_location xloc, floc;
> +#endif
>
> /* Default uses (indicated by an empty definition statement),
> are uninitialized. */
> @@ -1179,9 +1182,17 @@ warn_uninit (tree t, const char *gmsgid,
> : &DECL_SOURCE_LOCATION (var));
> warning (0, gmsgid, locus, var);
> fun_locus = &DECL_SOURCE_LOCATION (cfun->decl);
> +#ifdef USE_MAPPED_LOCATION
> + xloc = expand_location (*locus);
> + floc = expand_location (*fun_locus);
> + if (xloc.file != floc.file
> + || xloc.line < floc.line
> + || xloc.line > LOCATION_LINE (cfun->function_end_locus))
> +#else
> if (locus->file != fun_locus->file
> || locus->line < fun_locus->line
> || locus->line > cfun->function_end_locus.line)
> +#endif
> inform ("%J%qD was declared here", var, var);
>
> TREE_NO_WARNING (var) = 1;
More information about the Gcc-patches
mailing list