Commit 4250754e by Jason Merrill Committed by Jason Merrill

Define c_fully_fold separately for C and C++.

gcc/c-family/
	* c-common.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
	(c_fully_fold_internal, decl_constant_value_for_optimization):
	Move to c/c-fold.c.
	* c-common.h: Don't declare decl_constant_value_for_optimization.
gcc/c/
	* c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
	(c_fully_fold_internal, decl_constant_value_for_optimization):
	Move from c-common.c.
	* c-tree.h: Declare decl_constant_value_for_optimization.
	* Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
gcc/cp/
	* cp-gimplify.c (c_fully_fold): Define.

From-SVN: r231196
parent e9ea372d
2015-12-02 Jason Merrill <jason@redhat.com>
* c-common.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
(c_fully_fold_internal, decl_constant_value_for_optimization):
Move to c/c-fold.c.
* c-common.h: Don't declare decl_constant_value_for_optimization.
2015-12-02 Joseph Myers <joseph@codesourcery.com>
PR c/68162
......
......@@ -809,7 +809,6 @@ extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree,
bool);
extern bool decl_with_nonnull_addr_p (const_tree);
extern tree c_fully_fold (tree, bool, bool *);
extern tree decl_constant_value_for_optimization (tree);
extern tree c_wrap_maybe_const (tree, bool);
extern tree c_save_expr (tree);
extern tree c_common_truthvalue_conversion (location_t, tree);
......
2015-12-02 Jason Merrill <jason@redhat.com>
* c-fold.c (c_disable_warnings, c_enable_warnings, c_fully_fold)
(c_fully_fold_internal, decl_constant_value_for_optimization):
Move from c-common.c.
* c-tree.h: Declare decl_constant_value_for_optimization.
* Make-lang.in (C_AND_OBJC_OBJS): Add c-fold.o.
2015-12-02 Joseph Myers <joseph@codesourcery.com>
PR c/68162
......
......@@ -51,7 +51,7 @@ CFLAGS-c/gccspec.o += $(DRIVER_DEFINES)
# Language-specific object files for C and Objective C.
C_AND_OBJC_OBJS = attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o \
c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o \
c/c-array-notation.o $(C_COMMON_OBJS) $(C_TARGET_OBJS)
c/c-array-notation.o c/c-fold.o $(C_COMMON_OBJS) $(C_TARGET_OBJS)
# Language-specific object files for C.
C_OBJS = c/c-lang.o c-family/stub-objc.o $(C_AND_OBJC_OBJS)
......
This diff is collapsed. Click to expand it.
......@@ -728,4 +728,7 @@ extern void
set_c_expr_source_range (c_expr *expr,
source_range src_range);
/* In c-fold.c */
extern tree decl_constant_value_for_optimization (tree);
#endif /* ! GCC_C_TREE_H */
2015-12-02 Jason Merrill <jason@redhat.com>
* cp-gimplify.c (c_fully_fold): Define.
* cp-gimplify.c (cp_fold): Use fold_build*.
2015-12-02 Joseph Myers <joseph@codesourcery.com>
......
......@@ -1883,6 +1883,17 @@ cp_fully_fold (tree x)
return cp_fold (x);
}
/* c-common interface to cp_fold. If IN_INIT, this is in a static initializer
and certain changes are made to the folding done. Or should be (FIXME). We
never touch maybe_const, as it is only used for the C front-end
C_MAYBE_CONST_EXPR. */
tree
c_fully_fold (tree x, bool /*in_init*/, bool */*maybe_const*/)
{
return cp_fold (x);
}
static GTY((cache, deletable)) cache_map fold_cache;
/* This function tries to fold an expression X.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment