summaryrefslogtreecommitdiff
path: root/gcc/langhooks.h
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/langhooks.h
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/langhooks.h')
-rw-r--r--gcc/langhooks.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 49c2c6803a1..d2a3e482ad8 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -1,5 +1,5 @@
/* The lang_hooks data structure.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -65,6 +65,43 @@ struct lang_hooks_for_tree_dump
int (*type_quals) PARAMS ((tree));
};
+/* Language hooks related to decls and the symbol table. */
+
+struct lang_hooks_for_decls
+{
+ /* Enter a new lexical scope. Argument is always zero when called
+ from outside the front end. */
+ void (*pushlevel) PARAMS ((int));
+
+ /* Exit a lexical scope and return a BINDING for that scope.
+ Takes three arguments:
+ KEEP -- nonzero if there were declarations in this scope.
+ REVERSE -- reverse the order of decls before returning them.
+ FUNCTIONBODY -- nonzero if this level is the body of a function. */
+ tree (*poplevel) PARAMS ((int, int, int));
+
+ /* Returns non-zero if we are in the global binding level. Ada
+ returns -1 for an undocumented reason used in stor-layout.c. */
+ int (*global_bindings_p) PARAMS ((void));
+
+ /* Insert BLOCK at the end of the list of subblocks of the
+ current binding level. This is used when a BIND_EXPR is expanded,
+ to handle the BLOCK node inside the BIND_EXPR. */
+ void (*insert_block) PARAMS ((tree));
+
+ /* Set the BLOCK node for the current scope level. */
+ void (*set_block) PARAMS ((tree));
+
+ /* Function to add a decl to the current scope level. Takes one
+ argument, a decl to add. Returns that decl, or, if the same
+ symbol is already declared, may return a different decl for that
+ name. */
+ tree (*pushdecl) PARAMS ((tree));
+
+ /* Returns the chain of decls so far in the current scope level. */
+ tree (*getdecls) PARAMS ((void));
+};
+
/* Language-specific hooks. See langhooks-def.h for defaults. */
struct lang_hooks
@@ -177,6 +214,8 @@ struct lang_hooks
struct lang_hooks_for_tree_dump tree_dump;
+ struct lang_hooks_for_decls decls;
+
/* Whenever you add entries here, make sure you adjust langhooks-def.h
and langhooks.c accordingly. */
};