Commit 1290e54c by Nathan Froyd Committed by Nathan Froyd

tree.h (CASE_CHAIN): Define.

	* tree.h (CASE_CHAIN): Define.
	* tree-cfg.c (edge_to_cases_cleanup, get_cases_for_edge): Use it.
	(gimple_redirect_edge_and_branch): Likewise.

From-SVN: r171769
parent bddc98e1
2011-03-30 Nathan Froyd <froydnj@codesourcery.com>
* tree.h (CASE_CHAIN): Define.
* tree-cfg.c (edge_to_cases_cleanup, get_cases_for_edge): Use it.
(gimple_redirect_edge_and_branch): Likewise.
2011-03-30 Vladimir Makarov <vmakarov@redhat.com> 2011-03-30 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/48367 PR middle-end/48367
......
...@@ -838,8 +838,8 @@ edge_to_cases_cleanup (const void *key ATTRIBUTE_UNUSED, void **value, ...@@ -838,8 +838,8 @@ edge_to_cases_cleanup (const void *key ATTRIBUTE_UNUSED, void **value,
for (t = (tree) *value; t; t = next) for (t = (tree) *value; t; t = next)
{ {
next = TREE_CHAIN (t); next = CASE_CHAIN (t);
TREE_CHAIN (t) = NULL; CASE_CHAIN (t) = NULL;
} }
*value = NULL; *value = NULL;
...@@ -922,7 +922,7 @@ get_cases_for_edge (edge e, gimple t) ...@@ -922,7 +922,7 @@ get_cases_for_edge (edge e, gimple t)
/* Add it to the chain of CASE_LABEL_EXPRs referencing E, or create /* Add it to the chain of CASE_LABEL_EXPRs referencing E, or create
a new chain. */ a new chain. */
slot = pointer_map_insert (edge_to_cases, this_edge); slot = pointer_map_insert (edge_to_cases, this_edge);
TREE_CHAIN (elt) = (tree) *slot; CASE_CHAIN (elt) = (tree) *slot;
*slot = elt; *slot = elt;
} }
...@@ -4851,7 +4851,7 @@ gimple_redirect_edge_and_branch (edge e, basic_block dest) ...@@ -4851,7 +4851,7 @@ gimple_redirect_edge_and_branch (edge e, basic_block dest)
{ {
last = cases; last = cases;
CASE_LABEL (cases) = label; CASE_LABEL (cases) = label;
cases = TREE_CHAIN (cases); cases = CASE_CHAIN (cases);
} }
/* If there was already an edge in the CFG, then we need /* If there was already an edge in the CFG, then we need
...@@ -4860,8 +4860,8 @@ gimple_redirect_edge_and_branch (edge e, basic_block dest) ...@@ -4860,8 +4860,8 @@ gimple_redirect_edge_and_branch (edge e, basic_block dest)
{ {
tree cases2 = get_cases_for_edge (e2, stmt); tree cases2 = get_cases_for_edge (e2, stmt);
TREE_CHAIN (last) = TREE_CHAIN (cases2); CASE_CHAIN (last) = CASE_CHAIN (cases2);
TREE_CHAIN (cases2) = first; CASE_CHAIN (cases2) = first;
} }
bitmap_set_bit (touched_switch_bbs, gimple_bb (stmt)->index); bitmap_set_bit (touched_switch_bbs, gimple_bb (stmt)->index);
} }
......
...@@ -1636,6 +1636,7 @@ extern void protected_set_expr_location (tree, location_t); ...@@ -1636,6 +1636,7 @@ extern void protected_set_expr_location (tree, location_t);
#define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0) #define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0)
#define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1) #define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
#define CASE_LABEL(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2) #define CASE_LABEL(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
#define CASE_CHAIN(NODE) TREE_CHAIN (CASE_LABEL_EXPR_CHECK (NODE))
/* The operands of a TARGET_MEM_REF. Operands 0 and 1 have to match /* The operands of a TARGET_MEM_REF. Operands 0 and 1 have to match
corresponding MEM_REF operands. */ corresponding MEM_REF operands. */
......
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