aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2014-05-21 11:00:35 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-05-21 11:00:35 +0000
commit632f2871edb2859c94d8fca573a1f74606a14332 (patch)
tree873a8d60202acd9cd1d79ac86b9a225532e52a1c /gcc/tree.c
parent313822494eef43225468cae7ca35170f2ed5af09 (diff)
downloadgcc-632f2871edb2859c94d8fca573a1f74606a14332.zip
gcc-632f2871edb2859c94d8fca573a1f74606a14332.tar.gz
gcc-632f2871edb2859c94d8fca573a1f74606a14332.tar.bz2
tree.def (VOID_CST): New.
gcc/ * tree.def (VOID_CST): New. * tree-core.h (TI_VOID): New. * tree.h (void_node): New. * tree.c (tree_node_structure_for_code, tree_code_size) (iterative_hash_expr): Handle VOID_CST. (build_common_tree_nodes): Initialize void_node. gcc/c-family/ * c-common.h (CTI_VOID_ZERO, void_zero_node): Delete. * c-common.c (c_common_nodes_and_builtins): Don't initialize void_zero_node. * c-pretty-print.c (pp_c_void_constant): New function. (c_pretty_printer::constant, c_pretty_printer::primary_expression) (c_pretty_printer::expression): Handle VOID_CST. * cilk.c (extract_free_variables): Likewise. * c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift) (ubsan_instrument_vla): Use void_node instead of void_zero_node. gcc/c/ * c-array-notation.c (expand_array_notations): Use void_node instead of void_zero_node. gcc/cp/ * cvt.c (convert_to_void): Use void_node instead of void_zero_node. * cp-array-notation.c (replace_invariant_exprs): Likewise. (expand_array_notation): Handle VOID_CST. * error.c (dump_expr): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::primary_expression) (cxx_pretty_printer::expression): Likewise. (pp_cxx_new_expression): Use void_node instead of void_zero_node. * decl.c (register_dtor_fn): Likewise. * init.c (build_raw_new_expr, build_new_1, build_vec_init) (build_delete, push_base_cleanups): Likewise. * mangle.c (write_expression): Likewise. * semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise. * pt.c (tsubst_decl, tsubst_copy_and_build): Likewise. (tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST. * tree.c (cp_tree_equal): Likewise. (build_dummy_object, is_dummy_object, stabilize_expr): Use void_node instead of void_zero_node. * typeck.c (check_return_expr): Likewise. * typeck2.c (build_functional_cast): Likewise. From-SVN: r210692
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 4dd8e73..22b92f3 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -383,6 +383,7 @@ tree_node_structure_for_code (enum tree_code code)
switch (code)
{
/* tcc_constant cases. */
+ case VOID_CST: return TS_TYPED;
case INTEGER_CST: return TS_INT_CST;
case REAL_CST: return TS_REAL_CST;
case FIXED_CST: return TS_FIXED_CST;
@@ -652,6 +653,7 @@ tree_code_size (enum tree_code code)
case tcc_constant: /* a constant */
switch (code)
{
+ case VOID_CST: return sizeof (struct tree_typed);
case INTEGER_CST: gcc_unreachable ();
case REAL_CST: return sizeof (struct tree_real_cst);
case FIXED_CST: return sizeof (struct tree_fixed_cst);
@@ -7360,6 +7362,8 @@ iterative_hash_expr (const_tree t, hashval_t val)
{
/* Alas, constants aren't shared, so we can't rely on pointer
identity. */
+ case VOID_CST:
+ return iterative_hash_hashval_t (0, val);
case INTEGER_CST:
for (i = 0; i < TREE_INT_CST_NUNITS (t); i++)
val = iterative_hash_host_wide_int (TREE_INT_CST_ELT (t, i), val);
@@ -9631,6 +9635,9 @@ build_common_tree_nodes (bool signed_char, bool short_double)
TYPE_ALIGN (void_type_node) = BITS_PER_UNIT;
TYPE_USER_ALIGN (void_type_node) = 0;
+ void_node = make_node (VOID_CST);
+ TREE_TYPE (void_node) = void_type_node;
+
null_pointer_node = build_int_cst (build_pointer_type (void_type_node), 0);
layout_type (TREE_TYPE (null_pointer_node));