summaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h90
1 files changed, 68 insertions, 22 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index b656e1bfa48..1e2ecd070ef 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2599,13 +2599,6 @@ struct tree_memory_partition_tag GTY(())
a C99 "extern inline" function. */
#define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_2)
-/* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority
- initializations. */
-#define DEFAULT_INIT_PRIORITY 65535
-#define MAX_INIT_PRIORITY 65535
-#define MAX_RESERVED_INIT_PRIORITY 100
-
-
/* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
@@ -3065,20 +3058,46 @@ extern void decl_debug_expr_insert (tree, tree);
#define SET_DECL_DEBUG_EXPR(NODE, VAL) \
(decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
+/* An initializationp priority. */
+typedef unsigned short priority_type;
-extern unsigned short decl_init_priority_lookup (tree);
-extern void decl_init_priority_insert (tree, unsigned short);
-
-/* In a non-local VAR_DECL with static storage duration, this is the
- initialization priority. If this value is zero, the NODE will be
- initialized at the DEFAULT_INIT_PRIORITY. Only used by C++ FE*/
+extern priority_type decl_init_priority_lookup (tree);
+extern priority_type decl_fini_priority_lookup (tree);
+extern void decl_init_priority_insert (tree, priority_type);
+extern void decl_fini_priority_insert (tree, priority_type);
+/* In a non-local VAR_DECL with static storage duration, true if the
+ variable has an initialization priority. If false, the variable
+ will be initialized at the DEFAULT_INIT_PRIORITY. */
#define DECL_HAS_INIT_PRIORITY_P(NODE) \
(VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
+
+/* For a VAR_DECL or FUNCTION_DECL with DECL_HAS_INIT_PRIORITY_P set,
+ the initialization priority of NODE. */
#define DECL_INIT_PRIORITY(NODE) \
- (decl_init_priority_lookup (VAR_DECL_CHECK (NODE)))
+ (decl_init_priority_lookup (NODE))
+/* Set the initialization priority for NODE to VAL. */
#define SET_DECL_INIT_PRIORITY(NODE, VAL) \
- (decl_init_priority_insert (VAR_DECL_CHECK (NODE), VAL))
+ (decl_init_priority_insert (NODE, VAL))
+
+/* For a FUNCTION_DECL with DECL_HAS_INIT_PRIORITY_P set, the
+ finalization priority of NODE. */
+#define DECL_FINI_PRIORITY(NODE) \
+ (decl_fini_priority_lookup (NODE))
+/* Set the finalization priority for NODE to VAL. */
+#define SET_DECL_FINI_PRIORITY(NODE, VAL) \
+ (decl_fini_priority_insert (NODE, VAL))
+
+/* The initialization priority for entities for which no explicit
+ initialization priority has been specified. */
+#define DEFAULT_INIT_PRIORITY 65535
+
+/* The maximum allowed initialization priority. */
+#define MAX_INIT_PRIORITY 65535
+
+/* The largest priority value reserved for use by system runtime
+ libraries. */
+#define MAX_RESERVED_INIT_PRIORITY 100
/* In a VAR_DECL, the model to use if the data should be allocated from
thread-local storage. */
@@ -4800,26 +4819,53 @@ extern tree get_base_address (tree t);
extern void vect_set_verbosity_level (const char *);
/* In tree.c. */
+
+struct tree_map_base GTY(())
+{
+ tree from;
+};
+
+extern int tree_map_base_eq (const void *, const void *);
+extern unsigned int tree_map_base_hash (const void *);
+extern int tree_map_base_marked_p (const void *);
+
+/* Map from a tree to another tree. */
+
struct tree_map GTY(())
{
+ struct tree_map_base base;
unsigned int hash;
- tree from;
tree to;
};
+#define tree_map_eq tree_map_base_eq
extern unsigned int tree_map_hash (const void *);
-extern int tree_map_marked_p (const void *);
-extern int tree_map_eq (const void *, const void *);
+#define tree_map_marked_p tree_map_base_marked_p
+
+/* Map from a tree to an int. */
struct tree_int_map GTY(())
{
- tree from;
+ struct tree_map_base base;
unsigned int to;
};
-extern unsigned int tree_int_map_hash (const void *);
-extern int tree_int_map_eq (const void *, const void *);
-extern int tree_int_map_marked_p (const void *);
+#define tree_int_map_eq tree_map_base_eq
+#define tree_int_map_hash tree_map_base_hash
+#define tree_int_map_marked_p tree_map_base_marked_p
+
+/* Map from a tree to initialization/finalization priorities. */
+
+struct tree_priority_map GTY(())
+{
+ struct tree_map_base base;
+ priority_type init;
+ priority_type fini;
+};
+
+#define tree_priority_map_eq tree_map_base_eq
+#define tree_priority_map_hash tree_map_base_hash
+#define tree_priority_map_marked_p tree_map_base_marked_p
/* In tree-ssa-address.c. */
extern tree tree_mem_ref_addr (tree, tree);