* tree.c (build_clobber): New.
* tree.h: Declare it.
* gimplify.c (gimplify_bind_expr, gimplify_target_expr): Use it.
From-SVN: r259770
+2018-04-30 Jason Merrill <jason@redhat.com>
+
+ * tree.c (build_clobber): New.
+ * tree.h: Declare it.
+ * gimplify.c (gimplify_bind_expr, gimplify_target_expr): Use it.
+
2018-04-30 David Malcolm <dmalcolm@redhat.com>
* diagnostic-show-locus.c (layout::layout): Update for
+2018-04-30 Jason Merrill <jason@redhat.com>
+
+ * decl.c (build_clobber_this): Use build_clobber.
+
2018-04-27 Jakub Jelinek <jakub@redhat.com>
PR c++/85553
if (!vbases)
ctype = CLASSTYPE_AS_BASE (ctype);
- tree clobber = build_constructor (ctype, NULL);
- TREE_THIS_VOLATILE (clobber) = true;
+ tree clobber = build_clobber (ctype);
tree thisref = current_class_ref;
if (ctype != current_class_type)
&& !is_gimple_reg (t)
&& flag_stack_reuse != SR_NONE)
{
- tree clobber = build_constructor (TREE_TYPE (t), NULL);
+ tree clobber = build_clobber (TREE_TYPE (t));
gimple *clobber_stmt;
- TREE_THIS_VOLATILE (clobber) = 1;
clobber_stmt = gimple_build_assign (t, clobber);
gimple_set_location (clobber_stmt, end_locus);
gimplify_seq_add_stmt (&cleanup, clobber_stmt);
{
if (flag_stack_reuse == SR_ALL)
{
- tree clobber = build_constructor (TREE_TYPE (temp),
- NULL);
- TREE_THIS_VOLATILE (clobber) = true;
+ tree clobber = build_clobber (TREE_TYPE (temp));
clobber = build2 (MODIFY_EXPR, TREE_TYPE (temp), temp, clobber);
gimple_push_cleanup (temp, clobber, false, pre_p, true);
}
return build_constructor (type, v);
}
+/* Return a node of type TYPE for which TREE_CLOBBER_P is true. */
+
+tree
+build_clobber (tree type)
+{
+ tree clobber = build_constructor (type, NULL);
+ TREE_THIS_VOLATILE (clobber) = true;
+ return clobber;
+}
+
/* Return a new FIXED_CST node whose type is TYPE and value is F. */
tree
extern tree build_constructor_single (tree, tree, tree);
extern tree build_constructor_from_list (tree, tree);
extern tree build_constructor_va (tree, int, ...);
+extern tree build_clobber (tree);
extern tree build_real_from_int_cst (tree, const_tree);
extern tree build_complex (tree, tree, tree);
extern tree build_complex_inf (tree, bool);