summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-21 18:39:29 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-21 18:39:29 +0000
commit20325f61bf17dcfd880c96cafb80f6b89e69ddcd (patch)
treeb565716472649ba4ff8e84298f2475f0afd90105 /gcc/fold-const.c
parent12f6b6183972b55ee709e24a5e6bca9361d7d14d (diff)
downloadgcc-20325f61bf17dcfd880c96cafb80f6b89e69ddcd.tar.gz
* Makefile.in (fold-const.o, stor-layout.o, stmt.o,
sdbout.o, profile.o): Update. * c-common.c (c_common_nodes_and_builtins): Use pushdecl langhook. * c-common.h (gettags): Move here from tree.h. * c-tree.h (pushdecl, pushlevel, poplevel, set_block, insert_block, getdecls, kept_level_p, global_bindings_p): New. * dbxout.c (dbxout_init): Use getdecls langhook. * expr.c (expand_expr): Use insert_block langhook. * fold-const.c: Include langhooks.h. (fold_range_test, fold_binary_op_with_conditional_arg, fold): Use global_bindings_p langhook. * integrate.c (expand_inline_function): Use insert_block langhook. * langhooks-def.h (LANG_HOOKS_DECLS, LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_GLOBAL_BINDINGS_P, LANG_HOOKS_INSERT_BLOCK, LANG_HOOKS_SET_BLOCK, LANG_HOOKS_PUSHDECL, LANG_HOOKS_GETDECLS): New. (LANG_HOOKS_INITIALIZER): Update. * langhooks.c (lhd_clear_binding_stack): Use global_bindings_p langhook. * langhooks.h (struct lang_hooks_for_decls): New. (struct lang_hooks): Update. * profile.c: Include langhooks.h. (output_func_start_profiler): Use new langhooks. * sdbout.c: Include langhooks.h. (sdbout_init, sdbout_finish): Use getdecls langhook. * stmt.c: Include langhooks.h. (expand_fixup, fixup_gotos): Use new langhooks. * stor-layout.c: Include langhooks.h. (variable_size): Use global_bindings_p langhook. * toplev.c (compile_file): Use getdecls langhook. * tree-inline.c (remap_block): Use insert_block langhook. * tree.h (pushdecl, pushlevel, poplevel, set_block, gettags, insert_block, getdecls, kept_level_p, global_bindings_p): Remove. cp: * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, insert_block, getdecls, global_bindings_p): New. java: * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, insert_block, getdecls, kept_level_p, global_bindings_p): New. f: * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, insert_block, getdecls, global_bindings_p): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51136 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 054cd45d11d..39d18bb30fa 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -52,6 +52,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "ggc.h"
#include "hashtab.h"
+#include "langhooks.h"
static void encode PARAMS ((HOST_WIDE_INT *,
unsigned HOST_WIDE_INT,
@@ -3336,7 +3337,7 @@ fold_range_test (exp)
TREE_TYPE (exp), TREE_OPERAND (exp, 0),
TREE_OPERAND (exp, 1));
- else if (global_bindings_p () == 0
+ else if ((*lang_hooks.decls.global_bindings_p) () == 0
&& ! contains_placeholder_p (lhs))
{
tree common = save_expr (lhs);
@@ -4341,7 +4342,7 @@ fold_binary_op_with_conditional_arg (code, type, cond, arg, cond_first_p)
in that case. */
if (TREE_CODE (arg) != SAVE_EXPR && ! TREE_CONSTANT (arg)
- && global_bindings_p () == 0
+ && (*lang_hooks.decls.global_bindings_p) () == 0
&& ((TREE_CODE (arg) != VAR_DECL
&& TREE_CODE (arg) != PARM_DECL)
|| TREE_SIDE_EFFECTS (arg)))
@@ -4623,7 +4624,7 @@ fold (expr)
&& (TREE_CODE (arg0) != COND_EXPR
|| count_cond (arg0, 25) + count_cond (arg1, 25) <= 25)
&& (! TREE_SIDE_EFFECTS (arg0)
- || (global_bindings_p () == 0
+ || ((*lang_hooks.decls.global_bindings_p) () == 0
&& ! contains_placeholder_p (arg0))))
return
fold_binary_op_with_conditional_arg (code, type, arg1, arg0,
@@ -4637,7 +4638,7 @@ fold (expr)
&& (TREE_CODE (arg1) != COND_EXPR
|| count_cond (arg0, 25) + count_cond (arg1, 25) <= 25)
&& (! TREE_SIDE_EFFECTS (arg1)
- || (global_bindings_p () == 0
+ || ((*lang_hooks.decls.global_bindings_p) () == 0
&& ! contains_placeholder_p (arg1))))
return
fold_binary_op_with_conditional_arg (code, type, arg0, arg1,
@@ -5249,7 +5250,8 @@ fold (expr)
if (real_onep (arg1))
return non_lvalue (convert (type, arg0));
/* x*2 is x+x */
- if (! wins && real_twop (arg1) && global_bindings_p () == 0
+ if (! wins && real_twop (arg1)
+ && (*lang_hooks.decls.global_bindings_p) () == 0
&& ! contains_placeholder_p (arg0))
{
tree arg = save_expr (arg0);