Commit 21ecc5a7 by Gabriel Dos Reis Committed by Gabriel Dos Reis

opts.c (decode_options): Do language-specific initialization for the global diagnostic context.

	* opts.c (decode_options): Do language-specific initialization for
	the global diagnostic context.
	* langhooks-def.h (lhd_initialize_diagnostics): Declare.
	(LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): New macro.
	(LANG_HOOKS_INITIALIZER): Adjust.
	* langhooks.h (struct lang_hooks): Add new field
	initialize_diagnostics.
	* langhooks.c (lhd_initialize_diagnostics): Define.

From-SVN: r70129
parent 8f7ace48
2003-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* opts.c (decode_options): Do language-specific initialization for
the global diagnostic context.
* langhooks-def.h (lhd_initialize_diagnostics): Declare.
(LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): New macro.
(LANG_HOOKS_INITIALIZER): Adjust.
* langhooks.h (struct lang_hooks): Add new field
initialize_diagnostics.
* langhooks.c (lhd_initialize_diagnostics): Define.
2003-08-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
* pretty-print.h: Adjust macro definitions.
* pretty-print.c (pp_newline): Rename to pp_base_newline.
(pp_character): Rename to pp_base_character.
(pp_string): Rename to pp_base_string.
* c-pretty-print.c (pp_buffer): Move to pretty-print.h
(pp_newline): Likewise. Adjust.
(pp_c_char): Adjust.
2003-08-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-08-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.def (BUILT_IN_ABS, BUILT_IN_IMAXABS, BUILT_IN_LABS, * builtins.def (BUILT_IN_ABS, BUILT_IN_IMAXABS, BUILT_IN_LABS,
......
...@@ -79,6 +79,7 @@ extern int lhd_tree_inlining_anon_aggr_type_p (tree); ...@@ -79,6 +79,7 @@ extern int lhd_tree_inlining_anon_aggr_type_p (tree);
extern int lhd_tree_inlining_start_inlining (tree); extern int lhd_tree_inlining_start_inlining (tree);
extern void lhd_tree_inlining_end_inlining (tree); extern void lhd_tree_inlining_end_inlining (tree);
extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree); extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree);
extern void lhd_initialize_diagnostics (struct diagnostic_context *);
#define LANG_HOOKS_NAME "GNU unknown" #define LANG_HOOKS_NAME "GNU unknown"
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier) #define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
...@@ -87,6 +88,7 @@ extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree); ...@@ -87,6 +88,7 @@ extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree);
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i #define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack #define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0 #define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
#define LANG_HOOKS_INITIALIZE_DIAGNOSTITCS lhd_initialize_diagnostics
#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0 #define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
#define LANG_HOOKS_MISSING_ARGUMENT hook_bool_constcharptr_size_t_false #define LANG_HOOKS_MISSING_ARGUMENT hook_bool_constcharptr_size_t_false
#define LANG_HOOKS_POST_OPTIONS lhd_post_options #define LANG_HOOKS_POST_OPTIONS lhd_post_options
...@@ -245,6 +247,7 @@ extern int lhd_tree_dump_type_quals (tree); ...@@ -245,6 +247,7 @@ extern int lhd_tree_dump_type_quals (tree);
LANG_HOOKS_IDENTIFIER_SIZE, \ LANG_HOOKS_IDENTIFIER_SIZE, \
LANG_HOOKS_TREE_SIZE, \ LANG_HOOKS_TREE_SIZE, \
LANG_HOOKS_INIT_OPTIONS, \ LANG_HOOKS_INIT_OPTIONS, \
LANG_HOOKS_INITIALIZE_DIAGNOSTITCS, \
LANG_HOOKS_HANDLE_OPTION, \ LANG_HOOKS_HANDLE_OPTION, \
LANG_HOOKS_MISSING_ARGUMENT, \ LANG_HOOKS_MISSING_ARGUMENT, \
LANG_HOOKS_POST_OPTIONS, \ LANG_HOOKS_POST_OPTIONS, \
......
...@@ -479,4 +479,10 @@ write_global_declarations (void) ...@@ -479,4 +479,10 @@ write_global_declarations (void)
free (vec); free (vec);
} }
/* Called to perform language-specific initialization of CTX. */
void
lhd_initialize_diagnostics (struct diagnostic_context *ctx ATTRIBUTE_UNUSED)
{
}
#include "gt-langhooks.h" #include "gt-langhooks.h"
...@@ -202,6 +202,10 @@ struct lang_hooks ...@@ -202,6 +202,10 @@ struct lang_hooks
the language mask to filter the switch array with. */ the language mask to filter the switch array with. */
unsigned int (*init_options) (unsigned int argc, const char **argv); unsigned int (*init_options) (unsigned int argc, const char **argv);
/* Callback used to perform language-specific initialization for the
global diagnostic context structure. */
void (*initialize_diagnostics) (struct diagnostic_context *);
/* Handle the switch CODE, which has real type enum opt_code from /* Handle the switch CODE, which has real type enum opt_code from
options.h. If the switch takes an argument, it is passed in ARG options.h. If the switch takes an argument, it is passed in ARG
which points to permanent storage. The handler is responsible for which points to permanent storage. The handler is responsible for
......
...@@ -460,6 +460,8 @@ decode_options (unsigned int argc, const char **argv) ...@@ -460,6 +460,8 @@ decode_options (unsigned int argc, const char **argv)
/* Perform language-specific options initialization. */ /* Perform language-specific options initialization. */
lang_mask = (*lang_hooks.init_options) (argc, argv); lang_mask = (*lang_hooks.init_options) (argc, argv);
lang_hooks.initialize_diagnostics (global_dc);
/* 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. */
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment