Commit fbf196a2 by Andrew MacLeod Committed by Andrew Macleod

tree-core.h (struct tree_optimization_option): Make opts a pointer to struct cl_optimization.

2015-06-25  Andrew MacLeod  <amacleod@redhat.com>

	* tree-core.h (struct tree_optimization_option): Make opts a pointer to
	struct cl_optimization.
	* tree.h (TREE_OPTIMIZATION): Return the pointer, not the address of it.
	* tree.c (make_node_stat): Allocate cl_optimization struct.
	(copy_node_stat): Allocate and copy cl_optimization struct.

From-SVN: r224952
parent 16a16ec7
2015-06-25 Andrew MacLeod <amacleod@redhat.com> 2015-06-25 Andrew MacLeod <amacleod@redhat.com>
* tree-core.h (struct tree_optimization_option): Make opts a pointer to
struct cl_optimization.
* tree.h (TREE_OPTIMIZATION): Return the pointer, not the address of it.
* tree.c (make_node_stat): Allocate cl_optimization struct.
(copy_node_stat): Allocate and copy cl_optimization struct.
2015-06-25 Andrew MacLeod <amacleod@redhat.com>
* function.h (struct incoming_args): Move struct. * function.h (struct incoming_args): Move struct.
(pass_by_reference, reference_callee_copied): Remove prototypes. (pass_by_reference, reference_callee_copied): Remove prototypes.
* emit-rtl.h (struct incoming_args): Relocate struct here. * emit-rtl.h (struct incoming_args): Relocate struct here.
......
...@@ -1652,7 +1652,7 @@ struct GTY(()) tree_optimization_option { ...@@ -1652,7 +1652,7 @@ struct GTY(()) tree_optimization_option {
struct tree_common common; struct tree_common common;
/* The optimization options used by the user. */ /* The optimization options used by the user. */
struct cl_optimization opts; struct cl_optimization *opts;
/* Target optabs for this set of optimization options. This is of /* Target optabs for this set of optimization options. This is of
type `struct target_optabs *'. */ type `struct target_optabs *'. */
......
...@@ -1095,9 +1095,20 @@ make_node_stat (enum tree_code code MEM_STAT_DECL) ...@@ -1095,9 +1095,20 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
break; break;
case tcc_exceptional: case tcc_exceptional:
if (code == TARGET_OPTION_NODE) switch (code)
{ {
TREE_TARGET_OPTION(t) = ggc_cleared_alloc<struct cl_target_option> (); case TARGET_OPTION_NODE:
TREE_TARGET_OPTION(t)
= ggc_cleared_alloc<struct cl_target_option> ();
break;
case OPTIMIZATION_NODE:
TREE_OPTIMIZATION (t)
= ggc_cleared_alloc<struct cl_optimization> ();
break;
default:
break;
} }
break; break;
...@@ -1188,6 +1199,12 @@ copy_node_stat (tree node MEM_STAT_DECL) ...@@ -1188,6 +1199,12 @@ copy_node_stat (tree node MEM_STAT_DECL)
memcpy (TREE_TARGET_OPTION (t), TREE_TARGET_OPTION (node), memcpy (TREE_TARGET_OPTION (t), TREE_TARGET_OPTION (node),
sizeof (struct cl_target_option)); sizeof (struct cl_target_option));
} }
else if (code == OPTIMIZATION_NODE)
{
TREE_OPTIMIZATION (t) = ggc_alloc<struct cl_optimization>();
memcpy (TREE_OPTIMIZATION (t), TREE_OPTIMIZATION (node),
sizeof (struct cl_optimization));
}
return t; return t;
} }
......
...@@ -2827,7 +2827,7 @@ extern vec<tree, va_gc> **decl_debug_args_insert (tree); ...@@ -2827,7 +2827,7 @@ extern vec<tree, va_gc> **decl_debug_args_insert (tree);
(STATEMENT_LIST_CHECK (NODE)->stmt_list.tail) (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
#define TREE_OPTIMIZATION(NODE) \ #define TREE_OPTIMIZATION(NODE) \
(&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts) (OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
#define TREE_OPTIMIZATION_OPTABS(NODE) \ #define TREE_OPTIMIZATION_OPTABS(NODE) \
(OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs) (OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment