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]

Patch: add_cpp_tree_codes ()



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 */


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