* c-common.c (c_expand_decl): Remove.
* c-common.h (anon_aggr_type_p): Remove prototype.
(DECL_ANON_UNION_ELEMS): Remove.
* c-objc-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
* c-decl.c (anon_aggr_type_p): Remove.
* langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Remove.
(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_EXPAND_DECL.
* langhooks.h (struct lang_hooks): Remove expand_decl.
* langhooks.c (lhd_expand_decl): Remove.
* stmt.c (expand_anon_union_decl): Remove.
* tree.h (expand_anon_union_decl): Remove prototype.
cp:
2008-09-09 Paolo Bonzini <bonzini@gnu.org>
* cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
* cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
* semantics.c (anon_aggr_type_p): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140138
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-09-09 Paolo Bonzini <bonzini@gnu.org>
+
+ * c-common.c (c_expand_decl): Remove.
+ * c-common.h (anon_aggr_type_p): Remove prototype.
+ (DECL_ANON_UNION_ELEMS): Remove.
+ * c-objc-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
+ * c-decl.c (anon_aggr_type_p): Remove.
+ * langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Remove.
+ (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_EXPAND_DECL.
+ * langhooks.h (struct lang_hooks): Remove expand_decl.
+ * langhooks.c (lhd_expand_decl): Remove.
+ * stmt.c (expand_anon_union_decl): Remove.
+ * tree.h (expand_anon_union_decl): Remove prototype.
+
2008-08-09 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/36609
return namep;
}
-/* Expand DECL if it declares an entity not handled by the
- common code. */
-
-int
-c_expand_decl (tree decl)
-{
- if (TREE_CODE (decl) == VAR_DECL && !TREE_STATIC (decl))
- {
- /* Let the back-end know about this variable. */
- if (!anon_aggr_type_p (TREE_TYPE (decl)))
- emit_local_var (decl);
- else
- expand_anon_union_decl (decl, NULL_TREE,
- DECL_ANON_UNION_ELEMS (decl));
- }
- else
- return 0;
-
- return 1;
-}
-
-
/* Return the VAR_DECL for a const char array naming the current
function. If the VAR_DECL has not yet been created, create it
now. RID indicates how it should be formatted and IDENTIFIER_NODE
#define COMPOUND_LITERAL_EXPR_DECL(NODE) \
DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE))
-extern int anon_aggr_type_p (const_tree);
-
-/* For a VAR_DECL that is an anonymous union, these are the various
- sub-variables that make up the anonymous union. */
-#define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE))
-
/* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */
#define DECL_C_BIT_FIELD(NODE) \
(DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) == 1)
return &c_stmt_tree;
}
-/* Nonzero if TYPE is an anonymous union or struct type. Always 0 in
- C. */
-
-int
-anon_aggr_type_p (const_tree ARG_UNUSED (node))
-{
- return 0;
-}
-
/* Return the global value of T as a symbol. */
tree
#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
-#undef LANG_HOOKS_EXPAND_DECL
-#define LANG_HOOKS_EXPAND_DECL c_expand_decl
#undef LANG_HOOKS_MARK_ADDRESSABLE
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
#undef LANG_HOOKS_PARSE_FILE
+2008-09-09 Paolo Bonzini <bonzini@gnu.org>
+
+ * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
+ * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
+ * semantics.c (anon_aggr_type_p): Remove.
+
2008-09-06 Jason Merrill <jason@redhat.com>
PR c++/37302
#define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
-#undef LANG_HOOKS_EXPAND_DECL
-#define LANG_HOOKS_EXPAND_DECL c_expand_decl
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_STATICP
to which the vptr should be initialized. Use get_vtbl_decl_for_binfo
to extract the VAR_DECL for the complete vtable.
- DECL_ARGUMENTS
- For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
-
DECL_VINDEX
This field is NULL for a non-virtual function. For a virtual
function, it is eventually set to an INTEGER_CST indicating the
add_stmt (r);
}
-/* Nonzero if TYPE is an anonymous union or struct type. We have to use a
- flag for this because "A union for which objects or pointers are
- declared is not an anonymous union" [class.union]. */
-
-int
-anon_aggr_type_p (const_tree node)
-{
- return ANON_AGGR_TYPE_P (node);
-}
-
/* Finish a scope. */
tree
extern const char *lhd_dwarf_name (tree, int);
extern int lhd_types_compatible_p (tree, tree);
extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
-extern int lhd_expand_decl (tree);
extern void lhd_print_error_function (struct diagnostic_context *,
const char *, struct diagnostic_info *);
extern void lhd_set_decl_assembler_name (tree);
#define LANG_HOOKS_MISSING_NORETURN_OK_P hook_bool_tree_true
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
-#define LANG_HOOKS_EXPAND_DECL lhd_expand_decl
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
#define LANG_HOOKS_STATICP lhd_staticp
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
LANG_HOOKS_MISSING_NORETURN_OK_P, \
LANG_HOOKS_GET_ALIAS_SET, \
LANG_HOOKS_EXPAND_EXPR, \
- LANG_HOOKS_EXPAND_DECL, \
LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
LANG_HOOKS_MARK_ADDRESSABLE, \
LANG_HOOKS_STATICP, \
gcc_unreachable ();
}
-/* The default language-specific function for expanding a decl. After
- the language-independent cases are handled, this function will be
- called. If this function is not defined, it is assumed that
- declarations other than those for variables and labels do not require
- any RTL generation. */
-
-int
-lhd_expand_decl (tree ARG_UNUSED (t))
-{
- return 0;
-}
-
/* This is the default decl_printable_name function. */
const char *
Fourth argument is actually an enum expand_modifier. */
rtx (*expand_expr) (tree, rtx, enum machine_mode, int, rtx *);
- /* Called by expand_expr to generate the definition of a decl. Returns
- 1 if handled, 0 otherwise. */
- int (*expand_decl) (tree);
-
/* Function to finish handling an incomplete decl at the end of
compilation. Default hook is does nothing. */
void (*finish_incomplete_decl) (tree);
emit_stack_restore (SAVE_BLOCK, sa, NULL_RTX);
}
\f
-/* DECL is an anonymous union. CLEANUP is a cleanup for DECL.
- DECL_ELTS is the list of elements that belong to DECL's type.
- In each, the TREE_VALUE is a VAR_DECL, and the TREE_PURPOSE a cleanup. */
-
-void
-expand_anon_union_decl (tree decl, tree cleanup ATTRIBUTE_UNUSED,
- tree decl_elts)
-{
- rtx x;
- tree t;
-
- /* If any of the elements are addressable, so is the entire union. */
- for (t = decl_elts; t; t = TREE_CHAIN (t))
- if (TREE_ADDRESSABLE (TREE_VALUE (t)))
- {
- TREE_ADDRESSABLE (decl) = 1;
- break;
- }
-
- expand_decl (decl);
- x = DECL_RTL (decl);
-
- /* Go through the elements, assigning RTL to each. */
- for (t = decl_elts; t; t = TREE_CHAIN (t))
- {
- tree decl_elt = TREE_VALUE (t);
- enum machine_mode mode = TYPE_MODE (TREE_TYPE (decl_elt));
- rtx decl_rtl;
-
- /* If any of the elements are addressable, so is the entire
- union. */
- if (TREE_USED (decl_elt))
- TREE_USED (decl) = 1;
-
- /* Propagate the union's alignment to the elements. */
- DECL_ALIGN (decl_elt) = DECL_ALIGN (decl);
- DECL_USER_ALIGN (decl_elt) = DECL_USER_ALIGN (decl);
-
- /* If the element has BLKmode and the union doesn't, the union is
- aligned such that the element doesn't need to have BLKmode, so
- change the element's mode to the appropriate one for its size. */
- if (mode == BLKmode && DECL_MODE (decl) != BLKmode)
- DECL_MODE (decl_elt) = mode
- = mode_for_size_tree (DECL_SIZE (decl_elt), MODE_INT, 1);
-
- if (mode == GET_MODE (x))
- decl_rtl = x;
- else if (MEM_P (x))
- /* (SUBREG (MEM ...)) at RTL generation time is invalid, so we
- instead create a new MEM rtx with the proper mode. */
- decl_rtl = adjust_address_nv (x, mode, 0);
- else
- {
- gcc_assert (REG_P (x));
- decl_rtl = gen_lowpart_SUBREG (mode, x);
- }
- SET_DECL_RTL (decl_elt, decl_rtl);
- }
-}
-\f
/* Do the insertion of a case label into case_list. The labels are
fed to us in descending order from the sorted vector of case labels used
in the tree part of the middle end. So the list we construct is
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 *);