This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Remove __builtin_classify_type and typeclass.h
- From: Phil Edwards <phil at jaj dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 8 Mar 2003 20:12:03 -0500
- Subject: Remove __builtin_classify_type and typeclass.h
The typeclass.h header exists only to support __builtin_classify_type,
which used to be used for implementing variable argument lists, but is no
longer used in any platform's implementation. Any reason to keep it?
Bootstrapped on athlon/linux, also passes "make doc", no regressions.
2003-03-08 Phil Edwards <pme at gcc dot gnu dot org>
* Makefile.in: Remove typeclass.h.
* builtins.c: Remove typeclass.h.
(expand_builtin_classify_type, fold_builtin_classify_type,
type_to_class): Remove.
(expand_builtin, fold_builtin): Remove BUILT_IN_CLASSIFY_TYPE case.
* builtins.def: Remove __builtin_classify_type.
* expr.c: Remove typeclass.h.
* typeclass.h: Delete.
* doc/tm.texi: Remove paragraphs concerning __builtin_classify_type.
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1012
diff -u -3 -p -r1.1012 Makefile.in
--- Makefile.in 8 Mar 2003 18:24:18 -0000 1.1012
+++ Makefile.in 9 Mar 2003 01:06:59 -0000
@@ -1481,11 +1481,11 @@ except.o : except.c $(CONFIG_H) $(SYSTEM
gt-except.h
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.h \
- $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
+ $(RECOG_H) output.h hard-reg-set.h toplev.h hard-reg-set.h \
except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h
builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H)\
flags.h $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
- $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
+ $(RECOG_H) output.h hard-reg-set.h toplev.h hard-reg-set.h \
except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
$(EXPR_H) langhooks.h $(TARGET_H) \
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.181
diff -u -3 -p -r1.181 builtins.c
--- builtins.c 26 Feb 2003 23:09:58 -0000 1.181
+++ builtins.c 9 Mar 2003 01:07:00 -0000
@@ -38,7 +38,6 @@ Software Foundation, 59 Temple Place - S
#include "libfuncs.h"
#include "recog.h"
#include "output.h"
-#include "typeclass.h"
#include "toplev.h"
#include "predict.h"
#include "tm_p.h"
@@ -98,7 +97,6 @@ static rtx expand_builtin_apply_args_1 P
static rtx expand_builtin_apply PARAMS ((rtx, rtx, rtx));
static void expand_builtin_return PARAMS ((rtx));
static enum type_class type_to_class PARAMS ((tree));
-static rtx expand_builtin_classify_type PARAMS ((tree));
static void expand_errno_check PARAMS ((tree, rtx));
static rtx expand_builtin_mathfn PARAMS ((tree, rtx, rtx));
static rtx expand_builtin_mathfn_2 PARAMS ((tree, rtx, rtx));
@@ -155,7 +153,6 @@ static rtx expand_builtin_fputs PARAMS
static tree stabilize_va_list PARAMS ((tree, int));
static rtx expand_builtin_expect PARAMS ((tree, rtx));
static tree fold_builtin_constant_p PARAMS ((tree));
-static tree fold_builtin_classify_type PARAMS ((tree));
static tree fold_builtin_inf PARAMS ((tree, int));
static tree fold_builtin_nan PARAMS ((tree, tree, int));
static int validate_arglist PARAMS ((tree, ...));
@@ -1409,50 +1406,6 @@ expand_builtin_return (result)
expand_null_return ();
}
-/* Used by expand_builtin_classify_type and fold_builtin_classify_type. */
-
-static enum type_class
-type_to_class (type)
- tree type;
-{
- switch (TREE_CODE (type))
- {
- case VOID_TYPE: return void_type_class;
- case INTEGER_TYPE: return integer_type_class;
- case CHAR_TYPE: return char_type_class;
- case ENUMERAL_TYPE: return enumeral_type_class;
- case BOOLEAN_TYPE: return boolean_type_class;
- case POINTER_TYPE: return pointer_type_class;
- case REFERENCE_TYPE: return reference_type_class;
- case OFFSET_TYPE: return offset_type_class;
- case REAL_TYPE: return real_type_class;
- case COMPLEX_TYPE: return complex_type_class;
- case FUNCTION_TYPE: return function_type_class;
- case METHOD_TYPE: return method_type_class;
- case RECORD_TYPE: return record_type_class;
- case UNION_TYPE:
- case QUAL_UNION_TYPE: return union_type_class;
- case ARRAY_TYPE: return (TYPE_STRING_FLAG (type)
- ? string_type_class : array_type_class);
- case SET_TYPE: return set_type_class;
- case FILE_TYPE: return file_type_class;
- case LANG_TYPE: return lang_type_class;
- default: return no_type_class;
- }
-}
-
-/* Expand a call to __builtin_classify_type with arguments found in
- ARGLIST. */
-
-static rtx
-expand_builtin_classify_type (arglist)
- tree arglist;
-{
- if (arglist != 0)
- return GEN_INT (type_to_class (TREE_TYPE (TREE_VALUE (arglist))));
- return GEN_INT (no_type_class);
-}
-
/* Expand expression EXP, which is a call to __builtin_constant_p. */
static rtx
@@ -4225,9 +4178,6 @@ expand_builtin (exp, target, subtarget,
case BUILT_IN_NEXT_ARG:
return expand_builtin_next_arg (arglist);
- case BUILT_IN_CLASSIFY_TYPE:
- return expand_builtin_classify_type (arglist);
-
case BUILT_IN_CONSTANT_P:
return expand_builtin_constant_p (exp);
@@ -4584,18 +4534,6 @@ fold_builtin_constant_p (arglist)
return 0;
}
-/* Fold a call to __builtin_classify_type. */
-
-static tree
-fold_builtin_classify_type (arglist)
- tree arglist;
-{
- if (arglist == 0)
- return build_int_2 (no_type_class, 0);
-
- return build_int_2 (type_to_class (TREE_TYPE (TREE_VALUE (arglist))), 0);
-}
-
/* Fold a call to __builtin_inf or __builtin_huge_val. */
static tree
@@ -4683,9 +4621,6 @@ fold_builtin (exp)
{
case BUILT_IN_CONSTANT_P:
return fold_builtin_constant_p (arglist);
-
- case BUILT_IN_CLASSIFY_TYPE:
- return fold_builtin_classify_type (arglist);
case BUILT_IN_STRLEN:
if (validate_arglist (arglist, POINTER_TYPE, VOID_TYPE))
Index: builtins.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.def,v
retrieving revision 1.45
diff -u -3 -p -r1.45 builtins.def
--- builtins.def 2 Mar 2003 01:34:33 -0000 1.45
+++ builtins.def 9 Mar 2003 01:07:01 -0000
@@ -654,10 +654,6 @@ DEF_GCC_BUILTIN(BUILT_IN_SAVEREGS,
"__builtin_saveregs",
BT_FN_PTR_VAR,
ATTR_NULL)
-DEF_GCC_BUILTIN(BUILT_IN_CLASSIFY_TYPE,
- "__builtin_classify_type",
- BT_FN_INT_VAR,
- ATTR_NULL)
DEF_GCC_BUILTIN(BUILT_IN_NEXT_ARG,
"__builtin_next_arg",
BT_FN_PTR_VAR,
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.510
diff -u -3 -p -r1.510 expr.c
--- expr.c 5 Mar 2003 00:12:40 -0000 1.510
+++ expr.c 9 Mar 2003 01:07:04 -0000
@@ -41,7 +41,6 @@ Software Foundation, 59 Temple Place - S
#include "recog.h"
#include "reload.h"
#include "output.h"
-#include "typeclass.h"
#include "toplev.h"
#include "ggc.h"
#include "langhooks.h"
Index: typeclass.h
===================================================================
RCS file: typeclass.h
diff -N typeclass.h
--- typeclass.h 16 Dec 1998 20:58:40 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-/* Values returned by __builtin_classify_type. */
-
-enum type_class
-{
- no_type_class = -1,
- void_type_class, integer_type_class, char_type_class,
- enumeral_type_class, boolean_type_class,
- pointer_type_class, reference_type_class, offset_type_class,
- real_type_class, complex_type_class,
- function_type_class, method_type_class,
- record_type_class, union_type_class,
- array_type_class, string_type_class, set_type_class, file_type_class,
- lang_type_class
-};
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.206
diff -u -3 -p -r1.206 tm.texi
--- doc/tm.texi 5 Mar 2003 22:37:52 -0000 1.206
+++ doc/tm.texi 9 Mar 2003 01:07:08 -0000
@@ -4404,21 +4404,6 @@ argument. Use it in @code{va_start} to
fetching arguments from the stack. Also use it in @code{va_start} to
verify that the second parameter @var{lastarg} is the last named argument
of the current function.
-
- at findex __builtin_classify_type
- at item __builtin_classify_type (@var{object})
-Since each machine has its own conventions for which data types are
-passed in which kind of register, your implementation of @code{va_arg}
-has to embody these conventions. The easiest way to categorize the
-specified data type is to use @code{__builtin_classify_type} together
-with @code{sizeof} and @code{__alignof__}.
-
- at code{__builtin_classify_type} ignores the value of @var{object},
-considering only its data type. It returns an integer describing what
-kind of type that is---integer, floating, pointer, structure, and so on.
-
-The file @file{typeclass.h} defines an enumeration that you can use to
-interpret the values of @code{__builtin_classify_type}.
@end table
These machine description macros help implement varargs: