Patch to create builtins.def

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Wed Mar 22 08:27:00 GMT 2000


	This patch creates a builtins.def file to organize and
guarantee consistency between the BUILT_IN enums and BUILT_IN strings.
(I'll be adding some new builtins so this is required prior to those.)

Bootstrapped on i686-pc-linux-gnu and sparc-sun-solaris2.7.
Okay to install?

		--Kaveh



2000-03-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* builtins.def: New file.

	* Makefile.in (TREE_H): Depend on builtins.def.

	* builtins.c (built_in_names): Use builtins.def.

	* tree.h (built_in_function): Likewise.
	
diff -rup orig/egcs-CVS20000321/gcc/Makefile.in egcs-CVS20000321/gcc/Makefile.in
--- orig/egcs-CVS20000321/gcc/Makefile.in	Sun Mar 19 14:18:49 2000
+++ egcs-CVS20000321/gcc/Makefile.in	Tue Mar 21 21:41:19 2000
@@ -753,7 +753,7 @@ CONFIG_H =
 MACHMODE_H = machmode.h machmode.def
 RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
 RTL_H = $(RTL_BASE_H) genrtl.h
-TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h
+TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
 BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
 DEMANGLE_H = $(srcdir)/../include/demangle.h
 RECOG_H = recog.h
diff -rup orig/egcs-CVS20000321/gcc/builtins.c egcs-CVS20000321/gcc/builtins.c
--- orig/egcs-CVS20000321/gcc/builtins.c	Sat Mar 11 08:28:18 2000
+++ egcs-CVS20000321/gcc/builtins.c	Tue Mar 21 21:46:30 2000
@@ -60,25 +60,12 @@ Boston, MA 02111-1307, USA.  */
 const char *const built_in_class_names[4]
   = {"NOT_BUILT_IN", "BUILT_IN_FRONTEND", "BUILT_IN_MD", "BUILT_IN_NORMAL"};
 
+#define DEF_BUILTIN(x) STRINGIFY(x),
 const char *const built_in_names[(int) END_BUILTINS] =
-{"BUILT_IN_ALLOCA", "BUILT_IN_ABS", "BUILT_IN_FABS", "BUILT_IN_LABS",
-  "BUILT_IN_FFS", "BUILT_IN_DIV", "BUILT_IN_LDIV", "BUILT_IN_FFLOOR",
-  "BUILT_IN_FCEIL", "BUILT_IN_FMOD", "BUILT_IN_FREM", "BUILT_IN_MEMCPY",
-  "BUILT_IN_MEMCMP", "BUILT_IN_MEMSET", "BUILT_IN_STRCPY", "BUILT_IN_STRCMP",
-  "BUILT_IN_STRLEN", "BUILT_IN_FSQRT", "BUILT_IN_SIN", "BUILT_IN_COS",
-  "BUILT_IN_GETEXP", "BUILT_IN_GETMAN", "BUILT_IN_SAVEREGS",
-  "BUILT_IN_CLASSIFY_TYPE", "BUILT_IN_NEXT_ARG", "BUILT_IN_ARGS_INFO",
-  "BUILT_IN_CONSTANT_P", "BUILT_IN_FRAME_ADDRESS", "BUILT_IN_RETURN_ADDRESS",
-  "BUILT_IN_AGGREGATE_INCOMING_ADDRESS", "BUILT_IN_APPLY_ARGS",
-  "BUILT_IN_APPLY", "BUILT_IN_RETURN", "BUILT_IN_SETJMP", "BUILT_IN_LONGJMP",
-  "BUILT_IN_TRAP", "BUILT_IN_ISGREATER", "BUILT_IN_ISGREATEREQUAL",
-  "BUILT_IN_ISLESS", "BUILT_IN_ISLESSEQUAL", "BUILT_IN_ISLESSGREATER",
-  "BUILT_IN_ISUNORDERED", "BUILT_IN_UNWIND_INIT", "BUILT_IN_DWARF_CFA",
-  "BUILT_IN_DWARF_FP_REGNUM", "BUILT_IN_INIT_DWARF_REG_SIZES",
-  "BUILT_IN_FROB_RETURN_ADDR", "BUILT_IN_EXTRACT_RETURN_ADDR",
-  "BUILT_IN_EH_RETURN", "BUILT_IN_VARARGS_START", "BUILT_IN_STDARG_START",
-  "BUILT_IN_VA_END", "BUILT_IN_VA_COPY", "BUILT_IN_NEW", "BUILT_IN_VEC_NEW",
-  "BUILT_IN_DELETE", "BUILT_IN_VEC_DELETE" };
+{
+#include "builtins.def"
+};
+#undef DEF_BUILTIN
 
 tree (*lang_type_promotes_to) PARAMS ((tree));
 
diff -rup orig/egcs-CVS20000321/gcc/builtins.def egcs-CVS20000321/gcc/builtins.def
--- orig/egcs-CVS20000321/gcc/builtins.def	Tue Mar 21 21:40:38 2000
+++ egcs-CVS20000321/gcc/builtins.def	Tue Mar 21 21:30:52 2000
@@ -0,0 +1,85 @@
+/* This file contains the definitions and documentation for the
+   builtins used in the GNU compiler.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+DEF_BUILTIN(BUILT_IN_ALLOCA)
+DEF_BUILTIN(BUILT_IN_ABS)
+DEF_BUILTIN(BUILT_IN_FABS)
+DEF_BUILTIN(BUILT_IN_LABS)
+DEF_BUILTIN(BUILT_IN_FFS)
+DEF_BUILTIN(BUILT_IN_DIV)
+DEF_BUILTIN(BUILT_IN_LDIV)
+DEF_BUILTIN(BUILT_IN_FFLOOR)
+DEF_BUILTIN(BUILT_IN_FCEIL)
+DEF_BUILTIN(BUILT_IN_FMOD)
+DEF_BUILTIN(BUILT_IN_FREM)
+DEF_BUILTIN(BUILT_IN_MEMCPY)
+DEF_BUILTIN(BUILT_IN_MEMCMP)
+DEF_BUILTIN(BUILT_IN_MEMSET)
+DEF_BUILTIN(BUILT_IN_STRCPY)
+DEF_BUILTIN(BUILT_IN_STRCMP)
+DEF_BUILTIN(BUILT_IN_STRLEN)
+DEF_BUILTIN(BUILT_IN_FSQRT)
+DEF_BUILTIN(BUILT_IN_SIN)
+DEF_BUILTIN(BUILT_IN_COS)
+DEF_BUILTIN(BUILT_IN_GETEXP)
+DEF_BUILTIN(BUILT_IN_GETMAN)
+DEF_BUILTIN(BUILT_IN_SAVEREGS)
+DEF_BUILTIN(BUILT_IN_CLASSIFY_TYPE)
+DEF_BUILTIN(BUILT_IN_NEXT_ARG)
+DEF_BUILTIN(BUILT_IN_ARGS_INFO)
+DEF_BUILTIN(BUILT_IN_CONSTANT_P)
+DEF_BUILTIN(BUILT_IN_FRAME_ADDRESS)
+DEF_BUILTIN(BUILT_IN_RETURN_ADDRESS)
+DEF_BUILTIN(BUILT_IN_AGGREGATE_INCOMING_ADDRESS)
+DEF_BUILTIN(BUILT_IN_APPLY_ARGS)
+DEF_BUILTIN(BUILT_IN_APPLY)
+DEF_BUILTIN(BUILT_IN_RETURN)
+DEF_BUILTIN(BUILT_IN_SETJMP)
+DEF_BUILTIN(BUILT_IN_LONGJMP)
+DEF_BUILTIN(BUILT_IN_TRAP)
+
+  /* ISO C99 floating point unordered comparisons.  */
+DEF_BUILTIN(BUILT_IN_ISGREATER)
+DEF_BUILTIN(BUILT_IN_ISGREATEREQUAL)
+DEF_BUILTIN(BUILT_IN_ISLESS)
+DEF_BUILTIN(BUILT_IN_ISLESSEQUAL)
+DEF_BUILTIN(BUILT_IN_ISLESSGREATER)
+DEF_BUILTIN(BUILT_IN_ISUNORDERED)
+
+  /* Various hooks for the DWARF 2 __throw routine.  */
+DEF_BUILTIN(BUILT_IN_UNWIND_INIT)
+DEF_BUILTIN(BUILT_IN_DWARF_CFA)
+DEF_BUILTIN(BUILT_IN_DWARF_FP_REGNUM)
+DEF_BUILTIN(BUILT_IN_INIT_DWARF_REG_SIZES)
+DEF_BUILTIN(BUILT_IN_FROB_RETURN_ADDR)
+DEF_BUILTIN(BUILT_IN_EXTRACT_RETURN_ADDR)
+DEF_BUILTIN(BUILT_IN_EH_RETURN)
+
+DEF_BUILTIN(BUILT_IN_VARARGS_START)
+DEF_BUILTIN(BUILT_IN_STDARG_START)
+DEF_BUILTIN(BUILT_IN_VA_END)
+DEF_BUILTIN(BUILT_IN_VA_COPY)
+
+  /* C++ extensions */
+DEF_BUILTIN(BUILT_IN_NEW)
+DEF_BUILTIN(BUILT_IN_VEC_NEW)
+DEF_BUILTIN(BUILT_IN_DELETE)
+DEF_BUILTIN(BUILT_IN_VEC_DELETE)
diff -rup orig/egcs-CVS20000321/gcc/tree.h egcs-CVS20000321/gcc/tree.h
--- orig/egcs-CVS20000321/gcc/tree.h	Tue Mar 21 16:21:48 2000
+++ egcs-CVS20000321/gcc/tree.h	Tue Mar 21 21:38:27 2000
@@ -83,76 +83,15 @@ extern const char *const built_in_class_
 /* Codes that identify the various built in functions
    so that expand_call can identify them quickly.  */
 
+#define DEF_BUILTIN(x) x,
 enum built_in_function
 {
-  BUILT_IN_ALLOCA,
-  BUILT_IN_ABS,
-  BUILT_IN_FABS,
-  BUILT_IN_LABS,
-  BUILT_IN_FFS,
-  BUILT_IN_DIV,
-  BUILT_IN_LDIV,
-  BUILT_IN_FFLOOR,
-  BUILT_IN_FCEIL,
-  BUILT_IN_FMOD,
-  BUILT_IN_FREM,
-  BUILT_IN_MEMCPY,
-  BUILT_IN_MEMCMP,
-  BUILT_IN_MEMSET,
-  BUILT_IN_STRCPY,
-  BUILT_IN_STRCMP,
-  BUILT_IN_STRLEN,
-  BUILT_IN_FSQRT,
-  BUILT_IN_SIN,
-  BUILT_IN_COS,
-  BUILT_IN_GETEXP,
-  BUILT_IN_GETMAN,
-  BUILT_IN_SAVEREGS,
-  BUILT_IN_CLASSIFY_TYPE,
-  BUILT_IN_NEXT_ARG,
-  BUILT_IN_ARGS_INFO,
-  BUILT_IN_CONSTANT_P,
-  BUILT_IN_FRAME_ADDRESS,
-  BUILT_IN_RETURN_ADDRESS,
-  BUILT_IN_AGGREGATE_INCOMING_ADDRESS,
-  BUILT_IN_APPLY_ARGS,
-  BUILT_IN_APPLY,
-  BUILT_IN_RETURN,
-  BUILT_IN_SETJMP,
-  BUILT_IN_LONGJMP,
-  BUILT_IN_TRAP,
-
-  /* ISO C99 floating point unordered comparisons.  */
-  BUILT_IN_ISGREATER,
-  BUILT_IN_ISGREATEREQUAL,
-  BUILT_IN_ISLESS,
-  BUILT_IN_ISLESSEQUAL,
-  BUILT_IN_ISLESSGREATER,
-  BUILT_IN_ISUNORDERED,
-
-  /* Various hooks for the DWARF 2 __throw routine.  */
-  BUILT_IN_UNWIND_INIT,
-  BUILT_IN_DWARF_CFA,
-  BUILT_IN_DWARF_FP_REGNUM,
-  BUILT_IN_INIT_DWARF_REG_SIZES,
-  BUILT_IN_FROB_RETURN_ADDR,
-  BUILT_IN_EXTRACT_RETURN_ADDR,
-  BUILT_IN_EH_RETURN,
-
-  BUILT_IN_VARARGS_START,
-  BUILT_IN_STDARG_START,
-  BUILT_IN_VA_END,
-  BUILT_IN_VA_COPY,
-
-  /* C++ extensions */
-  BUILT_IN_NEW,
-  BUILT_IN_VEC_NEW,
-  BUILT_IN_DELETE,
-  BUILT_IN_VEC_DELETE,
+#include "builtins.def"
 
   /* Upper bound on non-language-specific builtins. */
   END_BUILTINS
 };
+#undef DEF_BUILTIN
 
 /* Names for the above.  */
 extern const char *const built_in_names[(int) END_BUILTINS];


More information about the Gcc-patches mailing list