This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: get --enable-mapped-location building


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]