This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: get --enable-mapped-location building
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 2 Nov 2006 17:28:45 +1100
- Subject: Re: PATCH: get --enable-mapped-location building
- References: <20061102055539.GA14894@ozlabs.au.ibm.com> <45498DBE.6030804@bothner.com>
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;