This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]:Complete lotaction_tizing c-parse.in
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 28 Jun 2003 20:05:34 +0100
- Subject: [PATCH]:Complete lotaction_tizing c-parse.in
- Organization: Codesourcery LLC
Hi,
I've instal;led this obvious patch to complete the use of location_t
in c-parse.in
built & tested on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2003-06-28 Nathan Sidwell <nathan@codesourcery.com>
* c-decl.c (c_init_decl_processing): Use a location_t. Set input
filename to <internal>.
* tree.c (make_node): Just copy the current location.
* c-parse.in (yylexstring): Use a location_t.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.398
diff -c -3 -p -r1.398 c-decl.c
*** c-decl.c 27 Jun 2003 09:05:44 -0000 1.398
--- c-decl.c 28 Jun 2003 16:46:23 -0000
*************** c_init_decl_processing (void)
*** 2232,2239 ****
{
tree endlink;
tree ptr_ftype_void, ptr_ftype_ptr;
! const char *save_input_filename;
!
/* Adds some ggc roots, and reserved words for c-parse.in. */
c_parse_init ();
--- 2232,2239 ----
{
tree endlink;
tree ptr_ftype_void, ptr_ftype_ptr;
! location_t save_loc = input_location;
!
/* Adds some ggc roots, and reserved words for c-parse.in. */
c_parse_init ();
*************** c_init_decl_processing (void)
*** 2248,2255 ****
/* Declarations from c_common_nodes_and_builtins must not be associated
with this input file, lest we get differences between using and not
using preprocessed headers. */
! save_input_filename = input_filename;
! input_filename = NULL;
build_common_tree_nodes (flag_signed_char);
--- 2248,2255 ----
/* Declarations from c_common_nodes_and_builtins must not be associated
with this input file, lest we get differences between using and not
using preprocessed headers. */
! input_location.file = "<internal>";
! input_location.line = 0;
build_common_tree_nodes (flag_signed_char);
*************** c_init_decl_processing (void)
*** 2277,2283 ****
= build_function_type (ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, endlink));
! input_filename = save_input_filename;
pedantic_lvalues = pedantic;
--- 2277,2283 ----
= build_function_type (ptr_type_node,
tree_cons (NULL_TREE, ptr_type_node, endlink));
! input_location = save_loc;
pedantic_lvalues = pedantic;
Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.163
diff -c -3 -p -r1.163 c-parse.in
*** c-parse.in 28 Jun 2003 12:30:05 -0000 1.163
--- c-parse.in 28 Jun 2003 16:46:31 -0000
*************** yylexstring ()
*** 3688,3702 ****
varray_type strings;
ifc
! static int last_lineno = 0;
! static const char *last_input_filename = 0;
if (warn_traditional && !in_system_header
! && (input_line != last_lineno || !last_input_filename ||
! strcmp (last_input_filename, input_filename)))
{
warning ("traditional C rejects string concatenation");
! last_lineno = input_line;
! last_input_filename = input_filename;
}
end ifc
--- 3688,3701 ----
varray_type strings;
ifc
! static location_t last_location;
if (warn_traditional && !in_system_header
! && (input_location.line != last_location.line
! || !last_location.file ||
! strcmp (last_location.file, input_location.file)))
{
warning ("traditional C rejects string concatenation");
! last_location = input_location;
}
end ifc
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.309
diff -c -3 -p -r1.309 tree.c
*** tree.c 16 Jun 2003 21:41:06 -0000 1.309
--- tree.c 28 Jun 2003 16:46:43 -0000
*************** make_node (code)
*** 308,316 ****
DECL_ALIGN (t) = 1;
DECL_USER_ALIGN (t) = 0;
DECL_IN_SYSTEM_HEADER (t) = in_system_header;
! DECL_SOURCE_LINE (t) = input_line;
! DECL_SOURCE_FILE (t) =
! (input_filename) ? input_filename : "<built-in>";
DECL_UID (t) = next_decl_uid++;
/* We have not yet computed the alias set for this declaration. */
--- 308,314 ----
DECL_ALIGN (t) = 1;
DECL_USER_ALIGN (t) = 0;
DECL_IN_SYSTEM_HEADER (t) = in_system_header;
! DECL_SOURCE_LOCATION (t) = input_location;
DECL_UID (t) = next_decl_uid++;
/* We have not yet computed the alias set for this declaration. */