aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-27 14:31:29 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-27 09:31:29 -0500
commitac79cd5ab9b4c4c32725845ef3a2c91e29e67f7e (patch)
treedf8e146fbd8a8ed512495c0e24ff0baaa409303d /gcc/cp
parent188235dff14c855c929b8a52378deaf452637e1a (diff)
downloadgcc-ac79cd5ab9b4c4c32725845ef3a2c91e29e67f7e.zip
gcc-ac79cd5ab9b4c4c32725845ef3a2c91e29e67f7e.tar.gz
gcc-ac79cd5ab9b4c4c32725845ef3a2c91e29e67f7e.tar.bz2
Makefile.in (c-lang.o): Depends on langhooks-def.h.
* Makefile.in (c-lang.o): Depends on langhooks-def.h. (expr.o, varasm.o): Depends on langhooks.h. * c-common.c (c_safe_from_p): Always declare. (c_expand_expr): Refine when declared. * c-lang.c (c-common.h): Now include. (LANG_HOOKS_SAFE_FROM_P): Define new hook. (c_init): Don't set lang_safe_from_expr. * expr.c (langhooks.h): Now include. (lang_safe_from_p): No longer define. (safe_from_p): Use lang hook. (expand_expr): Set IGNORE if VOID_TYPE result of VIEW_CONVERT_EXPR too. (expand_expr, case VIEW_CONVERT_EXPR): Pass ro_modifier down. * expr.h (lang_expand_constant, lang_safe_from_p): Delete. * langhooks-def.h (lhd_return_tree, lhd_safe_from_p): New decls. (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks. * langhooks.c (lhd_return_tree, lhd_safe_from_p): New functions. * langhooks.h (struct lang_hooks): New fields expand_constant and safe_from_p. * output.h (output_constant): Size arg is HOST_WIDE_INT. * stmt.c (expand_decl_init): No longer need to expand constant for CONST_DECL. * stor-layout.c (put_pending_size): Don't check for SAVE_EXPR. * toplev.c (lang_expand_constant): Delete var. * tree.c (save_expr): Don't put another SAVE_EXPR around simple operations on SAVE_EXPR. * varasm.c (langhooks.h): Now include. (compare_constant_1): Use lang_hooks, not lang_expand_constant. (record_constant_1, output_addressed_constants): Likewise. (initializer_constant_valid_p, output_constant): Likewise. (output_constant_def): Process no-defer of string constant. (output_addressed_constants, case ADDR_EXPR): Use handled_component_p. (output_constant): Strip more conversions. Track our size and pad for the rest. (array_size_for_constructor): Remove code for non-byte STRING_CST. (output_constructor): SIZE now HOST_WIDE_INT. * cp/Make-lang.in (cp-lang.o): Depends on c-common.h. * cp/cp-lang.c (c-common.h): Include. (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks. * cp/decl.c (cxx_init_decl_processing): Don't set lang_safe_from_p. * cp/expr.c (init_cplus_expand): Don't set lang_expand_constant. From-SVN: r47376
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/Make-lang.in3
-rw-r--r--gcc/cp/cp-lang.c5
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/cp/expr.c1
5 files changed, 15 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 110f7c4..ea6353b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+Tue Nov 27 09:03:47 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * Make-lang.in (cp-lang.o): Depends on c-common.h.
+ * cp-lang.c (c-common.h): Include.
+ (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks.
+ * decl.c (cxx_init_decl_processing): Don't set lang_safe_from_p.
+ * expr.c (init_cplus_expand): Don't set lang_expand_constant.
+
2001-11-26 Neil Booth <neil@daikokuya.demon.co.uk>
* decl2.c (c_language): Move to c-common.c.
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 3a1f149..f9700ba 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -243,7 +243,8 @@ cp/spew.o: cp/spew.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h toplev.h
cp/lex.o: cp/lex.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h c-pragma.h \
toplev.h output.h mbchar.h $(GGC_H) input.h diagnostic.h cp/operators.def \
$(TM_P_H)
-cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) toplev.h langhooks.h langhooks-def.h
+cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) toplev.h langhooks.h langhooks-def.h \
+ c-common.h
cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
output.h $(EXPR_H) except.h toplev.h hash.h $(GGC_H) $(RTL_H) \
cp/operators.def $(TM_P_H) tree-inline.h
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index dbca8af..598c3fc 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "tree.h"
#include "cp-tree.h"
+#include "c-common.h"
#include "toplev.h"
#include "langhooks.h"
#include "langhooks-def.h"
@@ -45,6 +46,10 @@ static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree));
#define LANG_HOOKS_POST_OPTIONS cxx_post_options
#undef LANG_HOOKS_GET_ALIAS_SET
#define LANG_HOOKS_GET_ALIAS_SET cxx_get_alias_set
+#undef LANG_HOOKS_EXPAND_CONSTANT
+#define LANG_HOOKS_EXPAND_CONSTANT cplus_expand_constant
+#undef LANG_HOOKS_SAFE_FROM_P
+#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
#undef LANG_HOOKS_PRINT_STATISTICS
#define LANG_HOOKS_PRINT_STATISTICS cxx_print_statistics
#undef LANG_HOOKS_PRINT_XNODE
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6fdb1c4..9f4d82d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6407,7 +6407,6 @@ cxx_init_decl_processing ()
init_lang_status = &push_cp_function_context;
free_lang_status = &pop_cp_function_context;
mark_lang_status = &mark_cp_function_context;
- lang_safe_from_p = &c_safe_from_p;
lang_missing_noreturn_ok_p = &cp_missing_noreturn_ok_p;
cp_parse_init ();
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index f2fe6eb..57099dc 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -135,7 +135,6 @@ void
init_cplus_expand ()
{
lang_expand_expr = cplus_expand_expr;
- lang_expand_constant = cplus_expand_constant;
}
int