#include "vec.h"
#include "double-int.h"
#include "alias.h"
+#include "options.h"
/* Codes of tree nodes */
#define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
+#define END_OF_BASE_TREE_CODES LAST_AND_UNUSED_TREE_CODE,
enum tree_code {
-#include "tree.def"
-
- LAST_AND_UNUSED_TREE_CODE /* A convenient way to get a value for
- NUM_TREE_CODES. */
+#include "all-tree.def"
+MAX_TREE_CODES
};
#undef DEFTREECODE
+#undef END_OF_BASE_TREE_CODES
-#define MAX_TREE_CODES 512
extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
#define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
but usually no interesting value. */
tcc_vl_exp, /* A function call or other expression with a
variable-length operand vector. */
- tcc_expression, /* Any other expression. */
- tcc_gimple_stmt /* A GIMPLE statement. */
+ tcc_expression /* Any other expression. */
};
/* Each tree code class has an associated string representation.
#define IS_EXPR_CODE_CLASS(CLASS)\
((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
-/* Returns nonzero iff CLASS is a GIMPLE statement. */
-
-#define IS_GIMPLE_STMT_CODE_CLASS(CLASS) ((CLASS) == tcc_gimple_stmt)
-
/* Returns nonzero iff NODE is an expression of some kind. */
#define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
-/* Returns nonzero iff NODE is an OpenMP directive. */
-
-#define OMP_DIRECTIVE_P(NODE) \
- (TREE_CODE (NODE) == OMP_PARALLEL \
- || TREE_CODE (NODE) == OMP_TASK \
- || TREE_CODE (NODE) == OMP_FOR \
- || TREE_CODE (NODE) == OMP_SECTIONS \
- || TREE_CODE (NODE) == OMP_SECTIONS_SWITCH \
- || TREE_CODE (NODE) == OMP_SINGLE \
- || TREE_CODE (NODE) == OMP_SECTION \
- || TREE_CODE (NODE) == OMP_MASTER \
- || TREE_CODE (NODE) == OMP_ORDERED \
- || TREE_CODE (NODE) == OMP_CRITICAL \
- || TREE_CODE (NODE) == OMP_RETURN \
- || TREE_CODE (NODE) == OMP_ATOMIC_LOAD \
- || TREE_CODE (NODE) == OMP_ATOMIC_STORE \
- || TREE_CODE (NODE) == OMP_CONTINUE)
-
/* Number of argument-words in each kind of tree-node. */
extern const unsigned char tree_code_length[];
unsigned spare : 23;
- /* FIXME tuples: Eventually, we need to move this somewhere external to
- the trees. */
union tree_ann_d *ann;
};
tree type;
};
-/* GIMPLE_MODIFY_STMT */
-struct gimple_stmt GTY(())
-{
- struct tree_base base;
- location_t locus;
- tree block;
- /* FIXME tuples: Eventually this should be of type ``struct gimple_expr''. */
- tree GTY ((length ("TREE_CODE_LENGTH (TREE_CODE (&%h))"))) operands[1];
-};
-
/* The following table lists the uses of each of the above flags and
for which types of nodes they are defined.
POINTER_TYPE, REFERENCE_TYPE
MOVE_NONTEMPORAL in
- GIMPLE_MODIFY_STMT
+ MODIFY_EXPR
CASE_HIGH_SEEN in
CASE_LABEL_EXPR
DECL_BY_REFERENCE in
PARM_DECL, RESULT_DECL
- OMP_RETURN_NOWAIT in
- OMP_RETURN
-
OMP_SECTION_LAST in
OMP_SECTION
__FUNCTION__); \
__t; })
-#define GIMPLE_STMT_CHECK(T) __extension__ \
-({ __typeof (T) const __t = (T); \
- char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \
- if (!IS_GIMPLE_STMT_CODE_CLASS (__c)) \
- tree_class_check_failed (__t, tcc_gimple_stmt, __FILE__, __LINE__,\
- __FUNCTION__); \
- __t; })
-
/* These checks have to be special cased. */
#define NON_TYPE_CHECK(T) __extension__ \
({ __typeof (T) const __t = (T); \
__FILE__, __LINE__, __FUNCTION__); \
&__t->vec.a[__i]; }))
-#define PHI_NODE_ELT_CHECK(T, I) __extension__ \
-(*({__typeof (T) const __t = (T); \
- const int __i = (I); \
- if (TREE_CODE (__t) != PHI_NODE) \
- tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
- PHI_NODE, 0); \
- if (__i < 0 || __i >= __t->phi.capacity) \
- phi_node_elt_check_failed (__i, __t->phi.num_args, \
- __FILE__, __LINE__, __FUNCTION__); \
- &__t->phi.a[__i]; }))
-
#define OMP_CLAUSE_ELT_CHECK(T, I) __extension__ \
(*({__typeof (T) const __t = (T); \
const int __i = (I); \
#define TREE_OPERAND_CHECK(T, I) __extension__ \
(*({__typeof (T) const __t = EXPR_CHECK (T); \
const int __i = (I); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \
tree_operand_check_failed (__i, __t, \
__FILE__, __LINE__, __FUNCTION__); \
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
-/* Special checks for GIMPLE_STMT_OPERANDs. */
-#define GIMPLE_STMT_OPERAND_CHECK(T, I) __extension__ \
-(*({__typeof (T) const __t = GIMPLE_STMT_CHECK (T); \
- const int __i = (I); \
- if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \
- tree_operand_check_failed (__i, __t, \
- __FILE__, __LINE__, __FUNCTION__); \
- &__t->gstmt.operands[__i]; }))
-
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \
(*(rtx *) \
({__typeof (T) const __t = (T); \
#define TREE_CHAIN(NODE) __extension__ \
(*({__typeof (NODE) const __t = (NODE); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
&__t->common.chain; }))
/* In all nodes that are expressions, this is the data type of the expression.
In VECTOR_TYPE nodes, this is the type of the elements. */
#define TREE_TYPE(NODE) __extension__ \
(*({__typeof (NODE) const __t = (NODE); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
&__t->common.type; }))
extern void tree_contains_struct_check_failed (const_tree,
#define TREE_CLASS_CHECK(T, CODE) (T)
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define EXPR_CHECK(T) (T)
-#define GIMPLE_STMT_CHECK(T) (T)
#define NON_TYPE_CHECK(T) (T)
#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
-#define GIMPLE_STMT_OPERAND_CHECK(T, I) ((T)->gstmt.operands[I])
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
-#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \
FIXED_POINT_TYPE)
-/* Nonzero if NODE is a GIMPLE statement. */
-#define GIMPLE_STMT_P(NODE) \
- (TREE_CODE_CLASS (TREE_CODE ((NODE))) == tcc_gimple_stmt)
-
-/* Nonzero if NODE is a GIMPLE tuple. */
-#define GIMPLE_TUPLE_P(NODE) (GIMPLE_STMT_P (NODE) || TREE_CODE (NODE) == PHI_NODE)
-
-/* A GIMPLE tuple that has a ``locus'' field. */
-#define GIMPLE_TUPLE_HAS_LOCUS_P(NODE) GIMPLE_STMT_P ((NODE))
-
-/* Like TREE_OPERAND but works with GIMPLE stmt tuples as well.
-
- If you know the NODE is a GIMPLE statement, use GIMPLE_STMT_OPERAND. If the
- NODE code is unknown at compile time, use this macro. */
-#define GENERIC_TREE_OPERAND(NODE, I) *(generic_tree_operand ((NODE), (I)))
-
-/* Like TREE_TYPE but returns void_type_node for gimple tuples that have
- no type. */
-
-#define GENERIC_TREE_TYPE(NODE) *(generic_tree_type ((NODE)))
-
/* Here is how primitive or already-canonicalized types' hash codes
are made. */
#define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
used in hash tables which are saved to a PCH. */
#define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
-/* The TREE_CHAIN but it is able to handle tuples. */
-#define GENERIC_NEXT(NODE) \
- (TREE_CODE (NODE) == PHI_NODE ? PHI_CHAIN (NODE) : \
- GIMPLE_STMT_P (NODE) ? NULL_TREE : TREE_CHAIN (NODE))
-
-/* Tests if expression is conversion expr (NOP_EXPRs or CONVERT_EXPRs). */
+/* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */
+#define CONVERT_EXPR_CODE_P(CODE) \
+ ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR)
-#define CONVERT_EXPR_P(EXP) \
- (TREE_CODE (EXP) == NOP_EXPR \
- || TREE_CODE (EXP) == CONVERT_EXPR)
+/* Similarly, but accept an expressions instead of a tree code. */
+#define CONVERT_EXPR_P(EXP) CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
/* Generate case for NOP_EXPR, CONVERT_EXPR. */
|| TREE_CODE (EXP) == NON_LVALUE_EXPR) \
&& TREE_OPERAND (EXP, 0) != error_mark_node \
&& (TYPE_MODE (TREE_TYPE (EXP)) \
- == TYPE_MODE (GENERIC_TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
+ == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
(EXP) = TREE_OPERAND (EXP, 0)
/* Like STRIP_NOPS, but don't let the signedness change either. */
/* In a MODIFY_EXPR, means that the store in the expression is nontemporal. */
#define MOVE_NONTEMPORAL(NODE) \
- (GIMPLE_MODIFY_STMT_CHECK (NODE)->base.static_flag)
+ (EXPR_CHECK (NODE)->base.static_flag)
/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
there was an overflow in folding. */
/* In a CONSTRUCTOR node. */
#define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
+#define CONSTRUCTOR_ELT(NODE,IDX) \
+ (VEC_index (constructor_elt, CONSTRUCTOR_ELTS (NODE), IDX))
+#define CONSTRUCTOR_NELTS(NODE) (VEC_length (constructor_elt, CONSTRUCTOR_ELTS (NODE)))
/* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding the
value of each element (stored within VAL). IX must be a scratch variable
#define VL_EXP_OPERAND_LENGTH(NODE) \
((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0]))
-/* In gimple statements. */
-#define GIMPLE_STMT_OPERAND(NODE, I) GIMPLE_STMT_OPERAND_CHECK (NODE, I)
-#define GIMPLE_STMT_LOCUS(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.locus)
-#define GIMPLE_STMT_BLOCK(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.block)
-
/* In a LOOP_EXPR node. */
#define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
/* The source location of this expression. Non-tree_exp nodes such as
decls and constants can be shared among multiple locations, so
return nothing. */
-#define EXPR_LOCATION(NODE) expr_location ((NODE))
-#define SET_EXPR_LOCATION(NODE, FROM) set_expr_location ((NODE), (FROM))
-#define EXPR_HAS_LOCATION(NODE) expr_has_location ((NODE))
-#define EXPR_LOCUS(NODE) expr_locus ((NODE))
+#define EXPR_LOCATION(NODE) (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
+#define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
+#define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
+#define EXPR_LOCUS(NODE) (EXPR_P (NODE) \
+ ? CONST_CAST (source_location *, &(NODE)->exp.locus) \
+ : (source_location *) NULL)
#define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM))
-#define EXPR_FILENAME(NODE) (expr_filename ((NODE)))
-#define EXPR_LINENO(NODE) (expr_lineno ((NODE)))
+#define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
+#define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
/* True if a tree is an expression or statement that can have a
location. */
-#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE) || GIMPLE_STMT_P (NODE))
+#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE))
+
+extern void protected_set_expr_location (tree, location_t);
/* In a TARGET_EXPR node. */
#define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
#define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
#define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
-#define OMP_PARALLEL_FN(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 2)
-#define OMP_PARALLEL_DATA_ARG(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 3)
#define OMP_TASK_BODY(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 0)
#define OMP_TASK_CLAUSES(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 1)
-#define OMP_TASK_FN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 2)
-#define OMP_TASK_DATA_ARG(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 3)
-#define OMP_TASK_COPYFN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 4)
-#define OMP_TASK_ARG_SIZE(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 5)
-#define OMP_TASK_ARG_ALIGN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 6)
#define OMP_TASKREG_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_TASK)
#define OMP_TASKREG_BODY(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 0)
#define OMP_TASKREG_CLAUSES(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 1)
-#define OMP_TASKREG_FN(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 2)
-#define OMP_TASKREG_DATA_ARG(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 3)
#define OMP_FOR_BODY(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 0)
#define OMP_FOR_CLAUSES(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 1)
#define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
#define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
-#define OMP_SECTIONS_CONTROL(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 2)
#define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
#define OMP_SECTION_LAST(NODE) \
(OMP_SECTION_CHECK (NODE)->base.private_flag)
-/* True on an OMP_RETURN statement if the return does not require a
- thread synchronization via some sort of barrier. The exact barrier
- that would otherwise be emitted is dependent on the OMP statement
- with which this return is associated. */
-#define OMP_RETURN_NOWAIT(NODE) \
- (OMP_RETURN_CHECK (NODE)->base.private_flag)
-
/* True on an OMP_PARALLEL statement if it represents an explicit
combined parallel work-sharing constructs. */
#define OMP_PARALLEL_COMBINED(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
OMP_CLAUSE_LASTPRIVATE),\
1)
+#define OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ(NODE) \
+ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
#define OMP_CLAUSE_IF_EXPR(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1)
#define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2)
+#define OMP_CLAUSE_REDUCTION_GIMPLE_INIT(NODE) \
+ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
+#define OMP_CLAUSE_REDUCTION_GIMPLE_MERGE(NODE) \
+ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_merge
#define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3)
only field that can be relied upon. */
#define SSA_NAME_VAR(NODE) SSA_NAME_CHECK (NODE)->ssa_name.var
-/* Returns the statement which defines this reference. Note that
- we use the same field when chaining SSA_NAME nodes together on
- the SSA_NAME freelist. */
-#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->common.chain
+/* Returns the statement which defines this SSA name. */
+#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
/* Returns the SSA version number of this SSA name. Note that in
tree SSA, version numbers are not per variable and may be recycled. */
{
struct ssa_use_operand_d* GTY((skip(""))) prev;
struct ssa_use_operand_d* GTY((skip(""))) next;
- tree GTY((skip(""))) stmt;
+ /* Immediate uses for a given SSA name are maintained as a cyclic
+ list. To recognize the root of this list, the location field
+ needs to point to the original SSA name. Since statements and
+ SSA names are of different data types, we need this union. See
+ the explanation in struct immediate_use_iterator_d. */
+ union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc;
tree *GTY((skip(""))) use;
} ssa_use_operand_t;
/* _DECL wrapped by this SSA name. */
tree var;
+ /* Statement that defines this SSA name. */
+ gimple def_stmt;
+
/* SSA version number. */
unsigned int version;
struct ssa_use_operand_d imm_uses;
};
\f
-/* In a PHI_NODE node. */
-
-/* These 2 macros should be considered off limits for use by developers. If
- you wish to access the use or def fields of a PHI_NODE in the SSA
- optimizers, use the accessor macros found in tree-ssa-operands.h.
- These two macros are to be used only by those accessor macros, and other
- select places where we *absolutely* must take the address of the tree. */
-
-#define PHI_RESULT_TREE(NODE) PHI_NODE_CHECK (NODE)->phi.result
-#define PHI_ARG_DEF_TREE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).def
-
-/* PHI_NODEs for each basic block are chained together in a single linked
- list. The head of the list is linked from the block annotation, and
- the link to the next PHI is in PHI_CHAIN. */
-#define PHI_CHAIN(NODE) PHI_NODE_CHECK (NODE)->phi.chain
-
-#define PHI_NUM_ARGS(NODE) PHI_NODE_CHECK (NODE)->phi.num_args
-#define PHI_ARG_CAPACITY(NODE) PHI_NODE_CHECK (NODE)->phi.capacity
-#define PHI_ARG_ELT(NODE, I) PHI_NODE_ELT_CHECK (NODE, I)
-#define PHI_ARG_EDGE(NODE, I) (EDGE_PRED (PHI_BB ((NODE)), (I)))
-#define PHI_BB(NODE) PHI_NODE_CHECK (NODE)->phi.bb
-#define PHI_ARG_IMM_USE_NODE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).imm_use
-
struct phi_arg_d GTY(())
{
/* imm_use MUST be the first element in struct because we do some
tree def;
};
-struct tree_phi_node GTY(())
-{
- struct tree_base common;
- tree chain;
- tree result;
- int num_args;
- int capacity;
-
- /* Basic block holding this PHI node. */
- struct basic_block_def *bb;
-
- /* Arguments of the PHI node. These are maintained in the same
- order as predecessor edge vector BB->PREDS. */
- struct phi_arg_d GTY ((length ("((tree)&%h)->phi.num_args"))) a[1];
-};
-
\f
#define OMP_CLAUSE_CODE(NODE) \
(OMP_CLAUSE_CHECK (NODE))->omp_clause.code
enum omp_clause_schedule_kind schedule_kind;
enum tree_code reduction_code;
} GTY ((skip)) subcode;
+
+ /* The gimplification of OMP_CLAUSE_REDUCTION_{INIT,MERGE} for omp-low's
+ usage. */
+ gimple_seq gimple_reduction_init;
+ gimple_seq gimple_reduction_merge;
+
tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1];
};
\f
/* For a FUNCTION_DECL, holds the tree of BINDINGs.
For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
For a VAR_DECL, holds the initial value.
- For a PARM_DECL, not used--default
+ For a PARM_DECL, used for DECL_ARG_TYPE--default
values for parameters are encoded in the type of the function,
not in the PARM_DECL slot.
For a FIELD_DECL, this is used for enumeration values and the C
/* Nonzero for a given ..._DECL node means that no warnings should be
generated just because this node is unused. */
#define DECL_IN_SYSTEM_HEADER(NODE) \
- (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.in_system_header_flag)
+ (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
/* Used to indicate that this DECL has weak linkage. */
#define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
unsigned shadowed_for_var_p : 1;
/* Don't belong to VAR_DECL exclusively. */
- unsigned in_system_header_flag : 1;
unsigned weak_flag:1;
unsigned seen_in_bind_expr : 1;
unsigned comdat_flag : 1;
/* Belongs to VAR_DECL exclusively. */
ENUM_BITFIELD(tls_model) tls_model : 3;
- /* 11 unused bits. */
+ /* 12 unused bits. */
};
/* In a VAR_DECL that's static,
#define DECL_POSSIBLY_INLINED(DECL) \
FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
-/* Nonzero in a FUNCTION_DECL means this function can be substituted
- where it is called. */
-#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.inline_flag)
-
/* Nonzero in a FUNCTION_DECL means that this function was declared inline,
such as via the `inline' keyword in C/C++. This flag controls the linkage
- semantics of 'inline'; whether or not the function is inlined is
- controlled by DECL_INLINE. */
+ semantics of 'inline' */
#define DECL_DECLARED_INLINE_P(NODE) \
(FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
+/* Nonzero in a FUNCTION_DECL means this function should not get
+ -Winline warnings. */
+#define DECL_NO_INLINE_WARNING_P(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.no_inline_warning_flag)
+
/* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
disregarding size and cost heuristics. This is equivalent to using
the always_inline attribute without the required diagnostics if the
#define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments)
#define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments)
+/* In FUNCTION_DECL, the function specific target options to use when compiling
+ this function. */
+#define DECL_FUNCTION_SPECIFIC_TARGET(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_target)
+
+/* In FUNCTION_DECL, the function specific optimization options to use when
+ compiling this function. */
+#define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_optimization)
+
/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the
arguments/result/saved_tree fields by front ends. It was either inherit
FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL,
struct function *f;
+ /* Function specific options that are used by this function. */
+ tree function_specific_target; /* target options */
+ tree function_specific_optimization; /* optimization options */
+
/* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
DECL_FUNCTION_CODE. Otherwise unused.
??? The bitfield needs to be able to hold all target function
unsigned declared_inline_flag : 1;
unsigned regdecl_flag : 1;
- unsigned inline_flag : 1;
+ unsigned no_inline_warning_flag : 1;
unsigned no_instrument_function_entry_exit : 1;
unsigned no_limit_stack : 1;
unsigned disregard_inline_limits : 1;
#define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
(TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_2)
+/* Getter of the imported declaration associated to the
+ IMPORTED_DECL node. */
+#define IMPORTED_DECL_ASSOCIATED_DECL(NODE) \
+(DECL_INITIAL (IMPORTED_DECL_CHECK (NODE)))
+
struct tree_type_decl GTY(())
{
struct tree_decl_non_common common;
struct tree_statement_list_node *tail;
};
-#define VALUE_HANDLE_ID(NODE) \
- (VALUE_HANDLE_CHECK (NODE)->value_handle.id)
-
-#define VALUE_HANDLE_EXPR_SET(NODE) \
- (VALUE_HANDLE_CHECK (NODE)->value_handle.expr_set)
-/* Defined and used in tree-ssa-pre.c. */
+/* Optimization options used by a function. */
-struct tree_value_handle GTY(())
+struct tree_optimization_option GTY(())
{
struct tree_common common;
- /* The set of expressions represented by this handle. */
- struct bitmap_set * GTY ((skip)) expr_set;
+ /* The optimization options used by the user. */
+ struct cl_optimization opts;
+};
+
+#define TREE_OPTIMIZATION(NODE) \
+ (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
+
+/* Return a tree node that encapsulates the current optimization options. */
+extern tree build_optimization_node (void);
- /* Unique ID for this value handle. IDs are handed out in a
- conveniently dense form starting at 0, so that we can make
- bitmaps of value handles. */
- unsigned int id;
+/* Target options used by a function. */
+
+struct tree_target_option GTY(())
+{
+ struct tree_common common;
+
+ /* The optimization options used by the user. */
+ struct cl_target_option opts;
};
+
+#define TREE_TARGET_OPTION(NODE) \
+ (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts)
+
+/* Return a tree node that encapsulates the current target options. */
+extern tree build_target_option_node (void);
+
\f
/* Define the overall contents of a tree node.
It may be any of the structures declared above
struct tree_vec GTY ((tag ("TS_VEC"))) vec;
struct tree_exp GTY ((tag ("TS_EXP"))) exp;
struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
- struct tree_phi_node GTY ((tag ("TS_PHI_NODE"))) phi;
struct tree_block GTY ((tag ("TS_BLOCK"))) block;
struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
- struct gimple_stmt GTY ((tag ("TS_GIMPLE_STATEMENT"))) gstmt;
- struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
struct tree_memory_partition_tag GTY ((tag ("TS_MEMORY_PARTITION_TAG"))) mpt;
+ struct tree_optimization_option GTY ((tag ("TS_OPTIMIZATION"))) optimization;
+ struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option;
};
\f
/* Standard named or nameless data types of the C compiler. */
TI_SAT_UDA_TYPE,
TI_SAT_UTA_TYPE,
+ TI_OPTIMIZATION_DEFAULT,
+ TI_OPTIMIZATION_CURRENT,
+ TI_TARGET_OPTION_DEFAULT,
+ TI_TARGET_OPTION_CURRENT,
+ TI_CURRENT_TARGET_PRAGMA,
+ TI_CURRENT_OPTIMIZE_PRAGMA,
+
TI_MAX
};
#define main_identifier_node global_trees[TI_MAIN_IDENTIFIER]
#define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
+/* Optimization options (OPTIMIZATION_NODE) to use for default and current
+ functions. */
+#define optimization_default_node global_trees[TI_OPTIMIZATION_DEFAULT]
+#define optimization_current_node global_trees[TI_OPTIMIZATION_CURRENT]
+
+/* Default/current target options (TARGET_OPTION_NODE). */
+#define target_option_default_node global_trees[TI_TARGET_OPTION_DEFAULT]
+#define target_option_current_node global_trees[TI_TARGET_OPTION_CURRENT]
+
+/* Default tree list option(), optimize() pragmas to be linked into the
+ attribute list. */
+#define current_target_pragma global_trees[TI_CURRENT_TARGET_PRAGMA]
+#define current_optimize_pragma global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
+
/* An enumeration of the standard C integer types. These must be
ordered so that shorter types appear before longer ones, and so
that signed types appear before unsigned ones, for the correct
#define NULL_TREE (tree) NULL
extern tree decl_assembler_name (tree);
-extern bool decl_assembler_name_equal (tree decl, tree asmname);
+extern bool decl_assembler_name_equal (tree decl, const_tree asmname);
+extern hashval_t decl_assembler_name_hash (const_tree asmname);
/* Compute the number of bytes occupied by 'node'. This routine only
looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */
extern size_t tree_size (const_tree);
/* Compute the number of bytes occupied by a tree with code CODE. This
- function cannot be used for TREE_VEC or PHI_NODE codes, which are of
- variable length. */
+ function cannot be used for TREE_VEC codes, which are of variable
+ length. */
extern size_t tree_code_size (enum tree_code);
/* Lowest level primitive for allocating a node.
#define build7(c,t1,t2,t3,t4,t5,t6,t7,t8) \
build7_stat (c,t1,t2,t3,t4,t5,t6,t7,t8 MEM_STAT_INFO)
-extern tree build_gimple_modify_stmt_stat (tree, tree MEM_STAT_DECL);
-#define build_gimple_modify_stmt(t1,t2) \
- build_gimple_modify_stmt_stat (t1,t2 MEM_STAT_INFO)
-
extern tree build_int_cst (tree, HOST_WIDE_INT);
extern tree build_int_cst_type (tree, HOST_WIDE_INT);
extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT);
extern tree build_array_type (tree, tree);
extern tree build_function_type (tree, tree);
extern tree build_function_type_list (tree, ...);
+extern tree build_function_type_skip_args (tree, bitmap);
+extern tree build_function_decl_skip_args (tree, bitmap);
+extern tree build_varargs_function_type_list (tree, ...);
extern tree build_method_type_directly (tree, tree, tree);
extern tree build_method_type (tree, tree);
extern tree build_offset_type (tree, tree);
extern bool initializer_zerop (const_tree);
+/* Given a CONSTRUCTOR CTOR, return the elements as a TREE_LIST. */
+
+extern tree ctor_to_list (tree);
+
/* Examine CTOR to discover:
* how many scalar fields are set to nonzero values,
and place it in *P_NZ_ELTS;
tree *, enum machine_mode *, int *, int *,
bool);
-/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
- look for whether EXP or any nested component-refs within EXP is marked
- as PACKED. */
+/* Given an expression EXP that may be a COMPONENT_REF, an ARRAY_REF or an
+ ARRAY_RANGE_REF, look for whether EXP or any nested component-refs within
+ EXP is marked as PACKED. */
extern bool contains_packed_reference (const_tree exp);
/* Return a tree of sizetype representing the size, in bytes, of the element
- of EXP, an ARRAY_REF. */
+ of EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_element_size (tree);
/* Return a tree representing the lower bound of the array mentioned in
- EXP, an ARRAY_REF. */
+ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_low_bound (tree);
/* Return a tree representing the upper bound of the array mentioned in
- EXP, an ARRAY_REF. */
+ EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
extern tree array_ref_up_bound (tree);
extern tree upper_bound_in_type (tree, tree);
extern tree lower_bound_in_type (tree, tree);
extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
-extern bool empty_body_p (tree);
extern tree call_expr_arg (tree, int);
extern tree *call_expr_argp (tree, int);
extern tree call_expr_arglist (tree);
+extern tree create_artificial_label (void);
+extern const char *get_name (tree);
extern bool stdarg_p (tree);
extern bool prototype_p (tree);
extern int function_args_count (tree);
extern bool auto_var_in_fn_p (const_tree, const_tree);
\f
+/* In gimplify.c */
+extern tree unshare_expr (tree);
+\f
/* In stmt.c */
extern void expand_expr_stmt (tree);
extern tree fold_abs_const (tree, tree);
extern tree fold_indirect_ref_1 (tree, tree);
extern void fold_defer_overflow_warnings (void);
-extern void fold_undefer_overflow_warnings (bool, const_tree, int);
+extern void fold_undefer_overflow_warnings (bool, const_gimple, int);
extern void fold_undefer_and_ignore_overflow_warnings (void);
extern bool fold_deferring_overflow_warnings_p (void);
extern tree maybe_fold_offset_to_reference (tree, tree, tree);
+extern tree maybe_fold_offset_to_address (tree, tree, tree);
+extern tree maybe_fold_stmt_addition (tree, tree, tree);
extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT,
int, bool);
extern tree build_low_bits_mask (tree, unsigned);
extern bool tree_swap_operands_p (const_tree, const_tree, bool);
-extern void swap_tree_operands (tree, tree *, tree *);
extern enum tree_code swap_tree_comparison (enum tree_code);
extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *);
bool *);
extern bool tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
extern bool tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
-extern bool tree_call_nonnegative_warnv_p (enum tree_code code, tree, tree,
- tree, tree, bool *);
+extern bool tree_call_nonnegative_warnv_p (tree, tree, tree, tree, bool *);
extern bool tree_expr_nonzero_warnv_p (tree, bool *);
extern tree mathfn_built_in (tree, enum built_in_function fn);
extern tree strip_float_extensions (tree);
extern tree c_strlen (tree, int);
-extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *);
+extern tree std_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
extern tree build_va_arg_indirect_ref (tree);
extern tree build_string_literal (int, const char *);
extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern int get_pointer_alignment (tree, unsigned int);
+extern int get_object_alignment (tree, unsigned int, unsigned int);
+extern tree fold_call_stmt (gimple, bool);
+extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
/* In convert.c */
extern tree strip_float_extensions (tree);
/* In tree.c */
extern int really_constant_p (const_tree);
extern bool decl_address_invariant_p (const_tree);
+extern bool decl_address_ip_invariant_p (const_tree);
extern int int_fits_type_p (const_tree, const_tree);
#ifndef GENERATOR_FILE
extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
extern int tree_floor_log2 (const_tree);
extern int simple_cst_equal (const_tree, const_tree);
extern hashval_t iterative_hash_expr (const_tree, hashval_t);
+extern hashval_t iterative_hash_exprs_commutative (const_tree,
+ const_tree, hashval_t);
+extern hashval_t iterative_hash_hashval_t (hashval_t, hashval_t);
extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
extern int type_list_equal (const_tree, const_tree);
extern int chain_member (const_tree, const_tree);
extern bool fields_compatible_p (const_tree, const_tree);
extern tree find_compatible_field (tree, tree);
-extern location_t expr_location (const_tree);
-extern void set_expr_location (tree, location_t);
-extern bool expr_has_location (const_tree);
-
-extern location_t *expr_locus (const_tree);
extern void set_expr_locus (tree, source_location *);
-extern const char *expr_filename (const_tree);
-extern int expr_lineno (const_tree);
extern tree *tree_block (tree);
-extern tree *generic_tree_operand (tree, int);
-extern tree *generic_tree_type (tree);
extern location_t *block_nonartificial_location (tree);
/* In function.c */
extern int aggregate_value_p (const_tree, const_tree);
extern void push_function_context (void);
extern void pop_function_context (void);
-extern tree gimplify_parameters (void);
+extern gimple_seq gimplify_parameters (void);
/* In print-rtl.c */
#ifdef BUFSIZ
extern int call_expr_flags (const_tree);
extern int setjmp_call_p (const_tree);
+extern bool gimple_alloca_call_p (const_gimple);
extern bool alloca_call_p (const_tree);
extern bool must_pass_in_stack_var_size (enum machine_mode, const_tree);
extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree);
extern tree resolve_asm_operand_names (tree, tree, tree);
extern void expand_case (tree);
extern void expand_decl (tree);
-extern void expand_anon_union_decl (tree, tree, tree);
#ifdef HARD_CONST
/* Silly ifdef to avoid having all includers depend on hard-reg-set.h. */
extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
#endif
-/* In gimplify.c. */
-extern tree create_artificial_label (void);
-extern void gimplify_function_tree (tree);
-extern const char *get_name (const_tree);
-extern tree unshare_expr (tree);
-extern void sort_case_labels (tree);
\f
/* Interface of the DWARF2 unwind info support. */
temp_list_kind,
vec_kind,
binfo_kind,
- phi_kind,
ssa_name_kind,
constr_kind,
x_kind,
lang_decl,
lang_type,
omp_clause_kind,
- gimple_stmt_kind,
all_kinds
} tree_node_kind;