2001-10-08 22:54:07 +02:00
|
|
|
/* Default language-specific hooks.
|
Makefile.in (fold-const.o, [...]): Update.
* 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.
From-SVN: r51136
2002-03-21 19:39:29 +01:00
|
|
|
Copyright 2001, 2002 Free Software Foundation, Inc.
|
2001-10-08 22:54:07 +02:00
|
|
|
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "toplev.h"
|
|
|
|
#include "tree.h"
|
tree-dump.c: Rename from c-dump.c.
* tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h.
(lang_type_quals): Declare.
(dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to
retrieve language-specific qualifiers for a type node, instead of
C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of
lang_dump_tree.
* tree-dump.h: Rename from c-dump.h.
* c-common.h (C_TYPE_QUALS): Removed.
Move declarations for tree-dump.c interface to...
* tree.h: ... here. Remove lang_dump_tree.
* langhooks.h (struct lang_hooks_for_tree_dump): New.
(struct lang_hooks): Add tree_dump hooks.
* langhooks.c (lhd_tree_dump_dump_tree): New function.
(lhd_tree_dump_type_quals): New function.
* langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals):
Declare.
(LANG_HOOKS_INITIALIZER): Add tree_dump hooks.
* Makefile.in: Move tree-dump.o to language-independent back-end.
cp:
* cp-tree.h (CP_TYPE_QUALS): Removed.
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
* dump.c (cp_dump_tree): Use void* dump_info argument to match
lang-hooks prototype.
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
CP_TYPE_QUALS changed to cp_type_quals.
* Make-lang.in: References to c-dump.h changed to tree-dump.h.
(CXX_C_OBJS): Remove c-dump.o.
From-SVN: r47257
2001-11-22 03:33:02 +01:00
|
|
|
#include "c-tree.h"
|
2001-10-08 22:54:07 +02:00
|
|
|
#include "tree-inline.h"
|
2001-10-10 09:02:22 +02:00
|
|
|
#include "rtl.h"
|
|
|
|
#include "insn-config.h"
|
|
|
|
#include "integrate.h"
|
2002-02-22 05:23:21 +01:00
|
|
|
#include "flags.h"
|
2001-10-11 08:50:50 +02:00
|
|
|
#include "langhooks.h"
|
2001-11-06 22:12:14 +01:00
|
|
|
#include "langhooks-def.h"
|
2001-10-11 08:50:50 +02:00
|
|
|
|
2001-10-21 23:03:48 +02:00
|
|
|
/* Do nothing; in many cases the default hook. */
|
alias.c (can_address_p): Compnonents are not addressable if the containing type has alias set 0.
* alias.c (can_address_p): Compnonents are not addressable if
the containing type has alias set 0.
(get_alias_set): Rework to use STRIP_NOPS.
Only call front-end routine on object, type, or object with
NOPs stripped, not inner values.
Use language hook to call front-end routine.
* builtins.c (get_memory_rtx): Always call set_mem_attributes.
(expand_builtin_apply): Call set_mem_align on MEMs we make.
Don't pass alignment to emit_block_move.
(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
(expand_builtin_memset): Likewise, but for clear_storage.
* c-common.c (lang_get_alias_set): Renamed to c_common_alias_set
and remove C++ specific parts.
* c-common.h (c_common_get_alias_set): Add declaration.
* c-lang.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
* calls.c (emit_call_1): Fix typo in sibcall_pop case.
(save_fixed_argument_area): Call set_mem_align.
Remove alignment in call to emit_block_move.
(emit_library_call_value_1, store_one_arg): Likewise.
(target_for_arg): Remove; disabled long ago.
* emit-rtl.c (set_mem_attributes): Rework to only call get_mem_attrs
once and similar cleanups.
(offset_address): Use proper introductory comment.
* expr.c (emit_block_move): Use alignment from that of MEM args, not
from explicit operand; all callers changed.
(clear_storage): Likewise.
(expand_assignment): Don't call set_mem_alias_set on to_rtx.
(store_field): Remove kludge on alias set used for to_rtx.
(highest_pow2_factor, case *_DIV_EXPR): Never return 0.
(expand_expr_unaligned): Call set_mem_attributes instead of
set_mem_alias_set.
* expr.h (emit_block_move, clear_storage): Remove ALIGN argument.
* function.c (assign_stack_temp_for_type): Set MEM alignment.
(expand_function_end): Track MEM attributes of trampolines.
* ifcvt.c (noce_try_cmove_arith): Set alignment of new MEM.
* integrate.c (copy_rtx_and_substitute, case CALL): Copy memory
attributes from original.
* langhooks.c (lang_hook_default_get_alias_set): New function.
(hook_get_alias_set_0): New function.
* langhooks.h (hook_get_alias_set_0): New declaration.
(lang_hook_default_get_alias_set): Likewise.
(LANG_HOOKS_GET_ALIAS_SET): New macro; add to initializer.
* reload1.c (alter_reg): Use adjust_address_nv.
* rtl.c (get_mode_alignment): Moved to here.
* rtl.h (MEM_ALIGN): Take default from mode, if not BLKmode, and
change default if unknown from 1 to BITS_PER_UNIT.
* stor-layout.c (get_mode_alignment): Remove from here.
* toplev.h (struct lang_hoks): Add get_alias_set field.
* tree.h (lang_get_alias_set): Delete declaration.
* config/arc/arc.c (arc_setup_incoming_varags): Set MEM alignment.
* config/i386/i386.c (ix86_setup_incoming_varargs): Likewise.
(ix86_va_arg): Likewise.
* config/i960/i960.c (i960_setup_incoming_varargs): Likewise.
* config/pa/pa.c (hppa_builtin_saveregs): Likewise.
* config/sparc/sparc.c (sparc_va_arg): Likewise.
* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
(expand_block_move_mem): Remove dead code.
* cp/cp-lang.c (cxx_get_alias_set): New function.
Point LANG_HOOKS_GET_ALIAS_SET to it.
* f/com.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
(lang_get_alias_set): Delete.
* java/lang.c (lang_get_alias_set): Deleted.
From-SVN: r46440
2001-10-23 20:51:18 +02:00
|
|
|
|
2001-10-21 23:03:48 +02:00
|
|
|
void
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_do_nothing ()
|
2001-10-21 23:03:48 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* decl.c (push_c_function_context, pop_c_function_context,
mark_c_function_context): Rename for consistency.
* c-objc-common.c (c_objc_common_init): Langhooks set elsewhere.
* c-tree.h (push_c_function_context, pop_c_function_context,
mark_c_function_context): Rename for consistency.
* c-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine.
* function.c (init_lang_status, save_lang_status,
restore_lang_status, mark_lang_status, free_lang_status):
Move to langhooks.h.
(push_function_context_to, pop_function_context_from,
free_after_parsing, prepare_function_start, ggc_mark_struct_function):
Update.
* function.h (init_lang_status, save_lang_status,
restore_lang_status, mark_lang_status, free_lang_status):
Move to langhooks.h.
* langhooks-def.h (LANG_HOOKS_FUNCTION_INIT,
LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK,
LANG_HOOKS_FUNCTION_INITIALIZER): New.
(LANG_HOOKS_INITIALIZER): Update.
(lhd_do_nothing_f): New.
* langhooks.h (struct lang_hooks_for_functions): New.
(struct lang_hooks): New hooks.
* langhooks.c (lhd_do_nothing_f): New.
cp:
* cp-lang.c (LANG_HOOKS_FUNCTION_INIT,
LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_MARK): Redefine.
* cp-tree.h (cxx_push_function_context, cxx_pop_function_context,
cxx_mark_function_context): New.
* decl.c (push_cp_function_context, pop_cp_function_context,
mark_cp_function_context): Rename for consistency.
(cxx_init_decl_processing): Don't set old hooks.
objc:
* objc-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine.
From-SVN: r52551
2002-04-20 11:14:37 +02:00
|
|
|
/* Do nothing (tree). */
|
2002-02-28 08:39:44 +01:00
|
|
|
|
|
|
|
void
|
|
|
|
lhd_do_nothing_t (t)
|
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-04-25 08:24:41 +02:00
|
|
|
/* Do nothing (int). */
|
|
|
|
|
|
|
|
void
|
|
|
|
lhd_do_nothing_i (i)
|
|
|
|
int i ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* decl.c (push_c_function_context, pop_c_function_context,
mark_c_function_context): Rename for consistency.
* c-objc-common.c (c_objc_common_init): Langhooks set elsewhere.
* c-tree.h (push_c_function_context, pop_c_function_context,
mark_c_function_context): Rename for consistency.
* c-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine.
* function.c (init_lang_status, save_lang_status,
restore_lang_status, mark_lang_status, free_lang_status):
Move to langhooks.h.
(push_function_context_to, pop_function_context_from,
free_after_parsing, prepare_function_start, ggc_mark_struct_function):
Update.
* function.h (init_lang_status, save_lang_status,
restore_lang_status, mark_lang_status, free_lang_status):
Move to langhooks.h.
* langhooks-def.h (LANG_HOOKS_FUNCTION_INIT,
LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK,
LANG_HOOKS_FUNCTION_INITIALIZER): New.
(LANG_HOOKS_INITIALIZER): Update.
(lhd_do_nothing_f): New.
* langhooks.h (struct lang_hooks_for_functions): New.
(struct lang_hooks): New hooks.
* langhooks.c (lhd_do_nothing_f): New.
cp:
* cp-lang.c (LANG_HOOKS_FUNCTION_INIT,
LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_MARK): Redefine.
* cp-tree.h (cxx_push_function_context, cxx_pop_function_context,
cxx_mark_function_context): New.
* decl.c (push_cp_function_context, pop_cp_function_context,
mark_cp_function_context): Rename for consistency.
(cxx_init_decl_processing): Don't set old hooks.
objc:
* objc-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED,
LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine.
From-SVN: r52551
2002-04-20 11:14:37 +02:00
|
|
|
/* Do nothing (function). */
|
|
|
|
|
|
|
|
void
|
|
|
|
lhd_do_nothing_f (f)
|
|
|
|
struct function *f ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
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
2001-11-27 15:31:29 +01:00
|
|
|
/* Do nothing (return the tree node passed). */
|
|
|
|
|
|
|
|
tree
|
|
|
|
lhd_return_tree (t)
|
|
|
|
tree t;
|
|
|
|
{
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2002-03-25 20:11:13 +01:00
|
|
|
/* Do nothing (return NULL_TREE). */
|
|
|
|
|
|
|
|
tree
|
|
|
|
lhd_return_null_tree (t)
|
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return NULL_TREE;
|
|
|
|
}
|
|
|
|
|
2001-10-21 23:03:48 +02:00
|
|
|
/* Do nothing; the default hook to decode an option. */
|
alias.c (can_address_p): Compnonents are not addressable if the containing type has alias set 0.
* alias.c (can_address_p): Compnonents are not addressable if
the containing type has alias set 0.
(get_alias_set): Rework to use STRIP_NOPS.
Only call front-end routine on object, type, or object with
NOPs stripped, not inner values.
Use language hook to call front-end routine.
* builtins.c (get_memory_rtx): Always call set_mem_attributes.
(expand_builtin_apply): Call set_mem_align on MEMs we make.
Don't pass alignment to emit_block_move.
(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
(expand_builtin_memset): Likewise, but for clear_storage.
* c-common.c (lang_get_alias_set): Renamed to c_common_alias_set
and remove C++ specific parts.
* c-common.h (c_common_get_alias_set): Add declaration.
* c-lang.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
* calls.c (emit_call_1): Fix typo in sibcall_pop case.
(save_fixed_argument_area): Call set_mem_align.
Remove alignment in call to emit_block_move.
(emit_library_call_value_1, store_one_arg): Likewise.
(target_for_arg): Remove; disabled long ago.
* emit-rtl.c (set_mem_attributes): Rework to only call get_mem_attrs
once and similar cleanups.
(offset_address): Use proper introductory comment.
* expr.c (emit_block_move): Use alignment from that of MEM args, not
from explicit operand; all callers changed.
(clear_storage): Likewise.
(expand_assignment): Don't call set_mem_alias_set on to_rtx.
(store_field): Remove kludge on alias set used for to_rtx.
(highest_pow2_factor, case *_DIV_EXPR): Never return 0.
(expand_expr_unaligned): Call set_mem_attributes instead of
set_mem_alias_set.
* expr.h (emit_block_move, clear_storage): Remove ALIGN argument.
* function.c (assign_stack_temp_for_type): Set MEM alignment.
(expand_function_end): Track MEM attributes of trampolines.
* ifcvt.c (noce_try_cmove_arith): Set alignment of new MEM.
* integrate.c (copy_rtx_and_substitute, case CALL): Copy memory
attributes from original.
* langhooks.c (lang_hook_default_get_alias_set): New function.
(hook_get_alias_set_0): New function.
* langhooks.h (hook_get_alias_set_0): New declaration.
(lang_hook_default_get_alias_set): Likewise.
(LANG_HOOKS_GET_ALIAS_SET): New macro; add to initializer.
* reload1.c (alter_reg): Use adjust_address_nv.
* rtl.c (get_mode_alignment): Moved to here.
* rtl.h (MEM_ALIGN): Take default from mode, if not BLKmode, and
change default if unknown from 1 to BITS_PER_UNIT.
* stor-layout.c (get_mode_alignment): Remove from here.
* toplev.h (struct lang_hoks): Add get_alias_set field.
* tree.h (lang_get_alias_set): Delete declaration.
* config/arc/arc.c (arc_setup_incoming_varags): Set MEM alignment.
* config/i386/i386.c (ix86_setup_incoming_varargs): Likewise.
(ix86_va_arg): Likewise.
* config/i960/i960.c (i960_setup_incoming_varargs): Likewise.
* config/pa/pa.c (hppa_builtin_saveregs): Likewise.
* config/sparc/sparc.c (sparc_va_arg): Likewise.
* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
(expand_block_move_mem): Remove dead code.
* cp/cp-lang.c (cxx_get_alias_set): New function.
Point LANG_HOOKS_GET_ALIAS_SET to it.
* f/com.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
(lang_get_alias_set): Delete.
* java/lang.c (lang_get_alias_set): Deleted.
From-SVN: r46440
2001-10-23 20:51:18 +02:00
|
|
|
|
2001-10-21 23:03:48 +02:00
|
|
|
int
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_decode_option (argc, argv)
|
2001-10-21 23:03:48 +02:00
|
|
|
int argc ATTRIBUTE_UNUSED;
|
|
|
|
char **argv ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2001-10-08 22:54:07 +02:00
|
|
|
|
Makefile.in: Update.
* Makefile.in: Update.
* c-decl.c (print_lang_decl, print_lang_type): Remove.
(print_lang_identifier): Rename c_print_identifier.
* c-lang.c (LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
(print_lang_statistics, lang_print_xnode): Remove.
* c-parse.in (set_yydebug): Rename c_set_yydebug.
* c-tree.h (c_set_yydebug, c_print_identifier): New.
* langhooks-def.h (lhd_print_tree_nothing, lhd_set_yydebug): New.
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New members.
(lang_print_tree_hook): New.
* langhooks.c (lhd_print_tree_nothing, lhd_set_yydebug): New.
* print-tree.c: Include langhooks.h.
(print_node): Update.
* toplev.c (decode_d_option): Update.
* tree.c: Include langhooks.h.
(dump_tree_statistics): Update.
* tree.h (print_lang_statistics, print_lang_decl, print_lang_type,
print_lang_identifier, set_yydebug, lang_print_xnode): Remove.
ada:
* misc.c (gnat_print_decl, gnat_print_type): Renamed.
(LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override.
(print_lang_statistics, lang_print_xnode, print_lang_identifier,
set_yydebug): Remove.
cp:
* cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override.
* cp-tree.h (print_class_statistics): Remove.
(cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type,
cxx_print_identifier, cxx_set_yydebug): New.
* lex.c (set_yydebug): Rename c_set_yydebug.
* ptree.c (print_lang_decl, print_lang_type, print_lang_identifier,
lang_print_xnode): Rename.
* tree.c (print_lang_statistics): Rename.
f:
* com.c (ffe_print_identifier): Rename.
(LANG_HOOKS_PRINT_IDENTIFIER): Override.
(lang_print_xnode, print_lang_decl, print_lang_statistics,
print_lang_type, set_yydebug): Remove.
java:
* java-tree.h (java_set_yydebug): New.
* jcf-parse.c (set_yydebug): Rename java_set_yydebug.
* lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
(print_lang_decl, print_lang_type, print_lang_identifier,
print_lang_statistics, lang_print_xnode): Remove.
objc:
* objc-act.c (LANG_HOOKS_PRINT_IDENTIFIER,
LANG_HOOKS_SET_YYDEBUG): Override.
(lang_print_xnode, print_lang_statistics): Remove.
From-SVN: r46907
2001-11-10 00:30:44 +01:00
|
|
|
/* Called from by print-tree.c. */
|
|
|
|
|
|
|
|
void
|
|
|
|
lhd_print_tree_nothing (file, node, indent)
|
|
|
|
FILE *file ATTRIBUTE_UNUSED;
|
|
|
|
tree node ATTRIBUTE_UNUSED;
|
|
|
|
int indent ATTRIBUTE_UNUSED;
|
|
|
|
{
|
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
2001-11-27 15:31:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Called from safe_from_p. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lhd_safe_from_p (x, exp)
|
2001-11-28 13:13:50 +01:00
|
|
|
rtx x ATTRIBUTE_UNUSED;
|
|
|
|
tree exp ATTRIBUTE_UNUSED;
|
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
2001-11-27 15:31:29 +01:00
|
|
|
{
|
|
|
|
return 1;
|
2001-12-04 23:49:20 +01:00
|
|
|
}
|
|
|
|
|
2002-04-01 00:40:57 +02:00
|
|
|
/* Called from unsafe_for_reeval. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lhd_unsafe_for_reeval (t)
|
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2001-12-04 23:49:20 +01:00
|
|
|
/* Called from staticp. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lhd_staticp (exp)
|
2001-12-06 19:15:46 +01:00
|
|
|
tree exp ATTRIBUTE_UNUSED;
|
2001-12-04 23:49:20 +01:00
|
|
|
{
|
|
|
|
return 0;
|
Makefile.in: Update.
* Makefile.in: Update.
* c-decl.c (print_lang_decl, print_lang_type): Remove.
(print_lang_identifier): Rename c_print_identifier.
* c-lang.c (LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
(print_lang_statistics, lang_print_xnode): Remove.
* c-parse.in (set_yydebug): Rename c_set_yydebug.
* c-tree.h (c_set_yydebug, c_print_identifier): New.
* langhooks-def.h (lhd_print_tree_nothing, lhd_set_yydebug): New.
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
(LANG_HOOKS_INITIALIZER): Update.
* langhooks.h (struct lang_hooks): New members.
(lang_print_tree_hook): New.
* langhooks.c (lhd_print_tree_nothing, lhd_set_yydebug): New.
* print-tree.c: Include langhooks.h.
(print_node): Update.
* toplev.c (decode_d_option): Update.
* tree.c: Include langhooks.h.
(dump_tree_statistics): Update.
* tree.h (print_lang_statistics, print_lang_decl, print_lang_type,
print_lang_identifier, set_yydebug, lang_print_xnode): Remove.
ada:
* misc.c (gnat_print_decl, gnat_print_type): Renamed.
(LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override.
(print_lang_statistics, lang_print_xnode, print_lang_identifier,
set_yydebug): Remove.
cp:
* cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override.
* cp-tree.h (print_class_statistics): Remove.
(cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type,
cxx_print_identifier, cxx_set_yydebug): New.
* lex.c (set_yydebug): Rename c_set_yydebug.
* ptree.c (print_lang_decl, print_lang_type, print_lang_identifier,
lang_print_xnode): Rename.
* tree.c (print_lang_statistics): Rename.
f:
* com.c (ffe_print_identifier): Rename.
(LANG_HOOKS_PRINT_IDENTIFIER): Override.
(lang_print_xnode, print_lang_decl, print_lang_statistics,
print_lang_type, set_yydebug): Remove.
java:
* java-tree.h (java_set_yydebug): New.
* jcf-parse.c (set_yydebug): Rename java_set_yydebug.
* lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
(print_lang_decl, print_lang_type, print_lang_identifier,
print_lang_statistics, lang_print_xnode): Remove.
objc:
* objc-act.c (LANG_HOOKS_PRINT_IDENTIFIER,
LANG_HOOKS_SET_YYDEBUG): Override.
(lang_print_xnode, print_lang_statistics): Remove.
From-SVN: r46907
2001-11-10 00:30:44 +01:00
|
|
|
}
|
|
|
|
|
2002-04-04 00:39:51 +02:00
|
|
|
/* Called from check_global_declarations. */
|
|
|
|
|
|
|
|
bool
|
|
|
|
lhd_warn_unused_global_decl (decl)
|
|
|
|
tree decl;
|
|
|
|
{
|
|
|
|
/* This is what used to exist in check_global_declarations. Probably
|
|
|
|
not many of these actually apply to non-C languages. */
|
|
|
|
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
|
|
|
|
return false;
|
|
|
|
if (TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl))
|
|
|
|
return false;
|
|
|
|
if (DECL_IN_SYSTEM_HEADER (decl))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-04-04 00:26:37 +02:00
|
|
|
/* Set the DECL_ASSEMBLER_NAME for DECL. */
|
|
|
|
void
|
|
|
|
lhd_set_decl_assembler_name (decl)
|
|
|
|
tree decl;
|
|
|
|
{
|
|
|
|
/* The language-independent code should never use the
|
|
|
|
DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and
|
|
|
|
VAR_DECLs for variables with static storage duration need a real
|
|
|
|
DECL_ASSEMBLER_NAME. */
|
|
|
|
if (TREE_CODE (decl) == FUNCTION_DECL
|
2002-05-30 22:55:11 +02:00
|
|
|
|| (TREE_CODE (decl) == VAR_DECL
|
|
|
|
&& (TREE_STATIC (decl)
|
|
|
|
|| DECL_EXTERNAL (decl)
|
2002-04-04 00:26:37 +02:00
|
|
|
|| TREE_PUBLIC (decl))))
|
|
|
|
/* By default, assume the name to use in assembly code is the
|
|
|
|
same as that used in the source language. (That's correct
|
|
|
|
for C, and GCC used to set DECL_ASSEMBLER_NAME to the same
|
|
|
|
value as DECL_NAME in build_decl, so this choice provides
|
|
|
|
backwards compatibility with existing front-ends. */
|
|
|
|
SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
|
|
|
|
else
|
|
|
|
/* Nobody should ever be asking for the DECL_ASSEMBLER_NAME of
|
|
|
|
these DECLs -- unless they're in language-dependent code, in
|
|
|
|
which case set_decl_assembler_name hook should handle things. */
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
2001-10-25 19:57:03 +02:00
|
|
|
/* Provide a default routine to clear the binding stack. This is used
|
|
|
|
by languages that don't need to do anything special. */
|
|
|
|
void
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_clear_binding_stack ()
|
2001-10-25 19:57:03 +02:00
|
|
|
{
|
Makefile.in (fold-const.o, [...]): Update.
* 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.
From-SVN: r51136
2002-03-21 19:39:29 +01:00
|
|
|
while (! (*lang_hooks.decls.global_bindings_p) ())
|
2001-10-25 19:57:03 +02:00
|
|
|
poplevel (0, 0, 0);
|
|
|
|
}
|
|
|
|
|
2002-04-19 08:22:18 +02:00
|
|
|
/* Type promotion for variable arguments. */
|
|
|
|
tree
|
|
|
|
lhd_type_promotes_to (type)
|
|
|
|
tree type ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
2002-04-18 19:54:11 +02:00
|
|
|
/* Invalid use of an incomplete type. */
|
|
|
|
void
|
|
|
|
lhd_incomplete_type_error (value, type)
|
|
|
|
tree value ATTRIBUTE_UNUSED, type;
|
|
|
|
{
|
|
|
|
if (TREE_CODE (type) == ERROR_MARK)
|
|
|
|
return;
|
|
|
|
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
2001-10-25 19:57:03 +02:00
|
|
|
/* Provide a default routine for alias sets that always returns -1. This
|
|
|
|
is used by languages that don't need to do anything special. */
|
|
|
|
|
|
|
|
HOST_WIDE_INT
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_get_alias_set (t)
|
2001-10-25 19:57:03 +02:00
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
alias.c (can_address_p): Compnonents are not addressable if the containing type has alias set 0.
* alias.c (can_address_p): Compnonents are not addressable if
the containing type has alias set 0.
(get_alias_set): Rework to use STRIP_NOPS.
Only call front-end routine on object, type, or object with
NOPs stripped, not inner values.
Use language hook to call front-end routine.
* builtins.c (get_memory_rtx): Always call set_mem_attributes.
(expand_builtin_apply): Call set_mem_align on MEMs we make.
Don't pass alignment to emit_block_move.
(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
(expand_builtin_memset): Likewise, but for clear_storage.
* c-common.c (lang_get_alias_set): Renamed to c_common_alias_set
and remove C++ specific parts.
* c-common.h (c_common_get_alias_set): Add declaration.
* c-lang.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
* calls.c (emit_call_1): Fix typo in sibcall_pop case.
(save_fixed_argument_area): Call set_mem_align.
Remove alignment in call to emit_block_move.
(emit_library_call_value_1, store_one_arg): Likewise.
(target_for_arg): Remove; disabled long ago.
* emit-rtl.c (set_mem_attributes): Rework to only call get_mem_attrs
once and similar cleanups.
(offset_address): Use proper introductory comment.
* expr.c (emit_block_move): Use alignment from that of MEM args, not
from explicit operand; all callers changed.
(clear_storage): Likewise.
(expand_assignment): Don't call set_mem_alias_set on to_rtx.
(store_field): Remove kludge on alias set used for to_rtx.
(highest_pow2_factor, case *_DIV_EXPR): Never return 0.
(expand_expr_unaligned): Call set_mem_attributes instead of
set_mem_alias_set.
* expr.h (emit_block_move, clear_storage): Remove ALIGN argument.
* function.c (assign_stack_temp_for_type): Set MEM alignment.
(expand_function_end): Track MEM attributes of trampolines.
* ifcvt.c (noce_try_cmove_arith): Set alignment of new MEM.
* integrate.c (copy_rtx_and_substitute, case CALL): Copy memory
attributes from original.
* langhooks.c (lang_hook_default_get_alias_set): New function.
(hook_get_alias_set_0): New function.
* langhooks.h (hook_get_alias_set_0): New declaration.
(lang_hook_default_get_alias_set): Likewise.
(LANG_HOOKS_GET_ALIAS_SET): New macro; add to initializer.
* reload1.c (alter_reg): Use adjust_address_nv.
* rtl.c (get_mode_alignment): Moved to here.
* rtl.h (MEM_ALIGN): Take default from mode, if not BLKmode, and
change default if unknown from 1 to BITS_PER_UNIT.
* stor-layout.c (get_mode_alignment): Remove from here.
* toplev.h (struct lang_hoks): Add get_alias_set field.
* tree.h (lang_get_alias_set): Delete declaration.
* config/arc/arc.c (arc_setup_incoming_varags): Set MEM alignment.
* config/i386/i386.c (ix86_setup_incoming_varargs): Likewise.
(ix86_va_arg): Likewise.
* config/i960/i960.c (i960_setup_incoming_varargs): Likewise.
* config/pa/pa.c (hppa_builtin_saveregs): Likewise.
* config/sparc/sparc.c (sparc_va_arg): Likewise.
* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
(expand_block_move_mem): Remove dead code.
* cp/cp-lang.c (cxx_get_alias_set): New function.
Point LANG_HOOKS_GET_ALIAS_SET to it.
* f/com.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
(lang_get_alias_set): Delete.
* java/lang.c (lang_get_alias_set): Deleted.
From-SVN: r46440
2001-10-23 20:51:18 +02:00
|
|
|
/* Provide a hook routine for alias sets that always returns 0. This is
|
|
|
|
used by languages that haven't deal with alias sets yet. */
|
|
|
|
|
|
|
|
HOST_WIDE_INT
|
|
|
|
hook_get_alias_set_0 (t)
|
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-03-27 19:28:06 +01:00
|
|
|
/* This is the default expand_expr function. */
|
|
|
|
|
|
|
|
rtx
|
|
|
|
lhd_expand_expr (t, r, mm, em)
|
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
rtx r ATTRIBUTE_UNUSED;
|
|
|
|
enum machine_mode mm ATTRIBUTE_UNUSED;
|
|
|
|
int em ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
2002-03-20 08:58:41 +01:00
|
|
|
/* This is the default decl_printable_name function. */
|
|
|
|
|
|
|
|
const char *
|
|
|
|
lhd_decl_printable_name (decl, verbosity)
|
|
|
|
tree decl;
|
|
|
|
int verbosity ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return IDENTIFIER_POINTER (DECL_NAME (decl));
|
|
|
|
}
|
|
|
|
|
2001-10-08 22:54:07 +02:00
|
|
|
/* lang_hooks.tree_inlining.walk_subtrees is called by walk_tree()
|
|
|
|
after handling common cases, but before walking code-specific
|
|
|
|
sub-trees. If this hook is overridden for a language, it should
|
|
|
|
handle language-specific tree codes, as well as language-specific
|
|
|
|
information associated to common tree codes. If a tree node is
|
|
|
|
completely handled within this function, it should set *SUBTREES to
|
|
|
|
0, so that generic handling isn't attempted. For language-specific
|
|
|
|
tree codes, generic handling would abort(), so make sure it is set
|
|
|
|
properly. Both SUBTREES and *SUBTREES is guaranteed to be non-zero
|
|
|
|
when the function is called. */
|
|
|
|
|
|
|
|
tree
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
|
2001-10-08 22:54:07 +02:00
|
|
|
tree *tp ATTRIBUTE_UNUSED;
|
|
|
|
int *subtrees ATTRIBUTE_UNUSED;
|
|
|
|
walk_tree_fn func ATTRIBUTE_UNUSED;
|
|
|
|
void *data ATTRIBUTE_UNUSED;
|
|
|
|
void *htab ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return NULL_TREE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.cannot_inline_tree_fn is called to
|
|
|
|
determine whether there are language-specific reasons for not
|
|
|
|
inlining a given function. */
|
|
|
|
|
|
|
|
int
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_cannot_inline_tree_fn (fnp)
|
2002-02-22 01:09:04 +01:00
|
|
|
tree *fnp;
|
2001-10-08 22:54:07 +02:00
|
|
|
{
|
2002-03-22 00:15:38 +01:00
|
|
|
if (flag_really_no_inline
|
2002-02-22 01:09:04 +01:00
|
|
|
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (*fnp)) == NULL)
|
|
|
|
return 1;
|
|
|
|
|
2001-10-08 22:54:07 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.disregard_inline_limits is called to
|
|
|
|
determine whether a function should be considered for inlining even
|
|
|
|
if it would exceed inlining limits. */
|
|
|
|
|
|
|
|
int
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_disregard_inline_limits (fn)
|
2002-02-22 01:09:04 +01:00
|
|
|
tree fn;
|
2001-10-08 22:54:07 +02:00
|
|
|
{
|
2002-02-22 01:09:04 +01:00
|
|
|
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
|
|
|
|
return 1;
|
|
|
|
|
2001-10-08 22:54:07 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.add_pending_fn_decls is called before
|
|
|
|
starting to inline a function, to push any language-specific
|
|
|
|
functions that should not be inlined into the current function,
|
|
|
|
into VAFNP. PFN is the top of varray, and should be returned if no
|
|
|
|
functions are pushed into VAFNP. The top of the varray should be
|
|
|
|
returned. */
|
|
|
|
|
|
|
|
tree
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_add_pending_fn_decls (vafnp, pfn)
|
2001-10-08 22:54:07 +02:00
|
|
|
void *vafnp ATTRIBUTE_UNUSED;
|
|
|
|
tree pfn;
|
|
|
|
{
|
|
|
|
return pfn;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.tree_chain_matters_p indicates whether the
|
|
|
|
TREE_CHAIN of a language-specific tree node is relevant, i.e.,
|
|
|
|
whether it should be walked, copied and preserved across copies. */
|
|
|
|
|
|
|
|
int
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_tree_chain_matters_p (t)
|
2001-10-08 22:54:07 +02:00
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.auto_var_in_fn_p is called to determine
|
|
|
|
whether VT is an automatic variable defined in function FT. */
|
|
|
|
|
|
|
|
int
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_auto_var_in_fn_p (var, fn)
|
2001-10-08 22:54:07 +02:00
|
|
|
tree var, fn;
|
|
|
|
{
|
|
|
|
return (DECL_P (var) && DECL_CONTEXT (var) == fn
|
|
|
|
&& (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
|
|
|
|
&& ! TREE_STATIC (var))
|
|
|
|
|| TREE_CODE (var) == LABEL_DECL
|
|
|
|
|| TREE_CODE (var) == RESULT_DECL));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.copy_res_decl_for_inlining should return a
|
|
|
|
declaration for the result RES of function FN to be inlined into
|
|
|
|
CALLER. NDP points to an integer that should be set in case a new
|
|
|
|
declaration wasn't created (presumably because RES was of aggregate
|
|
|
|
type, such that a TARGET_EXPR is used for the result). TEXPS is a
|
|
|
|
pointer to a varray with the stack of TARGET_EXPRs seen while
|
|
|
|
inlining functions into caller; the top of TEXPS is supposed to
|
|
|
|
match RES. */
|
|
|
|
|
|
|
|
tree
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_copy_res_decl_for_inlining (res, fn, caller,
|
|
|
|
dm, ndp, texps)
|
2001-10-08 22:54:07 +02:00
|
|
|
tree res, fn, caller;
|
|
|
|
void *dm ATTRIBUTE_UNUSED;
|
|
|
|
int *ndp ATTRIBUTE_UNUSED;
|
|
|
|
void *texps ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return copy_decl_for_inlining (res, fn, caller);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* lang_hooks.tree_inlining.anon_aggr_type_p determines whether T is a
|
|
|
|
type node representing an anonymous aggregate (union, struct, etc),
|
|
|
|
i.e., one whose members are in the same scope as the union itself. */
|
|
|
|
|
|
|
|
int
|
2001-11-06 22:12:14 +01:00
|
|
|
lhd_tree_inlining_anon_aggr_type_p (t)
|
2001-10-08 22:54:07 +02:00
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-12-06 00:48:19 +01:00
|
|
|
/* lang_hooks.tree_inlining.start_inlining and end_inlining perform any
|
|
|
|
language-specific bookkeeping necessary for processing
|
|
|
|
FN. start_inlining returns non-zero if inlining should proceed, zero if
|
|
|
|
not.
|
|
|
|
|
|
|
|
For instance, the C++ version keeps track of template instantiations to
|
|
|
|
avoid infinite recursion. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lhd_tree_inlining_start_inlining (fn)
|
|
|
|
tree fn ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
lhd_tree_inlining_end_inlining (fn)
|
|
|
|
tree fn ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2002-03-19 09:47:14 +01:00
|
|
|
/* lang_hooks.tree_inlining.convert_parm_for_inlining performs any
|
|
|
|
language-specific conversion before assigning VALUE to PARM. */
|
|
|
|
|
|
|
|
tree
|
|
|
|
lhd_tree_inlining_convert_parm_for_inlining (parm, value, fndecl)
|
|
|
|
tree parm ATTRIBUTE_UNUSED;
|
|
|
|
tree value;
|
|
|
|
tree fndecl ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2002-05-30 22:55:11 +02:00
|
|
|
/* lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree
|
|
|
|
nodes. Returns non-zero if it does not want the usual dumping of the
|
tree-dump.c: Rename from c-dump.c.
* tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h.
(lang_type_quals): Declare.
(dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to
retrieve language-specific qualifiers for a type node, instead of
C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of
lang_dump_tree.
* tree-dump.h: Rename from c-dump.h.
* c-common.h (C_TYPE_QUALS): Removed.
Move declarations for tree-dump.c interface to...
* tree.h: ... here. Remove lang_dump_tree.
* langhooks.h (struct lang_hooks_for_tree_dump): New.
(struct lang_hooks): Add tree_dump hooks.
* langhooks.c (lhd_tree_dump_dump_tree): New function.
(lhd_tree_dump_type_quals): New function.
* langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals):
Declare.
(LANG_HOOKS_INITIALIZER): Add tree_dump hooks.
* Makefile.in: Move tree-dump.o to language-independent back-end.
cp:
* cp-tree.h (CP_TYPE_QUALS): Removed.
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
* dump.c (cp_dump_tree): Use void* dump_info argument to match
lang-hooks prototype.
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
CP_TYPE_QUALS changed to cp_type_quals.
* Make-lang.in: References to c-dump.h changed to tree-dump.h.
(CXX_C_OBJS): Remove c-dump.o.
From-SVN: r47257
2001-11-22 03:33:02 +01:00
|
|
|
second argument. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lhd_tree_dump_dump_tree (di, t)
|
|
|
|
void *di ATTRIBUTE_UNUSED;
|
|
|
|
tree t ATTRIBUTE_UNUSED;
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-05-30 22:55:11 +02:00
|
|
|
/* lang_hooks.tree_dump.type_qual: Determine type qualifiers in a
|
tree-dump.c: Rename from c-dump.c.
* tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h.
(lang_type_quals): Declare.
(dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to
retrieve language-specific qualifiers for a type node, instead of
C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of
lang_dump_tree.
* tree-dump.h: Rename from c-dump.h.
* c-common.h (C_TYPE_QUALS): Removed.
Move declarations for tree-dump.c interface to...
* tree.h: ... here. Remove lang_dump_tree.
* langhooks.h (struct lang_hooks_for_tree_dump): New.
(struct lang_hooks): Add tree_dump hooks.
* langhooks.c (lhd_tree_dump_dump_tree): New function.
(lhd_tree_dump_type_quals): New function.
* langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals):
Declare.
(LANG_HOOKS_INITIALIZER): Add tree_dump hooks.
* Makefile.in: Move tree-dump.o to language-independent back-end.
cp:
* cp-tree.h (CP_TYPE_QUALS): Removed.
* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
* dump.c (cp_dump_tree): Use void* dump_info argument to match
lang-hooks prototype.
* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
CP_TYPE_QUALS changed to cp_type_quals.
* Make-lang.in: References to c-dump.h changed to tree-dump.h.
(CXX_C_OBJS): Remove c-dump.o.
From-SVN: r47257
2001-11-22 03:33:02 +01:00
|
|
|
language-specific way. */
|
|
|
|
|
|
|
|
int
|
|
|
|
lhd_tree_dump_type_quals (t)
|
|
|
|
tree t;
|
|
|
|
{
|
|
|
|
return TYPE_QUALS (t);
|
|
|
|
}
|