summaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-13 04:18:54 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-13 04:18:54 +0000
commit194ae0744d9ec812e57a339aec6e5a285f21475f (patch)
treef0bf0eacf8ffa54f821595a192ad4a94667a8d45 /gcc/tree.h
parent5dea86897277316778ac91cd98b2ed698937109b (diff)
downloadgcc-194ae0744d9ec812e57a339aec6e5a285f21475f.tar.gz
* tree-cfg.c (hashtab.h): Include.
(struct edge_to_case_leader_elt): New structure. (edge_to_case_leader): New. (edge_to_case_leader_hash): New hashtable hasing function. (edge_to_case_leader_eq): New hashtable equality function. (record_switch_edge): New function. (get_case_leader_for_edge, get_case_leader_for_edge): New functions. (make_switch_expr_edges): Build the edge-to-case-leader hash table. Tear down the hash table when we're done. (cleanup_dead_labels): Use CASE_LEADER_OR_LABEL instead of CASE_LABEL. (tree_node_can_be_shared): Allow sharing of CASE_LABEL_EXPR nodes. (tree_redirect_edge_and_branch, case SWITCH_EXPR): Update to use new concept of case leaders to reduce overhead of redirecting outgoing edges from switch statements. * tree.c (get_case_label): New function. * tree.h (CASE_LABEL): Define in terms of get_case_label. (CASE_LEADER_OR_LABEL): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90570 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 105966a262c..e79470001cd 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1229,9 +1229,17 @@ struct tree_vec GTY(())
/* CASE_LABEL_EXPR accessors. These give access to the high and low values
of a case label, respectively. */
-#define CASE_LOW(NODE) TREE_OPERAND ((NODE), 0)
-#define CASE_HIGH(NODE) TREE_OPERAND ((NODE), 1)
-#define CASE_LABEL(NODE) TREE_OPERAND ((NODE), 2)
+#define CASE_LOW(NODE) TREE_OPERAND ((NODE), 0)
+#define CASE_HIGH(NODE) TREE_OPERAND ((NODE), 1)
+
+/* Operand 2 has two uses, it may either be a LABEL_DECL node or a
+ another CASE_LABEL_EXPR node. This accessor gets direct access
+ to that operand. Use it when you want to assign a value to
+ operand 2 or when you want to conditionalalize actions based on
+ whether operand 2 is a LABEL_DELC or CASE_LABEL_EXPR. */
+#define CASE_LEADER_OR_LABEL(NODE) TREE_OPERAND ((NODE), 2)
+
+#define CASE_LABEL(NODE) get_case_label (NODE)
/* The operands of a BIND_EXPR. */
#define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
@@ -3455,6 +3463,7 @@ extern void change_decl_assembler_name (tree, tree);
extern int type_num_arguments (tree);
extern bool associative_tree_code (enum tree_code);
extern bool commutative_tree_code (enum tree_code);
+extern tree get_case_label (tree);
/* In stmt.c */