#include "jcf.h"
#include "java-except.h"
#include "parse.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "ggc.h"
#include "tree-iterator.h"
if (*as_pp)
return;
- *as_pp = ggc_alloc (sizeof (type_assertion));
+ *as_pp = ggc_alloc_type_assertion ();
**(type_assertion **)as_pp = as;
}
tree save_field;
int i;
- for (field = TYPE_FIELDS (*typep); field; field = TREE_CHAIN (field))
+ for (field = TYPE_FIELDS (*typep); field; field = DECL_CHAIN (field))
if (DECL_NAME (field) == name)
return field;
char buf[32];
if (pc > highest_label_pc_this_method)
highest_label_pc_this_method = pc;
- ASM_GENERATE_INTERNAL_LABEL(buf, "LJpc=", start_label_pc_this_method + pc);
+ targetm.asm_out.generate_internal_label (buf, "LJpc=",
+ start_label_pc_this_method + pc);
name = get_identifier (buf);
if (IDENTIFIER_LOCAL_VALUE (name))
return IDENTIFIER_LOCAL_VALUE (name);
{
static int l_number = 0;
char buff [32];
- ASM_GENERATE_INTERNAL_LABEL(buff, "LJv", l_number);
+ targetm.asm_out.generate_internal_label (buff, "LJv", l_number);
l_number++;
return get_identifier (buff);
}
if (TREE_CODE (block) == BIND_EXPR)
{
tree body = BIND_EXPR_BODY (block);
- TREE_CHAIN (ite->value) = BIND_EXPR_VARS (block);
+ DECL_CHAIN (ite->value) = BIND_EXPR_VARS (block);
BIND_EXPR_VARS (block) = ite->value;
body = build2 (COMPOUND_EXPR, void_type_node,
build1 (DECL_EXPR, void_type_node, ite->value), body);
lookup_field (&class_type_node, methods_ident),
NULL_TREE);
for (meth = TYPE_METHODS (self_type);
- ; meth = TREE_CHAIN (meth))
+ ; meth = DECL_CHAIN (meth))
{
if (method == meth)
break;
reused. */
int
-get_symbol_table_index (tree t, tree special, tree *symbol_table)
+get_symbol_table_index (tree t, tree special,
+ VEC(method_entry,gc) **symbol_table)
{
- int i = 1;
- tree method_list;
+ method_entry *e;
+ unsigned i;
- if (*symbol_table == NULL_TREE)
- {
- *symbol_table = build_tree_list (special, t);
- return 1;
- }
-
- method_list = *symbol_table;
-
- while (1)
- {
- tree value = TREE_VALUE (method_list);
- tree purpose = TREE_PURPOSE (method_list);
- if (value == t && purpose == special)
- return i;
- i++;
- if (TREE_CHAIN (method_list) == NULL_TREE)
- break;
- else
- method_list = TREE_CHAIN (method_list);
- }
+ FOR_EACH_VEC_ELT (method_entry, *symbol_table, i, e)
+ if (t == e->method && special == e->special)
+ goto done;
+
+ e = VEC_safe_push (method_entry, gc, *symbol_table, NULL);
+ e->method = t;
+ e->special = special;
- TREE_CHAIN (method_list) = build_tree_list (special, t);
- return i;
+ done:
+ return i + 1;
}
tree
res_var = build_decl (input_location, VAR_DECL, get_identifier ("res"),
TREE_TYPE (TREE_TYPE (method)));
DECL_CONTEXT (res_var) = method;
- TREE_CHAIN (env_var) = res_var;
+ DECL_CHAIN (env_var) = res_var;
}
method_args = DECL_ARGUMENTS (method);
/* All the arguments to this method become arguments to the
underlying JNI function. If we had to wrap object arguments in a
special way, we would do that here. */
- for (tem = method_args; tem != NULL_TREE; tem = TREE_CHAIN (tem))
+ for (tem = method_args; tem != NULL_TREE; tem = DECL_CHAIN (tem))
{
int arg_bits = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (tem)));
#ifdef PARM_BOUNDARY
int i;
tree arg;
for (arg = DECL_ARGUMENTS (current_function_decl), i = 0;
- arg != NULL_TREE; arg = TREE_CHAIN (arg), i++)
+ arg != NULL_TREE; arg = DECL_CHAIN (arg), i++)
{
tree arg_type = TREE_TYPE (arg);
if (INTEGRAL_TYPE_P (arg_type)