This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: print-tree and column numbers
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 30 Oct 2007 13:47:52 -0600
- Subject: Patch: print-tree and column numbers
- Reply-to: Tom Tromey <tromey at redhat dot com>
This patch changes print-tree.c to emit column numbers when mapped
locations are enabled. This makes the debugging output a bit nicer
and makes it simpler to debug column number location bugs.
Bootstrapped and regtested on x86 FC-6. Ok?
Tom
2007-10-30 Tom Tromey <tromey@redhat.com>
* print-tree.c (print_node): Print column number.
Index: print-tree.c
===================================================================
--- print-tree.c (revision 129492)
+++ print-tree.c (working copy)
@@ -443,6 +443,9 @@
xloc = expand_location (DECL_SOURCE_LOCATION (node));
fprintf (file, " file %s line %d", xloc.file, xloc.line);
+#ifdef USE_MAPPED_LOCATION
+ fprintf (file, " col %d", xloc.column);
+#endif
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{
@@ -932,6 +935,9 @@
expanded_location xloc = expand_location (EXPR_LOCATION (node));
indent_to (file, indent+4);
fprintf (file, "%s:%d", xloc.file, xloc.line);
+#ifdef USE_MAPPED_LOCATION
+ fprintf (file, ":%d", xloc.column);
+#endif
}
fprintf (file, ">");