+2003-05-09 Tim Josling <tej@melbpc.org.au>
+
+ * Make-lang.in (TREE_BE_LIBS): Add C_TARGET_OBJS to object files
+ to link (needed by some front ends such as PPC).
+
+ * treetree.c (tree_code_create_function_initial): Fix long line.
+ Initialize tree_code_int_size and tree_code_char_size to
+ meaningful values.
+ (tree_code_get_numeric_type): Add check that size1 parameter is
+ valid.
+
+ * parse.y: Fix extra long lines in prototypes.
+
+ * treelang.h: Fix extra long lines in macro definitions.
+
2003-05-07 Zack Weinberg <zack@codesourcery.com>
* Make-lang.in: Set -Wno-error for treelang/lex.o.
TREELANGSEDFLAGS = -n
# back end compiler libraries etc
-TREE_BE_LIBS = $(BACKEND) $(LIBIBERTY) $(INTLLIBS) $(LIBS) $(LIBDEPS)
+TREE_BE_LIBS = $(C_TARGET_OBJS) $(BACKEND) $(LIBIBERTY) $(INTLLIBS) $(LIBS) $(LIBDEPS)
GCC_EXTRAS = -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
# ./xgcc is the just built compiler. See GCC_FOR_TARGET in the GCC Makefile.in.
static struct prod_token_parm_item *reverse_prod_list (struct prod_token_parm_item *old_first);
static void ensure_not_void (unsigned int type, struct prod_token_parm_item* name);
static int check_type_match (int type_num, struct prod_token_parm_item *exp);
-static int get_common_type (struct prod_token_parm_item *type1, struct prod_token_parm_item *type2);
+static int get_common_type (struct prod_token_parm_item *type1,
+ struct prod_token_parm_item *type2);
static struct prod_token_parm_item *make_integer_constant (struct prod_token_parm_item* value);
static struct prod_token_parm_item *make_plus_expression
(struct prod_token_parm_item* tok, struct prod_token_parm_item* op1,
abort ();
this_parms->tp.par.variable_name = this_parm_var->tp.pro.main_token->tp.tok.chars;
this_parms->category = parameter_category;
- this_parms->type = NUMERIC_TYPE (( (struct prod_token_parm_item*)EXPRESSION_TYPE (this_parm_var)));
+ this_parms->type = NUMERIC_TYPE
+ (( (struct prod_token_parm_item*)EXPRESSION_TYPE (this_parm_var)));
if (last_parms)
{
last_parms->tp.par.next = this_parms;
/* Definitions for fields in production. */
#define NESTING_LEVEL(a) a->tp.pro.info[0] /* Level used for variable definitions. */
-#define NUMERIC_TYPE(a) a->tp.pro.info[1] /* Numeric type used in type definitions and expressions. */
+/* Numeric type used in type definitions and expressions. */
+#define NUMERIC_TYPE(a) a->tp.pro.info[1]
#define SUB_COUNT 5
#define SYMBOL_TABLE_NAME(a) (a->tp.pro.sub[0]) /* Name token. */
#define EXPRESSION_TYPE(a) (a->tp.pro.sub[1]) /* Type identifier. */
#define VARIABLE(a) (a->tp.pro.sub[2]) /* Parameter variable ptr. */
#define VAR_INIT(a) (a->tp.pro.sub[2]) /* Variable init. */
#define OP2(a) (a->tp.pro.sub[3]) /* Exp operand2. */
-#define FIRST_PARMS(a) (a->tp.pro.sub[3]) /* Function parameters linked via struct tree_parameter_list. */
+/* Function parameters linked via struct tree_parameter_list. */
+#define FIRST_PARMS(a) (a->tp.pro.sub[3])
#define OP3(a) (a->tp.pro.sub[4]) /* Exp operand3. */
#define STORAGE_CLASS_TOKEN(a) (a->tp.pro.sub[4]) /* Storage class token. */
#define STORAGE_CLASS(a) a->tp.pro.flag1 /* Values in treetree.h. */
/* Number of bits in int and char - accessed by front end. */
-unsigned int tree_code_int_size = 0;
-unsigned int tree_code_char_size = 0;
+unsigned int tree_code_int_size = SIZEOF_INT * HOST_BITS_PER_CHAR;
+
+unsigned int tree_code_char_size = HOST_BITS_PER_CHAR;
/* Return the tree stuff for this type TYPE_NUM. */
/* Prepare creation of rtl for a new function. */
- resultdecl = DECL_RESULT (fn_decl) = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (fn_decl)));
+ resultdecl = DECL_RESULT (fn_decl)
+ = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (fn_decl)));
DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
DECL_SOURCE_LOCATION (resultdecl) = loc;
tree_code_get_numeric_type (unsigned int size1, unsigned int sign1)
{
tree ret1;
+ if (!size1)
+ abort ();
if (size1 == tree_code_int_size)
{
if (sign1)