langhooks.c (lang_hook_default_do_nothing, [...]): New defaults.
* langhooks.c (lang_hook_default_do_nothing, lang_hook_default_decode_option): New defaults. * langhooks.h: Make hooks unconditional and non-NULL. * toplev.c (compile_file, toplev_main): Update. * toplev.h: Update comments. * objc/objc-act.c (lang_hooks): Update to new paradigm. From-SVN: r46396
This commit is contained in:
parent
5297e08564
commit
77b1a9217b
|
@ -1,3 +1,12 @@
|
||||||
|
2001-10-21 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||||
|
|
||||||
|
* langhooks.c (lang_hook_default_do_nothing,
|
||||||
|
lang_hook_default_decode_option): New defaults.
|
||||||
|
* langhooks.h: Make hooks unconditional and non-NULL.
|
||||||
|
* toplev.c (compile_file, toplev_main): Update.
|
||||||
|
* toplev.h: Update comments.
|
||||||
|
* objc/objc-act.c (lang_hooks): Update to new paradigm.
|
||||||
|
|
||||||
2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
* arm.h (FUNCTION_ARG_REGNO_P): Use IN_RANGE.
|
* arm.h (FUNCTION_ARG_REGNO_P): Use IN_RANGE.
|
||||||
|
|
|
@ -29,6 +29,20 @@ Boston, MA 02111-1307, USA. */
|
||||||
#include "integrate.h"
|
#include "integrate.h"
|
||||||
#include "langhooks.h"
|
#include "langhooks.h"
|
||||||
|
|
||||||
|
/* Do nothing; in many cases the default hook. */
|
||||||
|
void
|
||||||
|
lang_hook_default_do_nothing ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Do nothing; the default hook to decode an option. */
|
||||||
|
int
|
||||||
|
lang_hook_default_decode_option (argc, argv)
|
||||||
|
int argc ATTRIBUTE_UNUSED;
|
||||||
|
char **argv ATTRIBUTE_UNUSED;
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* lang_hooks.tree_inlining.walk_subtrees is called by walk_tree()
|
/* lang_hooks.tree_inlining.walk_subtrees is called by walk_tree()
|
||||||
after handling common cases, but before walking code-specific
|
after handling common cases, but before walking code-specific
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Macros to initialize the lang_hooks data structure.
|
/* Default macros to initialize the lang_hooks data structure.
|
||||||
Copyright 2001 Free Software Foundation, Inc.
|
Copyright 2001 Free Software Foundation, Inc.
|
||||||
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
|
@ -22,26 +22,25 @@ Boston, MA 02111-1307, USA. */
|
||||||
#ifndef GCC_LANG_HOOKS_H
|
#ifndef GCC_LANG_HOOKS_H
|
||||||
#define GCC_LANG_HOOKS_H
|
#define GCC_LANG_HOOKS_H
|
||||||
|
|
||||||
/* Older hooks, that don't go in sub-structures for backward
|
/* Note to creators of new hooks:
|
||||||
compatibility. */
|
|
||||||
#ifndef LANG_HOOKS_INIT
|
The macros in this file should NOT be surrounded by a
|
||||||
#define LANG_HOOKS_INIT NULL
|
#ifdef...#endif pair, since this file declares the defaults. Each
|
||||||
#endif
|
front end overrides any hooks it wishes to, in the file containing
|
||||||
#ifndef LANG_HOOKS_FINISH
|
its struct lang_hooks, AFTER including this file. */
|
||||||
#define LANG_HOOKS_FINISH NULL
|
|
||||||
#endif
|
/* See toplev.h for the definition and documentation of each hook. */
|
||||||
#ifndef LANG_HOOKS_INIT_OPTIONS
|
|
||||||
#define LANG_HOOKS_INIT_OPTIONS NULL
|
extern void lang_hook_default_do_nothing PARAMS ((void));
|
||||||
#endif
|
extern int lang_hook_default_decode_option PARAMS ((int, char **));
|
||||||
#ifndef LANG_HOOKS_DECODE_OPTION
|
|
||||||
#define LANG_HOOKS_DECODE_OPTION NULL
|
#define LANG_HOOKS_INIT lang_hook_default_do_nothing
|
||||||
#endif
|
#define LANG_HOOKS_FINISH lang_hook_default_do_nothing
|
||||||
#ifndef LANG_HOOKS_POST_OPTIONS
|
#define LANG_HOOKS_INIT_OPTIONS lang_hook_default_do_nothing
|
||||||
#define LANG_HOOKS_POST_OPTIONS NULL
|
#define LANG_HOOKS_DECODE_OPTION lang_hook_default_decode_option
|
||||||
#endif
|
#define LANG_HOOKS_POST_OPTIONS lang_hook_default_do_nothing
|
||||||
#ifndef LANG_HOOKS_HONOR_READONLY
|
|
||||||
#define LANG_HOOKS_HONOR_READONLY 0
|
#define LANG_HOOKS_HONOR_READONLY false
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Declarations of default tree inlining hooks. */
|
/* Declarations of default tree inlining hooks. */
|
||||||
tree tree_inlining_default_hook_walk_subtrees PARAMS ((tree*, int *,
|
tree tree_inlining_default_hook_walk_subtrees PARAMS ((tree*, int *,
|
||||||
|
@ -60,38 +59,22 @@ tree tree_inlining_default_hook_copy_res_decl_for_inlining PARAMS ((tree, tree,
|
||||||
int tree_inlining_default_hook_anon_aggr_type_p PARAMS ((tree));
|
int tree_inlining_default_hook_anon_aggr_type_p PARAMS ((tree));
|
||||||
|
|
||||||
/* Tree inlining hooks. */
|
/* Tree inlining hooks. */
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \
|
#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES \
|
||||||
tree_inlining_default_hook_walk_subtrees
|
tree_inlining_default_hook_walk_subtrees
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
|
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
|
||||||
tree_inlining_default_hook_cannot_inline_tree_fn
|
tree_inlining_default_hook_cannot_inline_tree_fn
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
|
#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
|
||||||
tree_inlining_default_hook_disregard_inline_limits
|
tree_inlining_default_hook_disregard_inline_limits
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
|
#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
|
||||||
tree_inlining_default_hook_add_pending_fn_decls
|
tree_inlining_default_hook_add_pending_fn_decls
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
|
#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
|
||||||
tree_inlining_default_hook_tree_chain_matters_p
|
tree_inlining_default_hook_tree_chain_matters_p
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
|
#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
|
||||||
tree_inlining_default_hook_auto_var_in_fn_p
|
tree_inlining_default_hook_auto_var_in_fn_p
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
|
#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
|
||||||
tree_inlining_default_hook_copy_res_decl_for_inlining
|
tree_inlining_default_hook_copy_res_decl_for_inlining
|
||||||
#endif
|
|
||||||
#ifndef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
|
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
|
||||||
tree_inlining_default_hook_anon_aggr_type_p
|
tree_inlining_default_hook_anon_aggr_type_p
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
|
#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
|
||||||
LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
|
LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
|
||||||
|
|
|
@ -58,6 +58,7 @@ Boston, MA 02111-1307, USA. */
|
||||||
#include "cpplib.h"
|
#include "cpplib.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
#include "langhooks.h"
|
||||||
|
|
||||||
/* This is the default way of generating a method name. */
|
/* This is the default way of generating a method name. */
|
||||||
/* I am not sure it is really correct.
|
/* I am not sure it is really correct.
|
||||||
|
@ -449,12 +450,17 @@ static int generating_instance_variables = 0;
|
||||||
|
|
||||||
static int print_struct_values = 0;
|
static int print_struct_values = 0;
|
||||||
|
|
||||||
|
#undef LANG_HOOKS_INIT
|
||||||
|
#define LANG_HOOKS_INIT objc_init
|
||||||
|
#undef LANG_HOOKS_INIT_OPTIONS
|
||||||
|
#define LANG_HOOKS_INIT_OPTIONS objc_init_options
|
||||||
|
#undef LANG_HOOKS_DECODE_OPTION
|
||||||
|
#define LANG_HOOKS_DECODE_OPTION objc_decode_option
|
||||||
|
#undef LANG_HOOKS_POST_OPTIONS
|
||||||
|
#define LANG_HOOKS_POST_OPTIONS objc_post_options
|
||||||
|
|
||||||
/* Each front end provides its own. */
|
/* Each front end provides its own. */
|
||||||
struct lang_hooks lang_hooks = {objc_init,
|
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||||
NULL, /* objc_finish */
|
|
||||||
objc_init_options,
|
|
||||||
objc_decode_option,
|
|
||||||
objc_post_options};
|
|
||||||
|
|
||||||
/* Post-switch processing. */
|
/* Post-switch processing. */
|
||||||
static void
|
static void
|
||||||
|
|
12
gcc/toplev.c
12
gcc/toplev.c
|
@ -2227,8 +2227,7 @@ compile_file (name)
|
||||||
|
|
||||||
/* Perform language-specific initialization.
|
/* Perform language-specific initialization.
|
||||||
This may set main_input_filename. */
|
This may set main_input_filename. */
|
||||||
if (lang_hooks.init)
|
(*lang_hooks.init) ();
|
||||||
(*lang_hooks.init) ();
|
|
||||||
|
|
||||||
/* If the input doesn't start with a #line, use the input name
|
/* If the input doesn't start with a #line, use the input name
|
||||||
as the official input file name. */
|
as the official input file name. */
|
||||||
|
@ -2428,8 +2427,7 @@ compile_file (name)
|
||||||
|
|
||||||
/* Language-specific end of compilation actions. */
|
/* Language-specific end of compilation actions. */
|
||||||
finish_syntax:
|
finish_syntax:
|
||||||
if (lang_hooks.finish)
|
(*lang_hooks.finish) ();
|
||||||
(*lang_hooks.finish) ();
|
|
||||||
|
|
||||||
/* Close the dump files. */
|
/* Close the dump files. */
|
||||||
|
|
||||||
|
@ -4671,8 +4669,7 @@ toplev_main (argc, argv)
|
||||||
add_params (lang_independent_params, LAST_PARAM);
|
add_params (lang_independent_params, LAST_PARAM);
|
||||||
|
|
||||||
/* Perform language-specific options intialization. */
|
/* Perform language-specific options intialization. */
|
||||||
if (lang_hooks.init_options)
|
(*lang_hooks.init_options) ();
|
||||||
(*lang_hooks.init_options) ();
|
|
||||||
|
|
||||||
/* Scan to see what optimization level has been specified. That will
|
/* Scan to see what optimization level has been specified. That will
|
||||||
determine the default value of many flags. */
|
determine the default value of many flags. */
|
||||||
|
@ -4847,8 +4844,7 @@ toplev_main (argc, argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All command line options have been processed. */
|
/* All command line options have been processed. */
|
||||||
if (lang_hooks.post_options)
|
(*lang_hooks.post_options) ();
|
||||||
(*lang_hooks.post_options) ();
|
|
||||||
|
|
||||||
if (exit_after_options)
|
if (exit_after_options)
|
||||||
exit (0);
|
exit (0);
|
||||||
|
|
|
@ -138,7 +138,7 @@ struct lang_hooks_for_tree_inlining
|
||||||
int (*anon_aggr_type_p) PARAMS ((union tree_node *));
|
int (*anon_aggr_type_p) PARAMS ((union tree_node *));
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Language-specific hooks. Can be NULL unless otherwise specified. */
|
/* Language-specific hooks. See langhooks.h for defaults. */
|
||||||
|
|
||||||
struct lang_hooks
|
struct lang_hooks
|
||||||
{
|
{
|
||||||
|
@ -158,9 +158,7 @@ struct lang_hooks
|
||||||
option. If this function returns a negative number, then its
|
option. If this function returns a negative number, then its
|
||||||
absolute value is the number of command-line arguments used, but,
|
absolute value is the number of command-line arguments used, but,
|
||||||
in addition, no language-independent option processing should be
|
in addition, no language-independent option processing should be
|
||||||
done for this option.
|
done for this option. */
|
||||||
|
|
||||||
This hook cannot be NULL. */
|
|
||||||
int (*decode_option) PARAMS ((int, char **));
|
int (*decode_option) PARAMS ((int, char **));
|
||||||
|
|
||||||
/* Called when all command line options have been processed. */
|
/* Called when all command line options have been processed. */
|
||||||
|
|
Loading…
Reference in New Issue