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]

PATCH to make <built-in>'s line-number consistenly 0


This fixes an inconsistency where the line_map source_location
for <built-in> was line 1, but other places (lang_dependent_init,
DECL_IS_BUILTIN, both when !USE_MAPPED_LOCATION) assume line 0.
This caused a testsuite failure when --enable-mapped-location,
which emitted <built-in>:1 rather than <built-in>:0 for operator new.

That assumes that we *want* line-number 0 rather than 1.  Switching
to line-number 1 is easy in the --enable-mapped-location case (just
fix the test-suite), though it's a little trickier while we're
transitioning.

Ok for mainline?
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/
2005-04-19  Per Bothner  <per@bothner.com>

	* c-opts.c (finish_options):  Make the line-number of the <built-in>
	location 0, as assumed elsewhere, rather than 1.

Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.140
diff -u -p -r1.140 c-opts.c
--- c-opts.c	22 Mar 2005 23:18:42 -0000	1.140
+++ c-opts.c	19 Apr 2005 19:09:07 -0000
@@ -1302,7 +1302,10 @@ finish_options (void)
     {
       size_t i;
 
-      cpp_change_file (parse_in, LC_RENAME, _("<built-in>"));
+      cb_file_change (parse_in,
+		      linemap_add (&line_table, LC_RENAME, 0,
+				   _("<built-in>"), 0));
+
       cpp_init_builtins (parse_in, flag_hosted);
       c_cpp_builtins (parse_in);
 

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