This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: add_cpp_tree_codes ()
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch: add_cpp_tree_codes ()
- From: Devang Patel <dpatel at apple dot com>
- Date: Fri, 31 Aug 2001 18:15:17 -0700
This minor code reorg patch introduces function add_cpp_tree_codes () to
add
c++ specific tree codes into the list of all tree codes.
2001-08-31 Devang Patel <dpatel@apple.com>
*cp/lex.h cp/lex.c: (init_parse) New function
add_cpp_tree_codes ().
Index: lex.c
===================================================================
RCS file: /cvs/Darwin/Commands/GNU/gcc/gcc/cp/lex.c,v
retrieving revision 1.16
diff -3 -c -r1.16 lex.c
*** lex.c 2001/08/30 08:38:52 1.16
--- lex.c 2001/09/01 00:23:58
***************
*** 718,723 ****
--- 719,741 ----
handle_pragma_java_exceptions);
}
+ /* Adds the tree codes specific to the C++ front end to the list of all
+ tree codes. */
+
+ void
+ add_cpp_tree_codes ()
+ {
+ memcpy (tree_code_type + (int) LAST_C_TREE_CODE,
+ cplus_tree_code_type,
+ (int)LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE);
+ memcpy (tree_code_length + (int) LAST_C_TREE_CODE,
+ cplus_tree_code_length,
+ (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof (int));
+ memcpy (tree_code_name + (int) LAST_C_TREE_CODE,
+ cplus_tree_code_name,
+ (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof
(char *));
+ }
+
const char *
init_parse (filename)
const char *filename;
***************
*** 736,751 ****
init_cp_semantics ();
add_c_tree_codes ();
!
! memcpy (tree_code_type + (int) LAST_C_TREE_CODE,
! cplus_tree_code_type,
! (int)LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE);
! memcpy (tree_code_length + (int) LAST_C_TREE_CODE,
! cplus_tree_code_length,
! (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof (int));
! memcpy (tree_code_name + (int) LAST_C_TREE_CODE,
! cplus_tree_code_name,
! (LAST_CPLUS_TREE_CODE - (int)LAST_C_TREE_CODE) * sizeof
(char *));
init_operators ();
init_method ();
--- 754,760 ----
init_cp_semantics ();
add_c_tree_codes ();
! add_cpp_tree_codes ();
init_operators ();
init_method ();
Index: lex.h
===================================================================
RCS file: /cvs/Darwin/Commands/GNU/gcc/gcc/cp/lex.h,v
retrieving revision 1.1.1.2
diff -3 -c -r1.1.1.2 lex.h
*** lex.h 2001/05/29 21:48:44 1.1.1.2
--- lex.h 2001/09/01 00:23:58
***************
*** 83,87 ****
--- 83,88 ----
extern int pending_lang_change;
extern int yylex PARAMS ((void));
+ extern void add_cpp_tree_codes PARAMS ((void));
#endif /* ! GCC_CP_LEX_H */