Commit 848eed92 by Gabriel Dos Reis Committed by Gabriel Dos Reis

Remove traditional C constructs 4/n.

	* decl2.c (grok_method_quals, warn_if_unknown_interface,
	grok_x_components, cp_build_parm_decl, build_artificial_parm,
	maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
	delete_sanity, check_member_template, check_java_method,
	check_classfn, finish_static_data_member_decl, grokfield,
	grokbitfield, grokoptypename, grok_function_init,
	cplus_decl_attributes, constructor_name, defer_fn,
	build_anon_union_vars, finish_anon_union, coerce_new_type,
	coerce_delete_type, comdat_linkage, maybe_make_one_only,
	key_method, import_export_vtable, import_export_class,
	output_vtable_inherit, import_export_decl, import_export_tinfo,
	build_cleanup, get_guard, get_guard_bits, get_guard_cond,
	set_guard, start_objects, finish_objects,
	start_static_storage_duration_function,
	finish_static_storage_duration_function, get_priority_info,
	start_static_initialization_or_destruction,
	finish_static_initialization_or_destruction,
	do_static_initialization, do_static_destruction,
	prune_vars_needing_no_initialization, write_out_vars,
	reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
	add_using_namespace, merge_functions, ambiguous_decl,
	lookup_using_namespace, lookup_using_namespace,
	qualified_lookup_using_namespace, set_decl_namespace,
	decl_namespace, current_decl_namespace, push_decl_namespace,
	pop_decl_namespace, push_scope, pop_scope, add_function,
	arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
	lookup_arg_dependent, do_namespace_alias,
	validate_nonmember_using_decl, do_nonmember_using_decl,
	do_toplevel_using_decl, do_local_using_decl,
	do_class_using_decl, do_using_directive, check_default_args,
	mark_used, handle_class_head): Use C90 prototypings.  Use booleans.
	* parser.c (cp_parser_class_head): Use booleanss.
	* decl.c (walk_globals, walk_vtables): Likewise.
	* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
	walk_globals): Change return type from 'int' to 'bool'.
	* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
	throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
	build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
	get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
	qualifier_flags, tinfo_base_init, generic_initializer,
	ptr_initializer, dfs_class_hint_mark, ptm_initializer,
	dfs_class_hint_unmark, class_hint_flags, class_initializer,
	typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
	get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
	unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
	* repo.c (repo_compile_flags, repo_template_declared,
	repo_template_defined, repo_class_defined, repo_get_id,
	repo_template_used, repo_vtable_used, repo_inline_used,
	repo_tinfo_used, repo_template_instantiated, extract_string,
	open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
	finish_repo): Likewise.
	* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
	cxx_print_xnode): Likewise..
	* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
	cxx_warn_unused_global_decl, cp_expr_size): Likewise.
	* cxxfilt.c (demangle_it, print_demangler_list, usage,
	standard_symbol_characters, hp_symbol_characters, main, fatal):
	Likewise.
	(strip_underscore):  Change type from 'int' to 'bool'.
	(main): Use boolean constants.

From-SVN: r60601
parent 2873836b
2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net> 2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
grok_x_components, cp_build_parm_decl, build_artificial_parm,
maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
delete_sanity, check_member_template, check_java_method,
check_classfn, finish_static_data_member_decl, grokfield,
grokbitfield, grokoptypename, grok_function_init,
cplus_decl_attributes, constructor_name, defer_fn,
build_anon_union_vars, finish_anon_union, coerce_new_type,
coerce_delete_type, comdat_linkage, maybe_make_one_only,
key_method, import_export_vtable, import_export_class,
output_vtable_inherit, import_export_decl, import_export_tinfo,
build_cleanup, get_guard, get_guard_bits, get_guard_cond,
set_guard, start_objects, finish_objects,
start_static_storage_duration_function,
finish_static_storage_duration_function, get_priority_info,
start_static_initialization_or_destruction,
finish_static_initialization_or_destruction,
do_static_initialization, do_static_destruction,
prune_vars_needing_no_initialization, write_out_vars,
reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
add_using_namespace, merge_functions, ambiguous_decl,
lookup_using_namespace, lookup_using_namespace,
qualified_lookup_using_namespace, set_decl_namespace,
decl_namespace, current_decl_namespace, push_decl_namespace,
pop_decl_namespace, push_scope, pop_scope, add_function,
arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
lookup_arg_dependent, do_namespace_alias,
validate_nonmember_using_decl, do_nonmember_using_decl,
do_toplevel_using_decl, do_local_using_decl,
do_class_using_decl, do_using_directive, check_default_args,
mark_used, handle_class_head): Use C90 prototypings. Use booleans.
* parser.c (cp_parser_class_head): Use booleanss.
* decl.c (walk_globals, walk_vtables): Likewise.
* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
walk_globals): Change return type from 'int' to 'bool'.
* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
qualifier_flags, tinfo_base_init, generic_initializer,
ptr_initializer, dfs_class_hint_mark, ptm_initializer,
dfs_class_hint_unmark, class_hint_flags, class_initializer,
typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
* repo.c (repo_compile_flags, repo_template_declared,
repo_template_defined, repo_class_defined, repo_get_id,
repo_template_used, repo_vtable_used, repo_inline_used,
repo_tinfo_used, repo_template_instantiated, extract_string,
open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
finish_repo): Likewise.
* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
cxx_print_xnode): Likewise..
* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
cxx_warn_unused_global_decl, cp_expr_size): Likewise.
* cxxfilt.c (demangle_it, print_demangler_list, usage,
standard_symbol_characters, hp_symbol_characters, main, fatal):
Likewise.
(strip_underscore): Change type from 'int' to 'bool'.
(main): Use boolean constants.
2002-12-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
Remove traditional C constructs 3/n. Remove traditional C constructs 3/n.
* cvt.c (cp_convert_to_pointer, convert_to_pointer_force, * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
build_up_reference, warn_ref_binding, convert_to_reference, build_up_reference, warn_ref_binding, convert_to_reference,
......
...@@ -30,11 +30,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -30,11 +30,11 @@ Boston, MA 02111-1307, USA. */
#include "langhooks.h" #include "langhooks.h"
#include "langhooks-def.h" #include "langhooks-def.h"
static HOST_WIDE_INT cxx_get_alias_set PARAMS ((tree)); static HOST_WIDE_INT cxx_get_alias_set (tree);
static bool ok_to_generate_alias_set_for_type PARAMS ((tree)); static bool ok_to_generate_alias_set_for_type (tree);
static bool cxx_warn_unused_global_decl PARAMS ((tree)); static bool cxx_warn_unused_global_decl (tree);
static tree cp_expr_size PARAMS ((tree)); static tree cp_expr_size (tree);
static bool cp_var_mod_type_p PARAMS ((tree)); static bool cp_var_mod_type_p (tree);
#undef LANG_HOOKS_NAME #undef LANG_HOOKS_NAME
#define LANG_HOOKS_NAME "GNU C++" #define LANG_HOOKS_NAME "GNU C++"
...@@ -204,8 +204,7 @@ const char *const tree_code_name[] = { ...@@ -204,8 +204,7 @@ const char *const tree_code_name[] = {
Return TRUE if T safe for aliasing FALSE otherwise. */ Return TRUE if T safe for aliasing FALSE otherwise. */
static bool static bool
ok_to_generate_alias_set_for_type (t) ok_to_generate_alias_set_for_type (tree t)
tree t;
{ {
if (TYPE_PTRMEMFUNC_P (t)) if (TYPE_PTRMEMFUNC_P (t))
return true; return true;
...@@ -258,8 +257,7 @@ ok_to_generate_alias_set_for_type (t) ...@@ -258,8 +257,7 @@ ok_to_generate_alias_set_for_type (t)
/* Special routine to get the alias set for C++. */ /* Special routine to get the alias set for C++. */
static HOST_WIDE_INT static HOST_WIDE_INT
cxx_get_alias_set (t) cxx_get_alias_set (tree t)
tree t;
{ {
/* It's not yet safe to use alias sets for classes in C++. */ /* It's not yet safe to use alias sets for classes in C++. */
if (!ok_to_generate_alias_set_for_type(t)) if (!ok_to_generate_alias_set_for_type(t))
...@@ -271,8 +269,7 @@ cxx_get_alias_set (t) ...@@ -271,8 +269,7 @@ cxx_get_alias_set (t)
/* Called from check_global_declarations. */ /* Called from check_global_declarations. */
static bool static bool
cxx_warn_unused_global_decl (decl) cxx_warn_unused_global_decl (tree decl)
tree decl;
{ {
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
return false; return false;
...@@ -291,8 +288,7 @@ cxx_warn_unused_global_decl (decl) ...@@ -291,8 +288,7 @@ cxx_warn_unused_global_decl (decl)
might have allocated something there. */ might have allocated something there. */
static tree static tree
cp_expr_size (exp) cp_expr_size (tree exp)
tree exp;
{ {
if (CLASS_TYPE_P (TREE_TYPE (exp))) if (CLASS_TYPE_P (TREE_TYPE (exp)))
{ {
......
...@@ -3620,10 +3620,10 @@ extern void pop_lang_context PARAMS ((void)); ...@@ -3620,10 +3620,10 @@ extern void pop_lang_context PARAMS ((void));
extern tree instantiate_type PARAMS ((tree, tree, tsubst_flags_t)); extern tree instantiate_type PARAMS ((tree, tree, tsubst_flags_t));
extern void print_class_statistics PARAMS ((void)); extern void print_class_statistics PARAMS ((void));
extern void cxx_print_statistics PARAMS ((void)); extern void cxx_print_statistics PARAMS ((void));
extern void cxx_print_xnode PARAMS ((FILE *, tree, int)); extern void cxx_print_xnode (FILE *, tree, int);
extern void cxx_print_decl PARAMS ((FILE *, tree, int)); extern void cxx_print_decl (FILE *, tree, int);
extern void cxx_print_type PARAMS ((FILE *, tree, int)); extern void cxx_print_type (FILE *, tree, int);
extern void cxx_print_identifier PARAMS ((FILE *, tree, int)); extern void cxx_print_identifier (FILE *, tree, int);
extern void cxx_print_error_function PARAMS ((struct diagnostic_context *, extern void cxx_print_error_function PARAMS ((struct diagnostic_context *,
const char *)); const char *));
extern void build_self_reference PARAMS ((void)); extern void build_self_reference PARAMS ((void));
...@@ -3738,8 +3738,8 @@ extern void end_only_namespace_names PARAMS ((void)); ...@@ -3738,8 +3738,8 @@ extern void end_only_namespace_names PARAMS ((void));
extern tree namespace_ancestor PARAMS ((tree, tree)); extern tree namespace_ancestor PARAMS ((tree, tree));
extern tree unqualified_namespace_lookup PARAMS ((tree, int, tree *)); extern tree unqualified_namespace_lookup PARAMS ((tree, int, tree *));
extern tree check_for_out_of_scope_variable (tree); extern tree check_for_out_of_scope_variable (tree);
extern int lookup_using_namespace PARAMS ((tree, tree, tree, tree, int, tree *)); extern bool lookup_using_namespace (tree, tree, tree, tree, int, tree *);
extern int qualified_lookup_using_namespace PARAMS ((tree, tree, tree, int)); extern bool qualified_lookup_using_namespace (tree, tree, tree, int);
extern tree build_library_fn PARAMS ((tree, tree)); extern tree build_library_fn PARAMS ((tree, tree));
extern tree build_library_fn_ptr PARAMS ((const char *, tree)); extern tree build_library_fn_ptr PARAMS ((const char *, tree));
extern tree build_cp_library_fn_ptr PARAMS ((const char *, tree)); extern tree build_cp_library_fn_ptr PARAMS ((const char *, tree));
...@@ -3795,14 +3795,10 @@ extern void storetags PARAMS ((tree)); ...@@ -3795,14 +3795,10 @@ extern void storetags PARAMS ((tree));
extern int vtable_decl_p PARAMS ((tree, void *)); extern int vtable_decl_p PARAMS ((tree, void *));
extern int vtype_decl_p PARAMS ((tree, void *)); extern int vtype_decl_p PARAMS ((tree, void *));
extern int sigtable_decl_p PARAMS ((tree, void *)); extern int sigtable_decl_p PARAMS ((tree, void *));
typedef int (*walk_globals_pred) PARAMS ((tree, void *)); typedef bool (*walk_globals_pred) (tree, void *);
typedef int (*walk_globals_fn) PARAMS ((tree *, void *)); typedef bool (*walk_globals_fn) (tree *, void *);
extern int walk_globals PARAMS ((walk_globals_pred, extern bool walk_globals (walk_globals_pred, walk_globals_fn, void *);
walk_globals_fn, extern bool walk_vtables (walk_globals_pred, walk_globals_fn, void *);
void *));
extern int walk_vtables PARAMS ((walk_globals_pred,
walk_globals_fn,
void *));
typedef int (*walk_namespaces_fn) PARAMS ((tree, void *)); typedef int (*walk_namespaces_fn) PARAMS ((tree, void *));
extern int walk_namespaces PARAMS ((walk_namespaces_fn, extern int walk_namespaces PARAMS ((walk_namespaces_fn,
void *)); void *));
...@@ -3820,34 +3816,34 @@ extern tree cp_fname_init PARAMS ((const char *)); ...@@ -3820,34 +3816,34 @@ extern tree cp_fname_init PARAMS ((const char *));
extern bool have_extern_spec; extern bool have_extern_spec;
/* in decl2.c */ /* in decl2.c */
extern int check_java_method PARAMS ((tree)); extern bool check_java_method (tree);
extern int grok_method_quals PARAMS ((tree, tree, tree)); extern int grok_method_quals (tree, tree, tree);
extern void warn_if_unknown_interface PARAMS ((tree)); extern void warn_if_unknown_interface (tree);
extern void grok_x_components PARAMS ((tree)); extern void grok_x_components (tree);
extern void maybe_retrofit_in_chrg PARAMS ((tree)); extern void maybe_retrofit_in_chrg (tree);
extern void maybe_make_one_only PARAMS ((tree)); extern void maybe_make_one_only (tree);
extern void grokclassfn PARAMS ((tree, tree, enum overload_flags, tree)); extern void grokclassfn (tree, tree, enum overload_flags, tree);
extern tree grok_array_decl PARAMS ((tree, tree)); extern tree grok_array_decl (tree, tree);
extern tree delete_sanity PARAMS ((tree, tree, int, int)); extern tree delete_sanity (tree, tree, int, int);
extern tree check_classfn PARAMS ((tree, tree)); extern tree check_classfn (tree, tree);
extern void check_member_template PARAMS ((tree)); extern void check_member_template (tree);
extern tree grokfield PARAMS ((tree, tree, tree, tree, tree)); extern tree grokfield (tree, tree, tree, tree, tree);
extern tree grokbitfield PARAMS ((tree, tree, tree)); extern tree grokbitfield (tree, tree, tree);
extern tree groktypefield PARAMS ((tree, tree)); extern tree groktypefield PARAMS ((tree, tree));
extern tree grokoptypename PARAMS ((tree, tree, tree)); extern tree grokoptypename (tree, tree, tree);
extern void cplus_decl_attributes PARAMS ((tree *, tree, int)); extern void cplus_decl_attributes (tree *, tree, int);
extern tree constructor_name_full PARAMS ((tree)); extern tree constructor_name_full PARAMS ((tree));
extern tree constructor_name PARAMS ((tree)); extern tree constructor_name (tree);
extern bool constructor_name_p (tree, tree); extern bool constructor_name_p (tree, tree);
extern void defer_fn PARAMS ((tree)); extern void defer_fn (tree);
extern void finish_anon_union PARAMS ((tree)); extern void finish_anon_union (tree);
extern tree finish_table PARAMS ((tree, tree, tree, int)); extern tree finish_table (tree, tree, tree, int);
extern tree coerce_new_type PARAMS ((tree)); extern tree coerce_new_type (tree);
extern tree coerce_delete_type PARAMS ((tree)); extern tree coerce_delete_type (tree);
extern void comdat_linkage PARAMS ((tree)); extern void comdat_linkage (tree);
extern void import_export_vtable PARAMS ((tree, tree, int)); extern void import_export_vtable (tree, tree, int);
extern void import_export_decl PARAMS ((tree)); extern void import_export_decl (tree);
extern void import_export_tinfo PARAMS ((tree, tree, int)); extern void import_export_tinfo (tree, tree, bool);
extern tree build_cleanup PARAMS ((tree)); extern tree build_cleanup PARAMS ((tree));
extern void finish_file PARAMS ((void)); extern void finish_file PARAMS ((void));
extern tree reparse_absdcl_as_expr PARAMS ((tree, tree)); extern tree reparse_absdcl_as_expr PARAMS ((tree, tree));
...@@ -3855,29 +3851,29 @@ extern tree reparse_absdcl_as_casts PARAMS ((tree, tree)); ...@@ -3855,29 +3851,29 @@ extern tree reparse_absdcl_as_casts PARAMS ((tree, tree));
extern tree build_expr_from_tree PARAMS ((tree)); extern tree build_expr_from_tree PARAMS ((tree));
extern tree build_offset_ref_call_from_tree (tree, tree); extern tree build_offset_ref_call_from_tree (tree, tree);
extern tree build_call_from_tree (tree, tree, bool); extern tree build_call_from_tree (tree, tree, bool);
extern tree reparse_decl_as_expr PARAMS ((tree, tree)); extern tree reparse_decl_as_expr (tree, tree);
extern tree finish_decl_parsing PARAMS ((tree)); extern tree finish_decl_parsing (tree);
extern void set_decl_namespace PARAMS ((tree, tree, int)); extern void set_decl_namespace (tree, tree, bool);
extern tree current_decl_namespace PARAMS ((void)); extern tree current_decl_namespace PARAMS ((void));
extern void push_decl_namespace PARAMS ((tree)); extern void push_decl_namespace PARAMS ((tree));
extern void pop_decl_namespace PARAMS ((void)); extern void pop_decl_namespace PARAMS ((void));
extern void push_scope PARAMS ((tree)); extern void push_scope PARAMS ((tree));
extern void pop_scope PARAMS ((tree)); extern void pop_scope PARAMS ((tree));
extern void do_namespace_alias PARAMS ((tree, tree)); extern void do_namespace_alias (tree, tree);
extern void do_toplevel_using_decl PARAMS ((tree)); extern void do_toplevel_using_decl (tree);
extern void do_local_using_decl PARAMS ((tree)); extern void do_local_using_decl (tree);
extern tree do_class_using_decl PARAMS ((tree)); extern tree do_class_using_decl (tree);
extern void do_using_directive PARAMS ((tree)); extern void do_using_directive (tree);
extern void check_default_args PARAMS ((tree)); extern void check_default_args (tree);
extern void mark_used PARAMS ((tree)); extern void mark_used (tree);
extern tree handle_class_head (enum tag_types, tree, tree, tree, int, int *); extern tree handle_class_head (enum tag_types, tree, tree, tree, bool, bool *);
extern tree lookup_arg_dependent PARAMS ((tree, tree, tree)); extern tree lookup_arg_dependent (tree, tree, tree);
extern void finish_static_data_member_decl PARAMS ((tree, tree, tree, int)); extern void finish_static_data_member_decl (tree, tree, tree, int);
extern tree cp_build_parm_decl PARAMS ((tree, tree)); extern tree cp_build_parm_decl (tree, tree);
extern tree build_artificial_parm PARAMS ((tree, tree)); extern tree build_artificial_parm (tree, tree);
extern tree get_guard PARAMS ((tree)); extern tree get_guard (tree);
extern tree get_guard_cond PARAMS ((tree)); extern tree get_guard_cond (tree);
extern tree set_guard PARAMS ((tree)); extern tree set_guard (tree);
extern void cp_error_at PARAMS ((const char *msgid, ...)); extern void cp_error_at PARAMS ((const char *msgid, ...));
extern void cp_warning_at PARAMS ((const char *msgid, ...)); extern void cp_warning_at PARAMS ((const char *msgid, ...));
...@@ -4065,20 +4061,20 @@ extern tree maybe_get_template_decl_from_type_decl (tree); ...@@ -4065,20 +4061,20 @@ extern tree maybe_get_template_decl_from_type_decl (tree);
extern int processing_template_parmlist; extern int processing_template_parmlist;
/* in repo.c */ /* in repo.c */
extern void repo_template_used PARAMS ((tree)); extern void repo_template_used (tree);
extern void repo_template_instantiated PARAMS ((tree, int)); extern void repo_template_instantiated (tree, bool);
extern void init_repo PARAMS ((const char *)); extern void init_repo (const char *);
extern void finish_repo PARAMS ((void)); extern void finish_repo (void);
/* in rtti.c */ /* in rtti.c */
extern void init_rtti_processing PARAMS((void)); extern void init_rtti_processing (void);
extern tree build_typeid PARAMS((tree)); extern tree build_typeid (tree);
extern tree get_tinfo_decl PARAMS((tree)); extern tree get_tinfo_decl (tree);
extern tree get_typeid PARAMS((tree)); extern tree get_typeid (tree);
extern tree build_dynamic_cast PARAMS((tree, tree)); extern tree build_dynamic_cast (tree, tree);
extern void emit_support_tinfos PARAMS((void)); extern void emit_support_tinfos (void);
extern int unemitted_tinfo_decl_p PARAMS((tree, void *)); extern bool unemitted_tinfo_decl_p (tree, void *);
extern int emit_tinfo_decl PARAMS((tree *, void *)); extern bool emit_tinfo_decl (tree *, void *);
/* in search.c */ /* in search.c */
extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *)); extern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
......
...@@ -33,14 +33,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -33,14 +33,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static const char *program_name; static const char *program_name;
static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE; static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE;
static void demangle_it PARAMS ((char *)); static void demangle_it (char *);
static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; static void usage (FILE *, int) ATTRIBUTE_NORETURN;
static void fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN; static void fatal (const char *) ATTRIBUTE_NORETURN;
static void print_demangler_list PARAMS ((FILE *)); static void print_demangler_list (FILE *);
static void static void
demangle_it (mangled_name) demangle_it (char *mangled_name)
char *mangled_name;
{ {
char *result; char *result;
...@@ -58,8 +57,7 @@ demangle_it (mangled_name) ...@@ -58,8 +57,7 @@ demangle_it (mangled_name)
} }
static void static void
print_demangler_list (stream) print_demangler_list (FILE *stream)
FILE *stream;
{ {
const struct demangler_engine *demangler; const struct demangler_engine *demangler;
...@@ -74,9 +72,7 @@ print_demangler_list (stream) ...@@ -74,9 +72,7 @@ print_demangler_list (stream)
} }
static void static void
usage (stream, status) usage (FILE *stream, int status)
FILE *stream;
int status;
{ {
fprintf (stream, "\ fprintf (stream, "\
Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n", Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
...@@ -100,7 +96,7 @@ Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n", ...@@ -100,7 +96,7 @@ Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores] \n",
#define MBUF_SIZE 32767 #define MBUF_SIZE 32767
char mbuffer[MBUF_SIZE]; char mbuffer[MBUF_SIZE];
int strip_underscore = 0; bool strip_underscore = false;
static const struct option long_options[] = { static const struct option long_options[] = {
{"strip-underscores", no_argument, 0, '_'}, {"strip-underscores", no_argument, 0, '_'},
...@@ -111,18 +107,16 @@ static const struct option long_options[] = { ...@@ -111,18 +107,16 @@ static const struct option long_options[] = {
{0, no_argument, 0, 0} {0, no_argument, 0, 0}
}; };
static const char * static const char *standard_symbol_characters (void);
standard_symbol_characters PARAMS ((void));
static const char * static const char *hp_symbol_characters (void);
hp_symbol_characters PARAMS ((void));
/* Return the string of non-alnum characters that may occur /* Return the string of non-alnum characters that may occur
as a valid symbol component, in the standard assembler symbol as a valid symbol component, in the standard assembler symbol
syntax. */ syntax. */
static const char * static const char *
standard_symbol_characters () standard_symbol_characters (void)
{ {
return "_$."; return "_$.";
} }
...@@ -159,17 +153,15 @@ standard_symbol_characters () ...@@ -159,17 +153,15 @@ standard_symbol_characters ()
So have fun. */ So have fun. */
static const char * static const char *
hp_symbol_characters () hp_symbol_characters (void)
{ {
return "_$.<>#,*&[]:(){}"; return "_$.<>#,*&[]:(){}";
} }
extern int main PARAMS ((int, char **)); extern int main (int, char **);
int int
main (argc, argv) main (int argc, char **argv)
int argc;
char **argv;
{ {
char *result; char *result;
int c; int c;
...@@ -190,14 +182,14 @@ main (argc, argv) ...@@ -190,14 +182,14 @@ main (argc, argv)
case 'h': case 'h':
usage (stdout, 0); usage (stdout, 0);
case 'n': case 'n':
strip_underscore = 0; strip_underscore = false;
break; break;
case 'v': case 'v':
printf ("GNU %s (C++ demangler), version %s\n", printf ("GNU %s (C++ demangler), version %s\n",
program_name, version_string); program_name, version_string);
return (0); return (0);
case '_': case '_':
strip_underscore = 1; strip_underscore = true;
break; break;
case 's': case 's':
{ {
...@@ -296,8 +288,7 @@ main (argc, argv) ...@@ -296,8 +288,7 @@ main (argc, argv)
} }
static void static void
fatal (str) fatal (const char *str)
const char *str;
{ {
fprintf (stderr, "%s: %s\n", program_name, str); fprintf (stderr, "%s: %s\n", program_name, str);
exit (1); exit (1);
......
...@@ -1805,11 +1805,8 @@ walk_vtables_r (namespace, data) ...@@ -1805,11 +1805,8 @@ walk_vtables_r (namespace, data)
/* Walk the vtable declarations. Whenever one is found for which P /* Walk the vtable declarations. Whenever one is found for which P
returns nonzero, call F with its address. If any call to F returns nonzero, call F with its address. If any call to F
returns a nonzero value, return a nonzero value. */ returns a nonzero value, return a nonzero value. */
int bool
walk_vtables (p, f, data) walk_vtables (walk_globals_pred p, walk_globals_fn f, void *data)
walk_globals_pred p;
walk_globals_fn f;
void *data;
{ {
struct walk_globals_data wgd; struct walk_globals_data wgd;
wgd.p = p; wgd.p = p;
...@@ -1885,14 +1882,11 @@ walk_globals_r (namespace, data) ...@@ -1885,14 +1882,11 @@ walk_globals_r (namespace, data)
} }
/* Walk the global declarations. Whenever one is found for which P /* Walk the global declarations. Whenever one is found for which P
returns nonzero, call F with its address. If any call to F returns true, call F with its address. If any call to F
returns a nonzero value, return a nonzero value. */ returns true, return true. */
int bool
walk_globals (p, f, data) walk_globals (walk_globals_pred p, walk_globals_fn f, void *data)
walk_globals_pred p;
walk_globals_fn f;
void *data;
{ {
struct walk_globals_data wgd; struct walk_globals_data wgd;
wgd.p = p; wgd.p = p;
......
...@@ -60,37 +60,36 @@ typedef struct priority_info_s { ...@@ -60,37 +60,36 @@ typedef struct priority_info_s {
int destructions_p; int destructions_p;
} *priority_info; } *priority_info;
static void mark_vtable_entries PARAMS ((tree)); static void mark_vtable_entries (tree);
static void grok_function_init PARAMS ((tree, tree)); static void grok_function_init (tree, tree);
static int maybe_emit_vtables (tree); static bool maybe_emit_vtables (tree);
static int is_namespace_ancestor PARAMS ((tree, tree)); static bool is_namespace_ancestor (tree, tree);
static void add_using_namespace PARAMS ((tree, tree, int)); static void add_using_namespace (tree, tree, bool);
static tree ambiguous_decl PARAMS ((tree, tree, tree,int)); static tree ambiguous_decl (tree, tree, tree,int);
static tree build_anon_union_vars PARAMS ((tree)); static tree build_anon_union_vars (tree);
static int acceptable_java_type PARAMS ((tree)); static bool acceptable_java_type (tree);
static void output_vtable_inherit PARAMS ((tree)); static void output_vtable_inherit (tree);
static tree start_objects PARAMS ((int, int)); static tree start_objects (int, int);
static void finish_objects PARAMS ((int, int, tree)); static void finish_objects (int, int, tree);
static tree merge_functions PARAMS ((tree, tree)); static tree merge_functions (tree, tree);
static tree decl_namespace PARAMS ((tree)); static tree decl_namespace (tree);
static tree validate_nonmember_using_decl PARAMS ((tree, tree *, tree *)); static tree validate_nonmember_using_decl (tree, tree *, tree *);
static void do_nonmember_using_decl PARAMS ((tree, tree, tree, tree, static void do_nonmember_using_decl (tree, tree, tree, tree, tree *, tree *);
tree *, tree *)); static tree start_static_storage_duration_function (void);
static tree start_static_storage_duration_function PARAMS ((void)); static void finish_static_storage_duration_function (tree);
static void finish_static_storage_duration_function PARAMS ((tree)); static priority_info get_priority_info (int);
static priority_info get_priority_info PARAMS ((int)); static void do_static_initialization (tree, tree);
static void do_static_initialization PARAMS ((tree, tree)); static void do_static_destruction (tree);
static void do_static_destruction PARAMS ((tree)); static tree start_static_initialization_or_destruction (tree, int);
static tree start_static_initialization_or_destruction PARAMS ((tree, int)); static void finish_static_initialization_or_destruction (tree);
static void finish_static_initialization_or_destruction PARAMS ((tree)); static void generate_ctor_or_dtor_function (bool, int);
static void generate_ctor_or_dtor_function PARAMS ((int, int)); static int generate_ctor_and_dtor_functions_for_priority (splay_tree_node,
static int generate_ctor_and_dtor_functions_for_priority void *);
PARAMS ((splay_tree_node, void *)); static tree prune_vars_needing_no_initialization (tree);
static tree prune_vars_needing_no_initialization PARAMS ((tree)); static void write_out_vars (tree);
static void write_out_vars PARAMS ((tree)); static void import_export_class (tree);
static void import_export_class PARAMS ((tree)); static tree key_method (tree);
static tree key_method PARAMS ((tree)); static tree get_guard_bits (tree);
static tree get_guard_bits PARAMS ((tree));
/* A list of static class variables. This is needed, because a /* A list of static class variables. This is needed, because a
static class variable can be declared inside the class without static class variable can be declared inside the class without
...@@ -129,8 +128,7 @@ tree global_namespace; ...@@ -129,8 +128,7 @@ tree global_namespace;
TYPE_UNQUALIFIED will be an extension. */ TYPE_UNQUALIFIED will be an extension. */
int int
grok_method_quals (ctype, function, quals) grok_method_quals (tree ctype, tree function, tree quals)
tree ctype, function, quals;
{ {
tree fntype = TREE_TYPE (function); tree fntype = TREE_TYPE (function);
tree raises = TYPE_RAISES_EXCEPTIONS (fntype); tree raises = TYPE_RAISES_EXCEPTIONS (fntype);
...@@ -174,8 +172,7 @@ grok_method_quals (ctype, function, quals) ...@@ -174,8 +172,7 @@ grok_method_quals (ctype, function, quals)
inform the user. */ inform the user. */
void void
warn_if_unknown_interface (decl) warn_if_unknown_interface (tree decl)
tree decl;
{ {
static int already_warned = 0; static int already_warned = 0;
if (already_warned++) if (already_warned++)
...@@ -205,8 +202,7 @@ warn_if_unknown_interface (decl) ...@@ -205,8 +202,7 @@ warn_if_unknown_interface (decl)
/* A subroutine of the parser, to handle a component list. */ /* A subroutine of the parser, to handle a component list. */
void void
grok_x_components (specs) grok_x_components (tree specs)
tree specs;
{ {
tree t; tree t;
...@@ -228,9 +224,7 @@ grok_x_components (specs) ...@@ -228,9 +224,7 @@ grok_x_components (specs)
appropriately. */ appropriately. */
tree tree
cp_build_parm_decl (name, type) cp_build_parm_decl (tree name, tree type)
tree name;
tree type;
{ {
tree parm = build_decl (PARM_DECL, name, type); tree parm = build_decl (PARM_DECL, name, type);
DECL_ARG_TYPE (parm) = type_passed_as (type); DECL_ARG_TYPE (parm) = type_passed_as (type);
...@@ -241,9 +235,7 @@ cp_build_parm_decl (name, type) ...@@ -241,9 +235,7 @@ cp_build_parm_decl (name, type)
indicated NAME. */ indicated NAME. */
tree tree
build_artificial_parm (name, type) build_artificial_parm (tree name, tree type)
tree name;
tree type;
{ {
tree parm = cp_build_parm_decl (name, type); tree parm = cp_build_parm_decl (name, type);
DECL_ARTIFICIAL (parm) = 1; DECL_ARTIFICIAL (parm) = 1;
...@@ -267,8 +259,7 @@ build_artificial_parm (name, type) ...@@ -267,8 +259,7 @@ build_artificial_parm (name, type)
VTT parm (if any), then the user-written parms. */ VTT parm (if any), then the user-written parms. */
void void
maybe_retrofit_in_chrg (fn) maybe_retrofit_in_chrg (tree fn)
tree fn;
{ {
tree basetype, arg_types, parms, parm, fntype; tree basetype, arg_types, parms, parm, fntype;
...@@ -351,10 +342,7 @@ maybe_retrofit_in_chrg (fn) ...@@ -351,10 +342,7 @@ maybe_retrofit_in_chrg (fn)
QUALS are the qualifiers for the this pointer. */ QUALS are the qualifiers for the this pointer. */
void void
grokclassfn (ctype, function, flags, quals) grokclassfn (tree ctype, tree function, enum overload_flags flags, tree quals)
tree ctype, function;
enum overload_flags flags;
tree quals;
{ {
tree fn_name = DECL_NAME (function); tree fn_name = DECL_NAME (function);
int this_quals = TYPE_UNQUALIFIED; int this_quals = TYPE_UNQUALIFIED;
...@@ -412,8 +400,7 @@ grokclassfn (ctype, function, flags, quals) ...@@ -412,8 +400,7 @@ grokclassfn (ctype, function, flags, quals)
along the way. */ along the way. */
tree tree
grok_array_decl (array_expr, index_exp) grok_array_decl (tree array_expr, tree index_exp)
tree array_expr, index_exp;
{ {
tree type = TREE_TYPE (array_expr); tree type = TREE_TYPE (array_expr);
tree p1, p2, i1, i2; tree p1, p2, i1, i2;
...@@ -487,9 +474,7 @@ grok_array_decl (array_expr, index_exp) ...@@ -487,9 +474,7 @@ grok_array_decl (array_expr, index_exp)
Implements ARM $5.3.4. This is called from the parser. */ Implements ARM $5.3.4. This is called from the parser. */
tree tree
delete_sanity (exp, size, doing_vec, use_global_delete) delete_sanity (tree exp, tree size, int doing_vec, int use_global_delete)
tree exp, size;
int doing_vec, use_global_delete;
{ {
tree t, type; tree t, type;
/* For a regular vector delete (aka, no size argument) we will pass /* For a regular vector delete (aka, no size argument) we will pass
...@@ -566,8 +551,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete) ...@@ -566,8 +551,7 @@ delete_sanity (exp, size, doing_vec, use_global_delete)
sort of thing that should be a member template. */ sort of thing that should be a member template. */
void void
check_member_template (tmpl) check_member_template (tree tmpl)
tree tmpl;
{ {
tree decl; tree decl;
...@@ -606,9 +590,8 @@ check_member_template (tmpl) ...@@ -606,9 +590,8 @@ check_member_template (tmpl)
/* Return true iff TYPE is a valid Java parameter or return type. */ /* Return true iff TYPE is a valid Java parameter or return type. */
static int static bool
acceptable_java_type (type) acceptable_java_type (tree type)
tree type;
{ {
if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type)) if (TREE_CODE (type) == VOID_TYPE || TYPE_FOR_JAVA (type))
return 1; return 1;
...@@ -619,9 +602,9 @@ acceptable_java_type (type) ...@@ -619,9 +602,9 @@ acceptable_java_type (type)
{ {
tree args; int i; tree args; int i;
if (! TYPE_FOR_JAVA (type)) if (! TYPE_FOR_JAVA (type))
return 0; return false;
if (! CLASSTYPE_TEMPLATE_INFO (type)) if (! CLASSTYPE_TEMPLATE_INFO (type))
return 1; return true;
args = CLASSTYPE_TI_ARGS (type); args = CLASSTYPE_TI_ARGS (type);
i = TREE_VEC_LENGTH (args); i = TREE_VEC_LENGTH (args);
while (--i >= 0) while (--i >= 0)
...@@ -630,42 +613,41 @@ acceptable_java_type (type) ...@@ -630,42 +613,41 @@ acceptable_java_type (type)
if (TREE_CODE (type) == POINTER_TYPE) if (TREE_CODE (type) == POINTER_TYPE)
type = TREE_TYPE (type); type = TREE_TYPE (type);
if (! TYPE_FOR_JAVA (type)) if (! TYPE_FOR_JAVA (type))
return 0; return false;
} }
return 1; return true;
} }
} }
return 0; return false;
} }
/* For a METHOD in a Java class CTYPE, return 1 if /* For a METHOD in a Java class CTYPE, return true if
the parameter and return types are valid Java types. the parameter and return types are valid Java types.
Otherwise, print appropriate error messages, and return 0. */ Otherwise, print appropriate error messages, and return false. */
int bool
check_java_method (method) check_java_method (tree method)
tree method;
{ {
int jerr = 0; bool jerr = false;
tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method)); tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
tree ret_type = TREE_TYPE (TREE_TYPE (method)); tree ret_type = TREE_TYPE (TREE_TYPE (method));
if (! acceptable_java_type (ret_type)) if (!acceptable_java_type (ret_type))
{ {
error ("Java method '%D' has non-Java return type `%T'", error ("Java method '%D' has non-Java return type `%T'",
method, ret_type); method, ret_type);
jerr++; jerr = true;
} }
for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types)) for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
{ {
tree type = TREE_VALUE (arg_types); tree type = TREE_VALUE (arg_types);
if (! acceptable_java_type (type)) if (!acceptable_java_type (type))
{ {
error ("Java method '%D' has non-Java parameter type `%T'", error ("Java method '%D' has non-Java parameter type `%T'",
method, type); method, type);
jerr++; jerr = true;
} }
} }
return jerr ? 0 : 1; return !jerr;
} }
/* Sanity check: report error if this function FUNCTION is not /* Sanity check: report error if this function FUNCTION is not
...@@ -673,8 +655,7 @@ check_java_method (method) ...@@ -673,8 +655,7 @@ check_java_method (method)
CNAME is the same here as it is for grokclassfn above. */ CNAME is the same here as it is for grokclassfn above. */
tree tree
check_classfn (ctype, function) check_classfn (tree ctype, tree function)
tree ctype, function;
{ {
int ix; int ix;
...@@ -793,11 +774,8 @@ check_classfn (ctype, function) ...@@ -793,11 +774,8 @@ check_classfn (ctype, function)
FLAGS is as for cp_finish_decl. */ FLAGS is as for cp_finish_decl. */
void void
finish_static_data_member_decl (decl, init, asmspec_tree, flags) finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
tree decl; int flags)
tree init;
tree asmspec_tree;
int flags;
{ {
my_friendly_assert (TREE_PUBLIC (decl), 0); my_friendly_assert (TREE_PUBLIC (decl), 0);
...@@ -863,8 +841,8 @@ finish_static_data_member_decl (decl, init, asmspec_tree, flags) ...@@ -863,8 +841,8 @@ finish_static_data_member_decl (decl, init, asmspec_tree, flags)
CHANGES TO CODE IN `start_method'. */ CHANGES TO CODE IN `start_method'. */
tree tree
grokfield (declarator, declspecs, init, asmspec_tree, attrlist) grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
tree declarator, declspecs, init, asmspec_tree, attrlist; tree attrlist)
{ {
tree value; tree value;
const char *asmspec = 0; const char *asmspec = 0;
...@@ -1071,8 +1049,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist) ...@@ -1071,8 +1049,7 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */ WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */
tree tree
grokbitfield (declarator, declspecs, width) grokbitfield (tree declarator, tree declspecs, tree width)
tree declarator, declspecs, width;
{ {
register tree value = grokdeclarator (declarator, declspecs, BITFIELD, register tree value = grokdeclarator (declarator, declspecs, BITFIELD,
0, NULL); 0, NULL);
...@@ -1129,9 +1106,7 @@ grokbitfield (declarator, declspecs, width) ...@@ -1129,9 +1106,7 @@ grokbitfield (declarator, declspecs, width)
scope of the conversion operator, if explicit. */ scope of the conversion operator, if explicit. */
tree tree
grokoptypename (declspecs, declarator, scope) grokoptypename (tree declspecs, tree declarator, tree scope)
tree declspecs, declarator;
tree scope;
{ {
tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL); tree t = grokdeclarator (declarator, declspecs, TYPENAME, 0, NULL);
...@@ -1187,9 +1162,7 @@ grokoptypename (declspecs, declarator, scope) ...@@ -1187,9 +1162,7 @@ grokoptypename (declspecs, declarator, scope)
*/ */
static void static void
grok_function_init (decl, init) grok_function_init (tree decl, tree init)
tree decl;
tree init;
{ {
/* An initializer for a function tells how this function should /* An initializer for a function tells how this function should
be inherited. */ be inherited. */
...@@ -1204,9 +1177,7 @@ grok_function_init (decl, init) ...@@ -1204,9 +1177,7 @@ grok_function_init (decl, init)
} }
void void
cplus_decl_attributes (decl, attributes, flags) cplus_decl_attributes (tree *decl, tree attributes, int flags)
tree *decl, attributes;
int flags;
{ {
if (*decl == NULL_TREE || *decl == void_type_node) if (*decl == NULL_TREE || *decl == void_type_node)
return; return;
...@@ -1240,8 +1211,7 @@ constructor_name_full (tree type) ...@@ -1240,8 +1211,7 @@ constructor_name_full (tree type)
unspecialized name. */ unspecialized name. */
tree tree
constructor_name (type) constructor_name (tree type)
tree type;
{ {
tree name; tree name;
name = constructor_name_full (type); name = constructor_name_full (type);
...@@ -1263,8 +1233,7 @@ constructor_name_p (tree name, tree type) ...@@ -1263,8 +1233,7 @@ constructor_name_p (tree name, tree type)
/* Defer the compilation of the FN until the end of compilation. */ /* Defer the compilation of the FN until the end of compilation. */
void void
defer_fn (fn) defer_fn (tree fn)
tree fn;
{ {
if (DECL_DEFERRED_FN (fn)) if (DECL_DEFERRED_FN (fn))
return; return;
...@@ -1280,8 +1249,7 @@ defer_fn (fn) ...@@ -1280,8 +1249,7 @@ defer_fn (fn)
the mangled name. */ the mangled name. */
static tree static tree
build_anon_union_vars (object) build_anon_union_vars (tree object)
tree object;
{ {
tree type = TREE_TYPE (object); tree type = TREE_TYPE (object);
tree main_decl = NULL_TREE; tree main_decl = NULL_TREE;
...@@ -1341,12 +1309,11 @@ build_anon_union_vars (object) ...@@ -1341,12 +1309,11 @@ build_anon_union_vars (object)
is nonzero if this union is not declared static. */ is nonzero if this union is not declared static. */
void void
finish_anon_union (anon_union_decl) finish_anon_union (tree anon_union_decl)
tree anon_union_decl;
{ {
tree type = TREE_TYPE (anon_union_decl); tree type = TREE_TYPE (anon_union_decl);
tree main_decl; tree main_decl;
int public_p = TREE_PUBLIC (anon_union_decl); bool public_p = TREE_PUBLIC (anon_union_decl);
/* The VAR_DECL's context is the same as the TYPE's context. */ /* The VAR_DECL's context is the same as the TYPE's context. */
DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type)); DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
...@@ -1390,8 +1357,7 @@ finish_anon_union (anon_union_decl) ...@@ -1390,8 +1357,7 @@ finish_anon_union (anon_union_decl)
what compiler will be expecting. */ what compiler will be expecting. */
tree tree
coerce_new_type (type) coerce_new_type (tree type)
tree type;
{ {
int e = 0; int e = 0;
tree args = TYPE_ARG_TYPES (type); tree args = TYPE_ARG_TYPES (type);
...@@ -1425,8 +1391,7 @@ coerce_new_type (type) ...@@ -1425,8 +1391,7 @@ coerce_new_type (type)
} }
tree tree
coerce_delete_type (type) coerce_delete_type (tree type)
tree type;
{ {
int e = 0; int e = 0;
tree args = TYPE_ARG_TYPES (type); tree args = TYPE_ARG_TYPES (type);
...@@ -1461,8 +1426,7 @@ coerce_delete_type (type) ...@@ -1461,8 +1426,7 @@ coerce_delete_type (type)
} }
static void static void
mark_vtable_entries (decl) mark_vtable_entries (tree decl)
tree decl;
{ {
tree entries = CONSTRUCTOR_ELTS (DECL_INITIAL (decl)); tree entries = CONSTRUCTOR_ELTS (DECL_INITIAL (decl));
...@@ -1493,8 +1457,7 @@ mark_vtable_entries (decl) ...@@ -1493,8 +1457,7 @@ mark_vtable_entries (decl)
linkage available. */ linkage available. */
void void
comdat_linkage (decl) comdat_linkage (tree decl)
tree decl;
{ {
if (flag_weak) if (flag_weak)
make_decl_one_only (decl); make_decl_one_only (decl);
...@@ -1547,8 +1510,7 @@ comdat_linkage (decl) ...@@ -1547,8 +1510,7 @@ comdat_linkage (decl)
instantiations; otherwise we get duplicate symbol errors. */ instantiations; otherwise we get duplicate symbol errors. */
void void
maybe_make_one_only (decl) maybe_make_one_only (tree decl)
tree decl;
{ {
/* We used to say that this was not necessary on targets that support weak /* We used to say that this was not necessary on targets that support weak
symbols, because the implicit instantiations will defer to the explicit symbols, because the implicit instantiations will defer to the explicit
...@@ -1578,8 +1540,7 @@ maybe_make_one_only (decl) ...@@ -1578,8 +1540,7 @@ maybe_make_one_only (decl)
emitted, or NULL_TREE if that heuristic is not applicable to TYPE. */ emitted, or NULL_TREE if that heuristic is not applicable to TYPE. */
static tree static tree
key_method (type) key_method (tree type)
tree type;
{ {
tree method; tree method;
...@@ -1605,9 +1566,7 @@ key_method (type) ...@@ -1605,9 +1566,7 @@ key_method (type)
it's public in this file or in another one. */ it's public in this file or in another one. */
void void
import_export_vtable (decl, type, final) import_export_vtable (tree decl, tree type, int final)
tree decl, type;
int final;
{ {
if (DECL_INTERFACE_KNOWN (decl)) if (DECL_INTERFACE_KNOWN (decl))
return; return;
...@@ -1649,8 +1608,7 @@ import_export_vtable (decl, type, final) ...@@ -1649,8 +1608,7 @@ import_export_vtable (decl, type, final)
using various heuristics. */ using various heuristics. */
static void static void
import_export_class (ctype) import_export_class (tree ctype)
tree ctype;
{ {
/* -1 for imported, 1 for exported. */ /* -1 for imported, 1 for exported. */
int import_export = 0; int import_export = 0;
...@@ -1711,8 +1669,7 @@ import_export_class (ctype) ...@@ -1711,8 +1669,7 @@ import_export_class (ctype)
a vtable and the vtable of the parent class. */ a vtable and the vtable of the parent class. */
static void static void
output_vtable_inherit (vars) output_vtable_inherit (tree vars)
tree vars;
{ {
tree parent; tree parent;
rtx child_rtx, parent_rtx; rtx child_rtx, parent_rtx;
...@@ -1735,9 +1692,9 @@ output_vtable_inherit (vars) ...@@ -1735,9 +1692,9 @@ output_vtable_inherit (vars)
} }
/* If necessary, write out the vtables for the dynamic class CTYPE. /* If necessary, write out the vtables for the dynamic class CTYPE.
Returns nonzero if any vtables were emitted. */ Returns true if any vtables were emitted. */
static int static bool
maybe_emit_vtables (tree ctype) maybe_emit_vtables (tree ctype)
{ {
tree vtbl; tree vtbl;
...@@ -1747,10 +1704,10 @@ maybe_emit_vtables (tree ctype) ...@@ -1747,10 +1704,10 @@ maybe_emit_vtables (tree ctype)
nothing more to do. */ nothing more to do. */
primary_vtbl = CLASSTYPE_VTABLES (ctype); primary_vtbl = CLASSTYPE_VTABLES (ctype);
if (TREE_ASM_WRITTEN (primary_vtbl)) if (TREE_ASM_WRITTEN (primary_vtbl))
return 0; return false;
/* Ignore dummy vtables made by get_vtable_decl. */ /* Ignore dummy vtables made by get_vtable_decl. */
if (TREE_TYPE (primary_vtbl) == void_type_node) if (TREE_TYPE (primary_vtbl) == void_type_node)
return 0; return false;
import_export_class (ctype); import_export_class (ctype);
import_export_vtable (primary_vtbl, ctype, 1); import_export_vtable (primary_vtbl, ctype, 1);
...@@ -1768,7 +1725,7 @@ maybe_emit_vtables (tree ctype) ...@@ -1768,7 +1725,7 @@ maybe_emit_vtables (tree ctype)
if (DECL_COMDAT (primary_vtbl) if (DECL_COMDAT (primary_vtbl)
&& CLASSTYPE_DEBUG_REQUESTED (ctype)) && CLASSTYPE_DEBUG_REQUESTED (ctype))
note_debug_info_needed (ctype); note_debug_info_needed (ctype);
return 0; return false;
} }
/* The ABI requires that we emit all of the vtables if we emit any /* The ABI requires that we emit all of the vtables if we emit any
...@@ -1826,15 +1783,14 @@ maybe_emit_vtables (tree ctype) ...@@ -1826,15 +1783,14 @@ maybe_emit_vtables (tree ctype)
info. */ info. */
note_debug_info_needed (ctype); note_debug_info_needed (ctype);
return 1; return true;
} }
/* Determines the proper settings of TREE_PUBLIC and DECL_EXTERNAL for an /* Determines the proper settings of TREE_PUBLIC and DECL_EXTERNAL for an
inline function or template instantiation at end-of-file. */ inline function or template instantiation at end-of-file. */
void void
import_export_decl (decl) import_export_decl (tree decl)
tree decl;
{ {
if (DECL_INTERFACE_KNOWN (decl)) if (DECL_INTERFACE_KNOWN (decl))
return; return;
...@@ -1900,10 +1856,7 @@ import_export_decl (decl) ...@@ -1900,10 +1856,7 @@ import_export_decl (decl)
typeinfo for TYPE should be in the runtime library. */ typeinfo for TYPE should be in the runtime library. */
void void
import_export_tinfo (decl, type, is_in_library) import_export_tinfo (tree decl, tree type, bool is_in_library)
tree decl;
tree type;
int is_in_library;
{ {
if (DECL_INTERFACE_KNOWN (decl)) if (DECL_INTERFACE_KNOWN (decl))
return; return;
...@@ -1937,8 +1890,7 @@ import_export_tinfo (decl, type, is_in_library) ...@@ -1937,8 +1890,7 @@ import_export_tinfo (decl, type, is_in_library)
} }
tree tree
build_cleanup (decl) build_cleanup (tree decl)
tree decl;
{ {
tree temp; tree temp;
tree type = TREE_TYPE (decl); tree type = TREE_TYPE (decl);
...@@ -1960,8 +1912,7 @@ build_cleanup (decl) ...@@ -1960,8 +1912,7 @@ build_cleanup (decl)
which has static storage duration. */ which has static storage duration. */
tree tree
get_guard (decl) get_guard (tree decl)
tree decl;
{ {
tree sname; tree sname;
tree guard; tree guard;
...@@ -1997,8 +1948,7 @@ get_guard (decl) ...@@ -1997,8 +1948,7 @@ get_guard (decl)
guarded entity is actually initialized. */ guarded entity is actually initialized. */
static tree static tree
get_guard_bits (guard) get_guard_bits (tree guard)
tree guard;
{ {
/* We only set the first byte of the guard, in order to leave room /* We only set the first byte of the guard, in order to leave room
for a mutex in the high-order bits. */ for a mutex in the high-order bits. */
...@@ -2017,8 +1967,7 @@ get_guard_bits (guard) ...@@ -2017,8 +1967,7 @@ get_guard_bits (guard)
variable has already been initialized. */ variable has already been initialized. */
tree tree
get_guard_cond (guard) get_guard_cond (tree guard)
tree guard;
{ {
tree guard_value; tree guard_value;
...@@ -2034,8 +1983,7 @@ get_guard_cond (guard) ...@@ -2034,8 +1983,7 @@ get_guard_cond (guard)
the variable being guarded has been initialized. */ the variable being guarded has been initialized. */
tree tree
set_guard (guard) set_guard (tree guard)
tree guard;
{ {
tree guard_init; tree guard_init;
...@@ -2051,8 +1999,7 @@ set_guard (guard) ...@@ -2051,8 +1999,7 @@ set_guard (guard)
or destructors. Subroutine of do_[cd]tors. */ or destructors. Subroutine of do_[cd]tors. */
static tree static tree
start_objects (method_type, initp) start_objects (int method_type, int initp)
int method_type, initp;
{ {
tree fnname; tree fnname;
tree body; tree body;
...@@ -2112,9 +2059,7 @@ start_objects (method_type, initp) ...@@ -2112,9 +2059,7 @@ start_objects (method_type, initp)
or destructors. Subroutine of do_[cd]tors. */ or destructors. Subroutine of do_[cd]tors. */
static void static void
finish_objects (method_type, initp, body) finish_objects (int method_type, int initp, tree body)
int method_type, initp;
tree body;
{ {
tree fn; tree fn;
...@@ -2180,7 +2125,7 @@ static splay_tree priority_info_map; ...@@ -2180,7 +2125,7 @@ static splay_tree priority_info_map;
translation unit. */ translation unit. */
static tree static tree
start_static_storage_duration_function () start_static_storage_duration_function (void)
{ {
static unsigned ssdf_number; static unsigned ssdf_number;
...@@ -2279,8 +2224,7 @@ start_static_storage_duration_function () ...@@ -2279,8 +2224,7 @@ start_static_storage_duration_function ()
this point, no more such objects can be created. */ this point, no more such objects can be created. */
static void static void
finish_static_storage_duration_function (body) finish_static_storage_duration_function (tree body)
tree body;
{ {
/* Close out the function. */ /* Close out the function. */
finish_compound_stmt (/*has_no_scope=*/0, body); finish_compound_stmt (/*has_no_scope=*/0, body);
...@@ -2292,8 +2236,7 @@ finish_static_storage_duration_function (body) ...@@ -2292,8 +2236,7 @@ finish_static_storage_duration_function (body)
appropriate prologue. */ appropriate prologue. */
static priority_info static priority_info
get_priority_info (priority) get_priority_info (int priority)
int priority;
{ {
priority_info pi; priority_info pi;
splay_tree_node n; splay_tree_node n;
...@@ -2322,9 +2265,7 @@ get_priority_info (priority) ...@@ -2322,9 +2265,7 @@ get_priority_info (priority)
are destroying it. */ are destroying it. */
static tree static tree
start_static_initialization_or_destruction (decl, initp) start_static_initialization_or_destruction (tree decl, int initp)
tree decl;
int initp;
{ {
tree guard_if_stmt = NULL_TREE; tree guard_if_stmt = NULL_TREE;
int priority; int priority;
...@@ -2446,8 +2387,7 @@ start_static_initialization_or_destruction (decl, initp) ...@@ -2446,8 +2387,7 @@ start_static_initialization_or_destruction (decl, initp)
the initialization. */ the initialization. */
static void static void
finish_static_initialization_or_destruction (guard_if_stmt) finish_static_initialization_or_destruction (tree guard_if_stmt)
tree guard_if_stmt;
{ {
finish_then_clause (guard_if_stmt); finish_then_clause (guard_if_stmt);
finish_if_stmt (); finish_if_stmt ();
...@@ -2462,9 +2402,7 @@ finish_static_initialization_or_destruction (guard_if_stmt) ...@@ -2462,9 +2402,7 @@ finish_static_initialization_or_destruction (guard_if_stmt)
static storage duration. The initialization is INIT. */ static storage duration. The initialization is INIT. */
static void static void
do_static_initialization (decl, init) do_static_initialization (tree decl, tree init)
tree decl;
tree init;
{ {
tree guard_if_stmt; tree guard_if_stmt;
...@@ -2492,8 +2430,7 @@ do_static_initialization (decl, init) ...@@ -2492,8 +2430,7 @@ do_static_initialization (decl, init)
destruction. */ destruction. */
static void static void
do_static_destruction (decl) do_static_destruction (tree decl)
tree decl;
{ {
tree guard_if_stmt; tree guard_if_stmt;
...@@ -2521,8 +2458,7 @@ do_static_destruction (decl) ...@@ -2521,8 +2458,7 @@ do_static_destruction (decl)
i.e., the first variable should be initialized first. */ i.e., the first variable should be initialized first. */
static tree static tree
prune_vars_needing_no_initialization (vars) prune_vars_needing_no_initialization (tree vars)
tree vars;
{ {
tree var; tree var;
tree result; tree result;
...@@ -2564,8 +2500,7 @@ prune_vars_needing_no_initialization (vars) ...@@ -2564,8 +2500,7 @@ prune_vars_needing_no_initialization (vars)
VARS. */ VARS. */
static void static void
write_out_vars (vars) write_out_vars (tree vars)
tree vars;
{ {
tree v; tree v;
...@@ -2579,9 +2514,7 @@ write_out_vars (vars) ...@@ -2579,9 +2514,7 @@ write_out_vars (vars)
storage duration having the indicated PRIORITY. */ storage duration having the indicated PRIORITY. */
static void static void
generate_ctor_or_dtor_function (constructor_p, priority) generate_ctor_or_dtor_function (bool constructor_p, int priority)
int constructor_p;
int priority;
{ {
char function_key; char function_key;
tree arguments; tree arguments;
...@@ -2631,9 +2564,8 @@ generate_ctor_or_dtor_function (constructor_p, priority) ...@@ -2631,9 +2564,8 @@ generate_ctor_or_dtor_function (constructor_p, priority)
indicated by N. */ indicated by N. */
static int static int
generate_ctor_and_dtor_functions_for_priority (n, data) generate_ctor_and_dtor_functions_for_priority (splay_tree_node n,
splay_tree_node n; void * data ATTRIBUTE_UNUSED)
void *data ATTRIBUTE_UNUSED;
{ {
int priority = (int) n->key; int priority = (int) n->key;
priority_info pi = (priority_info) n->value; priority_info pi = (priority_info) n->value;
...@@ -2642,12 +2574,10 @@ generate_ctor_and_dtor_functions_for_priority (n, data) ...@@ -2642,12 +2574,10 @@ generate_ctor_and_dtor_functions_for_priority (n, data)
needed. */ needed. */
if (pi->initializations_p if (pi->initializations_p
|| (priority == DEFAULT_INIT_PRIORITY && static_ctors)) || (priority == DEFAULT_INIT_PRIORITY && static_ctors))
generate_ctor_or_dtor_function (/*constructor_p=*/1, generate_ctor_or_dtor_function (/*constructor_p=*/true, priority);
priority);
if (pi->destructions_p if (pi->destructions_p
|| (priority == DEFAULT_INIT_PRIORITY && static_dtors)) || (priority == DEFAULT_INIT_PRIORITY && static_dtors))
generate_ctor_or_dtor_function (/*constructor_p=*/0, generate_ctor_or_dtor_function (/*constructor_p=*/false, priority);
priority);
/* Keep iterating. */ /* Keep iterating. */
return 0; return 0;
...@@ -2662,7 +2592,7 @@ void ...@@ -2662,7 +2592,7 @@ void
finish_file () finish_file ()
{ {
tree vars; tree vars;
int reconsider; bool reconsider;
size_t i; size_t i;
at_eof = 1; at_eof = 1;
...@@ -2702,7 +2632,7 @@ finish_file () ...@@ -2702,7 +2632,7 @@ finish_file ()
{ {
tree t; tree t;
reconsider = 0; reconsider = false;
/* If there are templates that we've put off instantiating, do /* If there are templates that we've put off instantiating, do
them now. */ them now. */
...@@ -2713,12 +2643,12 @@ finish_file () ...@@ -2713,12 +2643,12 @@ finish_file ()
instantiation of members of that class. */ instantiation of members of that class. */
for (t = dynamic_classes; t; t = TREE_CHAIN (t)) for (t = dynamic_classes; t; t = TREE_CHAIN (t))
if (maybe_emit_vtables (TREE_VALUE (t))) if (maybe_emit_vtables (TREE_VALUE (t)))
reconsider = 1; reconsider = true;
/* Write out needed type info variables. Writing out one variable /* Write out needed type info variables. Writing out one variable
might cause others to be needed. */ might cause others to be needed. */
if (walk_globals (unemitted_tinfo_decl_p, emit_tinfo_decl, /*data=*/0)) if (walk_globals (unemitted_tinfo_decl_p, emit_tinfo_decl, /*data=*/0))
reconsider = 1; reconsider = true;
/* The list of objects with static storage duration is built up /* The list of objects with static storage duration is built up
in reverse order. We clear STATIC_AGGREGATES so that any new in reverse order. We clear STATIC_AGGREGATES so that any new
...@@ -2771,7 +2701,7 @@ finish_file () ...@@ -2771,7 +2701,7 @@ finish_file ()
/* All those initializations and finalizations might cause /* All those initializations and finalizations might cause
us to need more inline functions, more template us to need more inline functions, more template
instantiations, etc. */ instantiations, etc. */
reconsider = 1; reconsider = true;
} }
for (i = 0; i < deferred_fns_used; ++i) for (i = 0; i < deferred_fns_used; ++i)
...@@ -2793,7 +2723,7 @@ finish_file () ...@@ -2793,7 +2723,7 @@ finish_file ()
push_to_top_level (); push_to_top_level ();
synthesize_method (decl); synthesize_method (decl);
pop_from_top_level (); pop_from_top_level ();
reconsider = 1; reconsider = true;
} }
/* We lie to the back-end, pretending that some functions /* We lie to the back-end, pretending that some functions
...@@ -2837,16 +2767,16 @@ finish_file () ...@@ -2837,16 +2767,16 @@ finish_file ()
expand it again. */ expand it again. */
if (flag_syntax_only) if (flag_syntax_only)
TREE_ASM_WRITTEN (decl) = 1; TREE_ASM_WRITTEN (decl) = 1;
reconsider = 1; reconsider = true;
} }
} }
if (deferred_fns_used if (deferred_fns_used
&& wrapup_global_declarations (&VARRAY_TREE (deferred_fns, 0), && wrapup_global_declarations (&VARRAY_TREE (deferred_fns, 0),
deferred_fns_used)) deferred_fns_used))
reconsider = 1; reconsider = true;
if (walk_namespaces (wrapup_globals_for_namespace, /*data=*/0)) if (walk_namespaces (wrapup_globals_for_namespace, /*data=*/0))
reconsider = 1; reconsider = true;
/* Static data members are just like namespace-scope globals. */ /* Static data members are just like namespace-scope globals. */
for (i = 0; i < pending_statics_used; ++i) for (i = 0; i < pending_statics_used; ++i)
...@@ -2861,7 +2791,7 @@ finish_file () ...@@ -2861,7 +2791,7 @@ finish_file ()
if (pending_statics if (pending_statics
&& wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0), && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
pending_statics_used)) pending_statics_used))
reconsider = 1; reconsider = true;
} }
while (reconsider); while (reconsider);
...@@ -3517,8 +3447,7 @@ build_call_from_tree (tree fn, tree args, bool disallow_virtual) ...@@ -3517,8 +3447,7 @@ build_call_from_tree (tree fn, tree args, bool disallow_virtual)
In the above example, TYPE is `int' and DECL is `*a'. */ In the above example, TYPE is `int' and DECL is `*a'. */
tree tree
reparse_decl_as_expr (type, decl) reparse_decl_as_expr (tree type, tree decl)
tree type, decl;
{ {
decl = build_expr_from_tree (decl); decl = build_expr_from_tree (decl);
if (type) if (type)
...@@ -3532,8 +3461,7 @@ reparse_decl_as_expr (type, decl) ...@@ -3532,8 +3461,7 @@ reparse_decl_as_expr (type, decl)
checking that make_{pointer,reference}_declarator do. */ checking that make_{pointer,reference}_declarator do. */
tree tree
finish_decl_parsing (decl) finish_decl_parsing (tree decl)
tree decl;
{ {
switch (TREE_CODE (decl)) switch (TREE_CODE (decl))
{ {
...@@ -3569,16 +3497,15 @@ finish_decl_parsing (decl) ...@@ -3569,16 +3497,15 @@ finish_decl_parsing (decl)
/* Return 1 if root encloses child. */ /* Return 1 if root encloses child. */
static int static bool
is_namespace_ancestor (root, child) is_namespace_ancestor (tree root, tree child)
tree root, child;
{ {
if (root == child) if (root == child)
return 1; return true;
if (root == global_namespace) if (root == global_namespace)
return 1; return true;
if (child == global_namespace) if (child == global_namespace)
return 0; return false;
return is_namespace_ancestor (root, CP_DECL_CONTEXT (child)); return is_namespace_ancestor (root, CP_DECL_CONTEXT (child));
} }
...@@ -3587,22 +3514,18 @@ is_namespace_ancestor (root, child) ...@@ -3587,22 +3514,18 @@ is_namespace_ancestor (root, child)
of two given namespaces. */ of two given namespaces. */
tree tree
namespace_ancestor (ns1, ns2) namespace_ancestor (tree ns1, tree ns2)
tree ns1, ns2;
{ {
if (is_namespace_ancestor (ns1, ns2)) if (is_namespace_ancestor (ns1, ns2))
return ns1; return ns1;
return namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2); return namespace_ancestor (CP_DECL_CONTEXT (ns1), ns2);
} }
/* Insert used into the using list of user. Set indirect_flag if this /* Insert USED into the using list of USER. Set INDIRECT_flag if this
directive is not directly from the source. Also find the common directive is not directly from the source. Also find the common
ancestor and let our users know about the new namespace */ ancestor and let our users know about the new namespace */
static void static void
add_using_namespace (user, used, indirect) add_using_namespace (tree user, tree used, bool indirect)
tree user;
tree used;
int indirect;
{ {
tree t; tree t;
/* Using oneself is a no-op. */ /* Using oneself is a no-op. */
...@@ -3649,9 +3572,7 @@ add_using_namespace (user, used, indirect) ...@@ -3649,9 +3572,7 @@ add_using_namespace (user, used, indirect)
necessary. */ necessary. */
static tree static tree
merge_functions (s1, s2) merge_functions (tree s1, tree s2)
tree s1;
tree s2;
{ {
for (; s2; s2 = OVL_NEXT (s2)) for (; s2; s2 = OVL_NEXT (s2))
{ {
...@@ -3688,11 +3609,7 @@ merge_functions (s1, s2) ...@@ -3688,11 +3609,7 @@ merge_functions (s1, s2)
XXX I don't want to repeat the entire duplicate_decls here */ XXX I don't want to repeat the entire duplicate_decls here */
static tree static tree
ambiguous_decl (name, old, new, flags) ambiguous_decl (tree name, tree old, tree new, int flags)
tree name;
tree old;
tree new;
int flags;
{ {
tree val, type; tree val, type;
my_friendly_assert (old != NULL_TREE, 393); my_friendly_assert (old != NULL_TREE, 393);
...@@ -3778,13 +3695,11 @@ ambiguous_decl (name, old, new, flags) ...@@ -3778,13 +3695,11 @@ ambiguous_decl (name, old, new, flags)
We are currently looking for names in namespace SCOPE, so we We are currently looking for names in namespace SCOPE, so we
look through USINGS for using-directives of namespaces look through USINGS for using-directives of namespaces
which have SCOPE as a common ancestor with the current scope. which have SCOPE as a common ancestor with the current scope.
Returns zero on errors. */ Returns false on errors. */
int bool
lookup_using_namespace (name, val, usings, scope, flags, spacesp) lookup_using_namespace (tree name, tree val, tree usings, tree scope,
tree name, val, usings, scope; int flags, tree *spacesp)
int flags;
tree *spacesp;
{ {
tree iter; tree iter;
tree val1; tree val1;
...@@ -3806,14 +3721,11 @@ lookup_using_namespace (name, val, usings, scope, flags, spacesp) ...@@ -3806,14 +3721,11 @@ lookup_using_namespace (name, val, usings, scope, flags, spacesp)
/* [namespace.qual] /* [namespace.qual]
Accepts the NAME to lookup and its qualifying SCOPE. Accepts the NAME to lookup and its qualifying SCOPE.
Returns the name/type pair found into the CPLUS_BINDING RESULT, Returns the name/type pair found into the CPLUS_BINDING RESULT,
or 0 on error. */ or false on error. */
int bool
qualified_lookup_using_namespace (name, scope, result, flags) qualified_lookup_using_namespace (tree name, tree scope, tree result,
tree name; int flags)
tree scope;
tree result;
int flags;
{ {
/* Maintain a list of namespaces visited... */ /* Maintain a list of namespaces visited... */
tree seen = NULL_TREE; tree seen = NULL_TREE;
...@@ -3852,10 +3764,7 @@ qualified_lookup_using_namespace (name, scope, result, flags) ...@@ -3852,10 +3764,7 @@ qualified_lookup_using_namespace (name, scope, result, flags)
outside scope. */ outside scope. */
void void
set_decl_namespace (decl, scope, friendp) set_decl_namespace (tree decl, tree scope, bool friendp)
tree decl;
tree scope;
int friendp;
{ {
tree old; tree old;
...@@ -3911,8 +3820,7 @@ set_decl_namespace (decl, scope, friendp) ...@@ -3911,8 +3820,7 @@ set_decl_namespace (decl, scope, friendp)
/* Compute the namespace where a declaration is defined. */ /* Compute the namespace where a declaration is defined. */
static tree static tree
decl_namespace (decl) decl_namespace (tree decl)
tree decl;
{ {
if (TYPE_P (decl)) if (TYPE_P (decl))
decl = TYPE_STUB_DECL (decl); decl = TYPE_STUB_DECL (decl);
...@@ -3932,7 +3840,7 @@ decl_namespace (decl) ...@@ -3932,7 +3840,7 @@ decl_namespace (decl)
/* Return the namespace where the current declaration is declared. */ /* Return the namespace where the current declaration is declared. */
tree tree
current_decl_namespace () current_decl_namespace (void)
{ {
tree result; tree result;
/* If we have been pushed into a different namespace, use it. */ /* If we have been pushed into a different namespace, use it. */
...@@ -3951,8 +3859,7 @@ current_decl_namespace () ...@@ -3951,8 +3859,7 @@ current_decl_namespace ()
/* Temporarily set the namespace for the current declaration. */ /* Temporarily set the namespace for the current declaration. */
void void
push_decl_namespace (decl) push_decl_namespace (tree decl)
tree decl;
{ {
if (TREE_CODE (decl) != NAMESPACE_DECL) if (TREE_CODE (decl) != NAMESPACE_DECL)
decl = decl_namespace (decl); decl = decl_namespace (decl);
...@@ -3961,7 +3868,7 @@ push_decl_namespace (decl) ...@@ -3961,7 +3868,7 @@ push_decl_namespace (decl)
} }
void void
pop_decl_namespace () pop_decl_namespace (void)
{ {
decl_namespace_list = TREE_CHAIN (decl_namespace_list); decl_namespace_list = TREE_CHAIN (decl_namespace_list);
} }
...@@ -3969,8 +3876,7 @@ pop_decl_namespace () ...@@ -3969,8 +3876,7 @@ pop_decl_namespace ()
/* Enter a class or namespace scope. */ /* Enter a class or namespace scope. */
void void
push_scope (t) push_scope (tree t)
tree t;
{ {
if (TREE_CODE (t) == NAMESPACE_DECL) if (TREE_CODE (t) == NAMESPACE_DECL)
push_decl_namespace (t); push_decl_namespace (t);
...@@ -3981,8 +3887,7 @@ push_scope (t) ...@@ -3981,8 +3887,7 @@ push_scope (t)
/* Leave scope pushed by push_scope. */ /* Leave scope pushed by push_scope. */
void void
pop_scope (t) pop_scope (tree t)
tree t;
{ {
if (TREE_CODE (t) == NAMESPACE_DECL) if (TREE_CODE (t) == NAMESPACE_DECL)
pop_decl_namespace (); pop_decl_namespace ();
...@@ -4001,21 +3906,19 @@ struct arg_lookup ...@@ -4001,21 +3906,19 @@ struct arg_lookup
tree functions; tree functions;
}; };
static int arg_assoc PARAMS ((struct arg_lookup*, tree)); static bool arg_assoc (struct arg_lookup*, tree);
static int arg_assoc_args PARAMS ((struct arg_lookup*, tree)); static bool arg_assoc_args (struct arg_lookup*, tree);
static int arg_assoc_type PARAMS ((struct arg_lookup*, tree)); static bool arg_assoc_type (struct arg_lookup*, tree);
static int add_function PARAMS ((struct arg_lookup *, tree)); static bool add_function (struct arg_lookup *, tree);
static int arg_assoc_namespace PARAMS ((struct arg_lookup *, tree)); static bool arg_assoc_namespace (struct arg_lookup *, tree);
static int arg_assoc_class PARAMS ((struct arg_lookup *, tree)); static bool arg_assoc_class (struct arg_lookup *, tree);
static int arg_assoc_template_arg PARAMS ((struct arg_lookup*, tree)); static bool arg_assoc_template_arg (struct arg_lookup*, tree);
/* Add a function to the lookup structure. /* Add a function to the lookup structure.
Returns 1 on error. */ Returns true on error. */
static int static bool
add_function (k, fn) add_function (struct arg_lookup *k, tree fn)
struct arg_lookup *k;
tree fn;
{ {
/* We used to check here to see if the function was already in the list, /* We used to check here to see if the function was already in the list,
but that's O(n^2), which is just too expensive for function lookup. but that's O(n^2), which is just too expensive for function lookup.
...@@ -4040,19 +3943,17 @@ add_function (k, fn) ...@@ -4040,19 +3943,17 @@ add_function (k, fn)
cp_error_at ("`%D' is not a function,", f1); cp_error_at ("`%D' is not a function,", f1);
cp_error_at (" conflict with `%D'", f2); cp_error_at (" conflict with `%D'", f2);
error (" in call to `%D'", k->name); error (" in call to `%D'", k->name);
return 1; return true;
} }
return 0; return false;
} }
/* Add functions of a namespace to the lookup structure. /* Add functions of a namespace to the lookup structure.
Returns 1 on error. */ Returns true on error. */
static int static bool
arg_assoc_namespace (k, scope) arg_assoc_namespace (struct arg_lookup *k, tree scope)
struct arg_lookup *k;
tree scope;
{ {
tree value; tree value;
...@@ -4062,22 +3963,20 @@ arg_assoc_namespace (k, scope) ...@@ -4062,22 +3963,20 @@ arg_assoc_namespace (k, scope)
value = namespace_binding (k->name, scope); value = namespace_binding (k->name, scope);
if (!value) if (!value)
return 0; return false;
for (; value; value = OVL_NEXT (value)) for (; value; value = OVL_NEXT (value))
if (add_function (k, OVL_CURRENT (value))) if (add_function (k, OVL_CURRENT (value)))
return 1; return true;
return 0; return false;
} }
/* Adds everything associated with a template argument to the lookup /* Adds everything associated with a template argument to the lookup
structure. Returns 1 on error. */ structure. Returns true on error. */
static int static bool
arg_assoc_template_arg (k, arg) arg_assoc_template_arg (struct arg_lookup *k, tree arg)
struct arg_lookup* k;
tree arg;
{ {
/* [basic.lookup.koenig] /* [basic.lookup.koenig]
...@@ -4093,7 +3992,7 @@ arg_assoc_template_arg (k, arg) ...@@ -4093,7 +3992,7 @@ arg_assoc_template_arg (k, arg)
/* Consider first template template arguments. */ /* Consider first template template arguments. */
if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM if (TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM
|| TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE) || TREE_CODE (arg) == UNBOUND_CLASS_TEMPLATE)
return 0; return false;
else if (TREE_CODE (arg) == TEMPLATE_DECL) else if (TREE_CODE (arg) == TEMPLATE_DECL)
{ {
tree ctx = CP_DECL_CONTEXT (arg); tree ctx = CP_DECL_CONTEXT (arg);
...@@ -4111,16 +4010,14 @@ arg_assoc_template_arg (k, arg) ...@@ -4111,16 +4010,14 @@ arg_assoc_template_arg (k, arg)
return arg_assoc_type (k, arg); return arg_assoc_type (k, arg);
/* It's a non-type template argument. */ /* It's a non-type template argument. */
else else
return 0; return false;
} }
/* Adds everything associated with class to the lookup structure. /* Adds everything associated with class to the lookup structure.
Returns 1 on error. */ Returns true on error. */
static int static bool
arg_assoc_class (k, type) arg_assoc_class (struct arg_lookup *k, tree type)
struct arg_lookup* k;
tree type;
{ {
tree list, friends, context; tree list, friends, context;
int i; int i;
...@@ -4128,20 +4025,20 @@ arg_assoc_class (k, type) ...@@ -4128,20 +4025,20 @@ arg_assoc_class (k, type)
/* Backend build structures, such as __builtin_va_list, aren't /* Backend build structures, such as __builtin_va_list, aren't
affected by all this. */ affected by all this. */
if (!CLASS_TYPE_P (type)) if (!CLASS_TYPE_P (type))
return 0; return false;
if (purpose_member (type, k->classes)) if (purpose_member (type, k->classes))
return 0; return false;
k->classes = tree_cons (type, NULL_TREE, k->classes); k->classes = tree_cons (type, NULL_TREE, k->classes);
context = decl_namespace (TYPE_MAIN_DECL (type)); context = decl_namespace (TYPE_MAIN_DECL (type));
if (arg_assoc_namespace (k, context)) if (arg_assoc_namespace (k, context))
return 1; return true;
/* Process baseclasses. */ /* Process baseclasses. */
for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); i++) for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); i++)
if (arg_assoc_class (k, TYPE_BINFO_BASETYPE (type, i))) if (arg_assoc_class (k, TYPE_BINFO_BASETYPE (type, i)))
return 1; return true;
/* Process friends. */ /* Process friends. */
for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list; for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list;
...@@ -4154,7 +4051,7 @@ arg_assoc_class (k, type) ...@@ -4154,7 +4051,7 @@ arg_assoc_class (k, type)
if (TREE_PURPOSE (friends) == error_mark_node && TREE_VALUE (friends) if (TREE_PURPOSE (friends) == error_mark_node && TREE_VALUE (friends)
&& decl_namespace (TREE_VALUE (friends)) == context) && decl_namespace (TREE_VALUE (friends)) == context)
if (add_function (k, TREE_VALUE (friends))) if (add_function (k, TREE_VALUE (friends)))
return 1; return true;
/* Process template arguments. */ /* Process template arguments. */
if (CLASSTYPE_TEMPLATE_INFO (type)) if (CLASSTYPE_TEMPLATE_INFO (type))
...@@ -4164,16 +4061,14 @@ arg_assoc_class (k, type) ...@@ -4164,16 +4061,14 @@ arg_assoc_class (k, type)
arg_assoc_template_arg (k, TREE_VEC_ELT (list, i)); arg_assoc_template_arg (k, TREE_VEC_ELT (list, i));
} }
return 0; return false;
} }
/* Adds everything associated with a given type. /* Adds everything associated with a given type.
Returns 1 on error. */ Returns 1 on error. */
static int static bool
arg_assoc_type (k, type) arg_assoc_type (struct arg_lookup *k, tree type)
struct arg_lookup *k;
tree type;
{ {
switch (TREE_CODE (type)) switch (TREE_CODE (type))
{ {
...@@ -4184,7 +4079,7 @@ arg_assoc_type (k, type) ...@@ -4184,7 +4079,7 @@ arg_assoc_type (k, type)
case VECTOR_TYPE: case VECTOR_TYPE:
case CHAR_TYPE: case CHAR_TYPE:
case BOOLEAN_TYPE: case BOOLEAN_TYPE:
return 0; return false;
case RECORD_TYPE: case RECORD_TYPE:
if (TYPE_PTRMEMFUNC_P (type)) if (TYPE_PTRMEMFUNC_P (type))
return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type)); return arg_assoc_type (k, TYPE_PTRMEMFUNC_FN_TYPE (type));
...@@ -4199,7 +4094,7 @@ arg_assoc_type (k, type) ...@@ -4199,7 +4094,7 @@ arg_assoc_type (k, type)
case OFFSET_TYPE: case OFFSET_TYPE:
/* Pointer to member: associate class type and value type. */ /* Pointer to member: associate class type and value type. */
if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type))) if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type)))
return 1; return true;
return arg_assoc_type (k, TREE_TYPE (type)); return arg_assoc_type (k, TREE_TYPE (type));
case METHOD_TYPE: case METHOD_TYPE:
/* The basetype is referenced in the first arg type, so just /* The basetype is referenced in the first arg type, so just
...@@ -4207,46 +4102,42 @@ arg_assoc_type (k, type) ...@@ -4207,46 +4102,42 @@ arg_assoc_type (k, type)
case FUNCTION_TYPE: case FUNCTION_TYPE:
/* Associate the parameter types. */ /* Associate the parameter types. */
if (arg_assoc_args (k, TYPE_ARG_TYPES (type))) if (arg_assoc_args (k, TYPE_ARG_TYPES (type)))
return 1; return true;
/* Associate the return type. */ /* Associate the return type. */
return arg_assoc_type (k, TREE_TYPE (type)); return arg_assoc_type (k, TREE_TYPE (type));
case TEMPLATE_TYPE_PARM: case TEMPLATE_TYPE_PARM:
case BOUND_TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM:
return 0; return false;
case TYPENAME_TYPE: case TYPENAME_TYPE:
return 0; return false;
case LANG_TYPE: case LANG_TYPE:
if (type == unknown_type_node) if (type == unknown_type_node)
return 0; return false;
/* else fall through */ /* else fall through */
default: default:
abort (); abort ();
} }
return 0; return false;
} }
/* Adds everything associated with arguments. Returns 1 on error. */ /* Adds everything associated with arguments. Returns true on error. */
static int static bool
arg_assoc_args (k, args) arg_assoc_args (struct arg_lookup *k, tree args)
struct arg_lookup* k;
tree args;
{ {
for (; args; args = TREE_CHAIN (args)) for (; args; args = TREE_CHAIN (args))
if (arg_assoc (k, TREE_VALUE (args))) if (arg_assoc (k, TREE_VALUE (args)))
return 1; return true;
return 0; return false;
} }
/* Adds everything associated with a given tree_node. Returns 1 on error. */ /* Adds everything associated with a given tree_node. Returns 1 on error. */
static int static bool
arg_assoc (k, n) arg_assoc (struct arg_lookup *k, tree n)
struct arg_lookup* k;
tree n;
{ {
if (n == error_mark_node) if (n == error_mark_node)
return 0; return false;
if (TYPE_P (n)) if (TYPE_P (n))
return arg_assoc_type (k, n); return arg_assoc_type (k, n);
...@@ -4293,16 +4184,16 @@ arg_assoc (k, n) ...@@ -4293,16 +4184,16 @@ arg_assoc (k, n)
if (TREE_CODE (ctx) == NAMESPACE_DECL) if (TREE_CODE (ctx) == NAMESPACE_DECL)
{ {
if (arg_assoc_namespace (k, ctx) == 1) if (arg_assoc_namespace (k, ctx) == 1)
return 1; return true;
} }
/* It must be a member template. */ /* It must be a member template. */
else if (arg_assoc_class (k, ctx) == 1) else if (arg_assoc_class (k, ctx) == 1)
return 1; return true;
/* Now the arguments. */ /* Now the arguments. */
for (arg = args; arg != NULL_TREE; arg = TREE_CHAIN (arg)) for (arg = args; arg != NULL_TREE; arg = TREE_CHAIN (arg))
if (arg_assoc_template_arg (k, TREE_VALUE (arg)) == 1) if (arg_assoc_template_arg (k, TREE_VALUE (arg)) == 1)
return 1; return true;
} }
else else
{ {
...@@ -4310,20 +4201,17 @@ arg_assoc (k, n) ...@@ -4310,20 +4201,17 @@ arg_assoc (k, n)
for (; n; n = OVL_CHAIN (n)) for (; n; n = OVL_CHAIN (n))
if (arg_assoc_type (k, TREE_TYPE (OVL_FUNCTION (n)))) if (arg_assoc_type (k, TREE_TYPE (OVL_FUNCTION (n))))
return 1; return true;
} }
return 0; return false;
} }
/* Performs Koenig lookup depending on arguments, where fns /* Performs Koenig lookup depending on arguments, where fns
are the functions found in normal lookup. */ are the functions found in normal lookup. */
tree tree
lookup_arg_dependent (name, fns, args) lookup_arg_dependent (tree name, tree fns, tree args)
tree name;
tree fns;
tree args;
{ {
struct arg_lookup k; struct arg_lookup k;
tree fn = NULL_TREE; tree fn = NULL_TREE;
...@@ -4348,8 +4236,7 @@ lookup_arg_dependent (name, fns, args) ...@@ -4348,8 +4236,7 @@ lookup_arg_dependent (name, fns, args)
/* Process a namespace-alias declaration. */ /* Process a namespace-alias declaration. */
void void
do_namespace_alias (alias, namespace) do_namespace_alias (tree alias, tree namespace)
tree alias, namespace;
{ {
if (TREE_CODE (namespace) != NAMESPACE_DECL) if (TREE_CODE (namespace) != NAMESPACE_DECL)
{ {
...@@ -4370,10 +4257,7 @@ do_namespace_alias (alias, namespace) ...@@ -4370,10 +4257,7 @@ do_namespace_alias (alias, namespace)
being used, and the USING_DECL, or NULL_TREE on failure. */ being used, and the USING_DECL, or NULL_TREE on failure. */
static tree static tree
validate_nonmember_using_decl (decl, scope, name) validate_nonmember_using_decl (tree decl, tree *scope, tree *name)
tree decl;
tree *scope;
tree *name;
{ {
*scope = global_namespace; *scope = global_namespace;
*name = NULL_TREE; *name = NULL_TREE;
...@@ -4422,10 +4306,8 @@ validate_nonmember_using_decl (decl, scope, name) ...@@ -4422,10 +4306,8 @@ validate_nonmember_using_decl (decl, scope, name)
/* Process local and global using-declarations. */ /* Process local and global using-declarations. */
static void static void
do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype) do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
tree scope, name; tree *newval, tree *newtype)
tree oldval, oldtype;
tree *newval, *newtype;
{ {
tree decls; tree decls;
...@@ -4524,8 +4406,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype) ...@@ -4524,8 +4406,7 @@ do_nonmember_using_decl (scope, name, oldval, oldtype, newval, newtype)
/* Process a using-declaration not appearing in class or local scope. */ /* Process a using-declaration not appearing in class or local scope. */
void void
do_toplevel_using_decl (decl) do_toplevel_using_decl (tree decl)
tree decl;
{ {
tree scope, name, binding; tree scope, name, binding;
tree oldval, oldtype, newval, newtype; tree oldval, oldtype, newval, newtype;
...@@ -4552,8 +4433,7 @@ do_toplevel_using_decl (decl) ...@@ -4552,8 +4433,7 @@ do_toplevel_using_decl (decl)
/* Process a using-declaration at function scope. */ /* Process a using-declaration at function scope. */
void void
do_local_using_decl (decl) do_local_using_decl (tree decl)
tree decl;
{ {
tree scope, name; tree scope, name;
tree oldval, oldtype, newval, newtype; tree oldval, oldtype, newval, newtype;
...@@ -4598,8 +4478,7 @@ do_local_using_decl (decl) ...@@ -4598,8 +4478,7 @@ do_local_using_decl (decl)
} }
tree tree
do_class_using_decl (decl) do_class_using_decl (tree decl)
tree decl;
{ {
tree name, value; tree name, value;
...@@ -4659,8 +4538,7 @@ do_class_using_decl (decl) ...@@ -4659,8 +4538,7 @@ do_class_using_decl (decl)
/* Process a using-directive. */ /* Process a using-directive. */
void void
do_using_directive (namespace) do_using_directive (tree namespace)
tree namespace;
{ {
if (building_stmt_tree ()) if (building_stmt_tree ())
add_stmt (build_stmt (USING_STMT, namespace)); add_stmt (build_stmt (USING_STMT, namespace));
...@@ -4690,15 +4568,15 @@ do_using_directive (namespace) ...@@ -4690,15 +4568,15 @@ do_using_directive (namespace)
} }
void void
check_default_args (x) check_default_args (tree x)
tree x;
{ {
tree arg = TYPE_ARG_TYPES (TREE_TYPE (x)); tree arg = TYPE_ARG_TYPES (TREE_TYPE (x));
int saw_def = 0, i = 0 - (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE); bool saw_def = false;
int i = 0 - (TREE_CODE (TREE_TYPE (x)) == METHOD_TYPE);
for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i) for (; arg && arg != void_list_node; arg = TREE_CHAIN (arg), ++i)
{ {
if (TREE_PURPOSE (arg)) if (TREE_PURPOSE (arg))
saw_def = 1; saw_def = true;
else if (saw_def) else if (saw_def)
{ {
cp_error_at ("default argument missing for parameter %P of `%+#D'", cp_error_at ("default argument missing for parameter %P of `%+#D'",
...@@ -4709,8 +4587,7 @@ check_default_args (x) ...@@ -4709,8 +4587,7 @@ check_default_args (x)
} }
void void
mark_used (decl) mark_used (tree decl)
tree decl;
{ {
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
if (processing_template_decl) if (processing_template_decl)
...@@ -4759,11 +4636,8 @@ mark_used (decl) ...@@ -4759,11 +4636,8 @@ mark_used (decl)
Return a TYPE_DECL for the type declared by ID in SCOPE. */ Return a TYPE_DECL for the type declared by ID in SCOPE. */
tree tree
handle_class_head (tag_kind, scope, id, attributes, defn_p, new_type_p) handle_class_head (enum tag_types tag_kind, tree scope, tree id,
enum tag_types tag_kind; tree attributes, bool defn_p, bool *new_type_p)
tree scope, id, attributes;
int defn_p;
int *new_type_p;
{ {
tree decl = NULL_TREE; tree decl = NULL_TREE;
tree current = current_scope (); tree current = current_scope ();
...@@ -4772,7 +4646,7 @@ handle_class_head (tag_kind, scope, id, attributes, defn_p, new_type_p) ...@@ -4772,7 +4646,7 @@ handle_class_head (tag_kind, scope, id, attributes, defn_p, new_type_p)
if (current == NULL_TREE) if (current == NULL_TREE)
current = current_namespace; current = current_namespace;
*new_type_p = 0; *new_type_p = false;
if (scope) if (scope)
{ {
......
...@@ -11755,7 +11755,7 @@ cp_parser_class_head (parser, ...@@ -11755,7 +11755,7 @@ cp_parser_class_head (parser,
} }
else else
{ {
int new_type_p; bool new_type_p;
tree class_type; tree class_type;
/* Given: /* Given:
...@@ -11779,7 +11779,7 @@ cp_parser_class_head (parser, ...@@ -11779,7 +11779,7 @@ cp_parser_class_head (parser,
nested_name_specifier, nested_name_specifier,
type, type,
attributes, attributes,
/*defn_p=*/1, /*defn_p=*/true,
&new_type_p)); &new_type_p));
if (type != error_mark_node) if (type != error_mark_node)
{ {
......
...@@ -29,10 +29,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,10 +29,7 @@ Boston, MA 02111-1307, USA. */
#include "cp-tree.h" #include "cp-tree.h"
void void
cxx_print_decl (file, node, indent) cxx_print_decl (FILE *file, tree node, int indent)
FILE *file;
tree node;
int indent;
{ {
if (TREE_CODE (node) == FIELD_DECL) if (TREE_CODE (node) == FIELD_DECL)
{ {
...@@ -68,10 +65,7 @@ cxx_print_decl (file, node, indent) ...@@ -68,10 +65,7 @@ cxx_print_decl (file, node, indent)
} }
void void
cxx_print_type (file, node, indent) cxx_print_type (FILE *file, tree node, int indent)
FILE *file;
register tree node;
int indent;
{ {
switch (TREE_CODE (node)) switch (TREE_CODE (node))
{ {
...@@ -160,10 +154,7 @@ cxx_print_type (file, node, indent) ...@@ -160,10 +154,7 @@ cxx_print_type (file, node, indent)
} }
void void
cxx_print_identifier (file, node, indent) cxx_print_identifier (FILE *file, tree node, int indent)
FILE *file;
tree node;
int indent;
{ {
print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4); print_node (file, "bindings", IDENTIFIER_NAMESPACE_BINDINGS (node), indent + 4);
print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4); print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
...@@ -175,10 +166,7 @@ cxx_print_identifier (file, node, indent) ...@@ -175,10 +166,7 @@ cxx_print_identifier (file, node, indent)
} }
void void
cxx_print_xnode (file, node, indent) cxx_print_xnode (FILE *file, tree node, int indent)
FILE *file;
tree node;
int indent;
{ {
switch (TREE_CODE (node)) switch (TREE_CODE (node))
{ {
......
...@@ -37,12 +37,12 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,12 +37,12 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h" #include "ggc.h"
#include "diagnostic.h" #include "diagnostic.h"
static tree repo_get_id PARAMS ((tree)); static tree repo_get_id (tree);
static char *extract_string PARAMS ((char **)); static char *extract_string (char **);
static const char *get_base_filename PARAMS ((const char *)); static const char *get_base_filename (const char *);
static void open_repo_file PARAMS ((const char *)); static void open_repo_file (const char *);
static char *afgets PARAMS ((FILE *)); static char *afgets (FILE *);
static void reopen_repo_file_for_write PARAMS ((void)); static void reopen_repo_file_for_write (void);
static GTY(()) tree pending_repo; static GTY(()) tree pending_repo;
static GTY(()) tree original_repo; static GTY(()) tree original_repo;
...@@ -60,9 +60,7 @@ static struct obstack temporary_obstack; ...@@ -60,9 +60,7 @@ static struct obstack temporary_obstack;
/* Record the flags used to compile this translation unit. */ /* Record the flags used to compile this translation unit. */
void void
repo_compile_flags (argc, argv) repo_compile_flags (int argc, char **argv)
int argc;
char **argv;
{ {
} }
...@@ -71,30 +69,26 @@ repo_compile_flags (argc, argv) ...@@ -71,30 +69,26 @@ repo_compile_flags (argc, argv)
definition at link time. */ definition at link time. */
void void
repo_template_declared (t) repo_template_declared (tree t)
tree t;
{} {}
/* Note where the definition of a template lives so that instantiations can /* Note where the definition of a template lives so that instantiations can
be generated later. */ be generated later. */
void void
repo_template_defined (t) repo_template_defined (tree t)
tree t;
{} {}
/* Note where the definition of a class lives to that template /* Note where the definition of a class lives to that template
instantiations can use it. */ instantiations can use it. */
void void
repo_class_defined (t) repo_class_defined (tree t)
tree t;
{} {}
#endif #endif
static tree static tree
repo_get_id (t) repo_get_id (tree t)
tree t;
{ {
if (TYPE_P (t)) if (TYPE_P (t))
{ {
...@@ -119,8 +113,7 @@ repo_get_id (t) ...@@ -119,8 +113,7 @@ repo_get_id (t)
to emit it. */ to emit it. */
void void
repo_template_used (t) repo_template_used (tree t)
tree t;
{ {
tree id; tree id;
...@@ -161,8 +154,7 @@ repo_template_used (t) ...@@ -161,8 +154,7 @@ repo_template_used (t)
/* Note that the vtable for a class has been used, and offer to emit it. */ /* Note that the vtable for a class has been used, and offer to emit it. */
static void static void
repo_vtable_used (t) repo_vtable_used (tree t)
tree t;
{ {
if (! flag_use_repository) if (! flag_use_repository)
return; return;
...@@ -174,8 +166,7 @@ repo_vtable_used (t) ...@@ -174,8 +166,7 @@ repo_vtable_used (t)
emit it. */ emit it. */
void void
repo_inline_used (fn) repo_inline_used (tree fn)
tree fn;
{ {
if (! flag_use_repository) if (! flag_use_repository)
return; return;
...@@ -195,16 +186,13 @@ repo_inline_used (fn) ...@@ -195,16 +186,13 @@ repo_inline_used (fn)
emit it. */ emit it. */
void void
repo_tinfo_used (ti) repo_tinfo_used (tree ti)
tree ti;
{ {
} }
#endif #endif
void void
repo_template_instantiated (t, extern_p) repo_template_instantiated (tree t, bool extern_p)
tree t;
int extern_p;
{ {
if (! extern_p) if (! extern_p)
{ {
...@@ -217,8 +205,7 @@ repo_template_instantiated (t, extern_p) ...@@ -217,8 +205,7 @@ repo_template_instantiated (t, extern_p)
/* Parse a reasonable subset of shell quoting syntax. */ /* Parse a reasonable subset of shell quoting syntax. */
static char * static char *
extract_string (pp) extract_string (char **pp)
char **pp;
{ {
char *p = *pp; char *p = *pp;
int backquote = 0; int backquote = 0;
...@@ -248,8 +235,7 @@ extract_string (pp) ...@@ -248,8 +235,7 @@ extract_string (pp)
} }
const char * const char *
get_base_filename (filename) get_base_filename (const char *filename)
const char *filename;
{ {
char *p = getenv ("COLLECT_GCC_OPTIONS"); char *p = getenv ("COLLECT_GCC_OPTIONS");
char *output = NULL; char *output = NULL;
...@@ -279,8 +265,7 @@ get_base_filename (filename) ...@@ -279,8 +265,7 @@ get_base_filename (filename)
} }
static void static void
open_repo_file (filename) open_repo_file (const char *filename)
const char *filename;
{ {
register const char *p; register const char *p;
const char *s = get_base_filename (filename); const char *s = get_base_filename (filename);
...@@ -301,8 +286,7 @@ open_repo_file (filename) ...@@ -301,8 +286,7 @@ open_repo_file (filename)
} }
static char * static char *
afgets (stream) afgets (FILE *stream)
FILE *stream;
{ {
int c; int c;
while ((c = getc (stream)) != EOF && c != '\n') while ((c = getc (stream)) != EOF && c != '\n')
...@@ -314,8 +298,7 @@ afgets (stream) ...@@ -314,8 +298,7 @@ afgets (stream)
} }
void void
init_repo (filename) init_repo (const char *filename)
const char *filename;
{ {
char *buf; char *buf;
...@@ -367,7 +350,7 @@ init_repo (filename) ...@@ -367,7 +350,7 @@ init_repo (filename)
} }
static void static void
reopen_repo_file_for_write () reopen_repo_file_for_write (void)
{ {
if (repo_file) if (repo_file)
fclose (repo_file); fclose (repo_file);
...@@ -383,13 +366,13 @@ reopen_repo_file_for_write () ...@@ -383,13 +366,13 @@ reopen_repo_file_for_write ()
/* Emit any pending repos. */ /* Emit any pending repos. */
void void
finish_repo () finish_repo (void)
{ {
tree t; tree t;
int repo_changed = 0; bool repo_changed = false;
char *dir, *args; char *dir, *args;
if (! flag_use_repository) if (!flag_use_repository)
return; return;
/* Do we have to write out a new info file? */ /* Do we have to write out a new info file? */
...@@ -399,10 +382,10 @@ finish_repo () ...@@ -399,10 +382,10 @@ finish_repo ()
for (t = original_repo; t; t = TREE_CHAIN (t)) for (t = original_repo; t; t = TREE_CHAIN (t))
{ {
if (! IDENTIFIER_REPO_USED (TREE_VALUE (t)) if (!IDENTIFIER_REPO_USED (TREE_VALUE (t))
|| (! TREE_PURPOSE (t) && IDENTIFIER_REPO_CHOSEN (TREE_VALUE (t)))) || (!TREE_PURPOSE (t) && IDENTIFIER_REPO_CHOSEN (TREE_VALUE (t))))
{ {
repo_changed = 1; repo_changed = true;
break; break;
} }
IDENTIFIER_REPO_USED (TREE_VALUE (t)) = 0; IDENTIFIER_REPO_USED (TREE_VALUE (t)) = 0;
...@@ -410,12 +393,12 @@ finish_repo () ...@@ -410,12 +393,12 @@ finish_repo ()
/* Are there any templates that are newly used? */ /* Are there any templates that are newly used? */
if (! repo_changed) if (!repo_changed)
for (t = pending_repo; t; t = TREE_CHAIN (t)) for (t = pending_repo; t; t = TREE_CHAIN (t))
{ {
if (IDENTIFIER_REPO_USED (TREE_VALUE (t))) if (IDENTIFIER_REPO_USED (TREE_VALUE (t)))
{ {
repo_changed = 1; repo_changed = true;
break; break;
} }
} }
...@@ -423,14 +406,14 @@ finish_repo () ...@@ -423,14 +406,14 @@ finish_repo ()
dir = getpwd (); dir = getpwd ();
args = getenv ("COLLECT_GCC_OPTIONS"); args = getenv ("COLLECT_GCC_OPTIONS");
if (! repo_changed && pending_repo) if (!repo_changed && pending_repo)
if (strcmp (old_main, main_input_filename) != 0 if (strcmp (old_main, main_input_filename) != 0
|| strcmp (old_dir, dir) != 0 || strcmp (old_dir, dir) != 0
|| (args == NULL) != (old_args == NULL) || (args == NULL) != (old_args == NULL)
|| (args && strcmp (old_args, args) != 0)) || (args && strcmp (old_args, args) != 0))
repo_changed = 1; repo_changed = true;
if (! repo_changed || errorcount || sorrycount) if (!repo_changed || errorcount || sorrycount)
goto out; goto out;
reopen_repo_file_for_write (); reopen_repo_file_for_write ();
......
...@@ -83,20 +83,20 @@ static tree get_tinfo_decl_dynamic PARAMS((tree)); ...@@ -83,20 +83,20 @@ static tree get_tinfo_decl_dynamic PARAMS((tree));
static tree get_tinfo_ptr PARAMS((tree)); static tree get_tinfo_ptr PARAMS((tree));
static bool typeid_ok_p PARAMS((void)); static bool typeid_ok_p PARAMS((void));
static int qualifier_flags PARAMS((tree)); static int qualifier_flags PARAMS((tree));
static int target_incomplete_p PARAMS((tree)); static bool target_incomplete_p (tree);
static tree tinfo_base_init PARAMS((tree, tree)); static tree tinfo_base_init PARAMS((tree, tree));
static tree generic_initializer PARAMS((tree, tree)); static tree generic_initializer PARAMS((tree, tree));
static tree ptr_initializer PARAMS((tree, tree, int *)); static tree ptr_initializer (tree, tree, bool *);
static tree ptm_initializer PARAMS((tree, tree, int *)); static tree ptm_initializer (tree, tree, bool *);
static tree dfs_class_hint_mark PARAMS ((tree, void *)); static tree dfs_class_hint_mark PARAMS ((tree, void *));
static tree dfs_class_hint_unmark PARAMS ((tree, void *)); static tree dfs_class_hint_unmark PARAMS ((tree, void *));
static int class_hint_flags PARAMS((tree)); static int class_hint_flags PARAMS((tree));
static tree class_initializer PARAMS((tree, tree, tree)); static tree class_initializer PARAMS((tree, tree, tree));
static tree create_pseudo_type_info PARAMS((const char *, int, ...)); static tree create_pseudo_type_info PARAMS((const char *, int, ...));
static tree get_pseudo_ti_init PARAMS ((tree, tree, int *)); static tree get_pseudo_ti_init PARAMS ((tree, tree, bool *));
static tree get_pseudo_ti_desc PARAMS((tree)); static tree get_pseudo_ti_desc PARAMS((tree));
static void create_tinfo_types PARAMS((void)); static void create_tinfo_types PARAMS((void));
static int typeinfo_in_lib_p PARAMS((tree)); static bool typeinfo_in_lib_p (tree);
static int doing_runtime = 0; static int doing_runtime = 0;
...@@ -108,7 +108,7 @@ static int doing_runtime = 0; ...@@ -108,7 +108,7 @@ static int doing_runtime = 0;
the internal versions of the ABI types. */ the internal versions of the ABI types. */
void void
init_rtti_processing () init_rtti_processing (void)
{ {
tree const_type_info_type; tree const_type_info_type;
...@@ -131,8 +131,7 @@ init_rtti_processing () ...@@ -131,8 +131,7 @@ init_rtti_processing ()
expression. */ expression. */
static tree static tree
build_headof (exp) build_headof (tree exp)
tree exp;
{ {
tree type = TREE_TYPE (exp); tree type = TREE_TYPE (exp);
tree offset; tree offset;
...@@ -163,7 +162,7 @@ build_headof (exp) ...@@ -163,7 +162,7 @@ build_headof (exp)
See libstdc++/exception.cc for __throw_bad_cast */ See libstdc++/exception.cc for __throw_bad_cast */
static tree static tree
throw_bad_cast () throw_bad_cast (void)
{ {
tree fn = get_identifier ("__cxa_bad_cast"); tree fn = get_identifier ("__cxa_bad_cast");
if (IDENTIFIER_GLOBAL_VALUE (fn)) if (IDENTIFIER_GLOBAL_VALUE (fn))
...@@ -176,7 +175,7 @@ throw_bad_cast () ...@@ -176,7 +175,7 @@ throw_bad_cast ()
} }
static tree static tree
throw_bad_typeid () throw_bad_typeid (void)
{ {
tree fn = get_identifier ("__cxa_bad_typeid"); tree fn = get_identifier ("__cxa_bad_typeid");
if (IDENTIFIER_GLOBAL_VALUE (fn)) if (IDENTIFIER_GLOBAL_VALUE (fn))
...@@ -196,8 +195,7 @@ throw_bad_typeid () ...@@ -196,8 +195,7 @@ throw_bad_typeid ()
otherwise return the static type of the expression. */ otherwise return the static type of the expression. */
static tree static tree
get_tinfo_decl_dynamic (exp) get_tinfo_decl_dynamic (tree exp)
tree exp;
{ {
tree type; tree type;
...@@ -238,7 +236,7 @@ get_tinfo_decl_dynamic (exp) ...@@ -238,7 +236,7 @@ get_tinfo_decl_dynamic (exp)
} }
static bool static bool
typeid_ok_p () typeid_ok_p (void)
{ {
if (! flag_rtti) if (! flag_rtti)
{ {
...@@ -256,8 +254,7 @@ typeid_ok_p () ...@@ -256,8 +254,7 @@ typeid_ok_p ()
} }
tree tree
build_typeid (exp) build_typeid (tree exp)
tree exp;
{ {
tree cond = NULL_TREE; tree cond = NULL_TREE;
int nonnull = 0; int nonnull = 0;
...@@ -297,8 +294,7 @@ build_typeid (exp) ...@@ -297,8 +294,7 @@ build_typeid (exp)
/* Generate the NTBS name of a type. */ /* Generate the NTBS name of a type. */
static tree static tree
tinfo_name (type) tinfo_name (tree type)
tree type;
{ {
const char *name; const char *name;
tree name_string; tree name_string;
...@@ -313,8 +309,7 @@ tinfo_name (type) ...@@ -313,8 +309,7 @@ tinfo_name (type)
it --- decls in vtables are only used if the vtable is output. */ it --- decls in vtables are only used if the vtable is output. */
tree tree
get_tinfo_decl (type) get_tinfo_decl (tree type)
tree type;
{ {
tree name; tree name;
tree d; tree d;
...@@ -375,8 +370,7 @@ get_tinfo_decl (type) ...@@ -375,8 +370,7 @@ get_tinfo_decl (type)
cast to the language defined type. */ cast to the language defined type. */
static tree static tree
get_tinfo_ptr (type) get_tinfo_ptr (tree type)
tree type;
{ {
tree exp = get_tinfo_decl (type); tree exp = get_tinfo_decl (type);
...@@ -390,8 +384,7 @@ get_tinfo_ptr (type) ...@@ -390,8 +384,7 @@ get_tinfo_ptr (type)
/* Return the type_info object for TYPE. */ /* Return the type_info object for TYPE. */
tree tree
get_typeid (type) get_typeid (tree type)
tree type;
{ {
if (type == error_mark_node || !typeid_ok_p ()) if (type == error_mark_node || !typeid_ok_p ())
return error_mark_node; return error_mark_node;
...@@ -422,8 +415,7 @@ get_typeid (type) ...@@ -422,8 +415,7 @@ get_typeid (type)
RESULT, it must have previously had a save_expr applied to it. */ RESULT, it must have previously had a save_expr applied to it. */
static tree static tree
ifnonnull (test, result) ifnonnull (tree test, tree result)
tree test, result;
{ {
return build (COND_EXPR, TREE_TYPE (result), return build (COND_EXPR, TREE_TYPE (result),
build (EQ_EXPR, boolean_type_node, test, integer_zero_node), build (EQ_EXPR, boolean_type_node, test, integer_zero_node),
...@@ -435,8 +427,7 @@ ifnonnull (test, result) ...@@ -435,8 +427,7 @@ ifnonnull (test, result)
paper. */ paper. */
static tree static tree
build_dynamic_cast_1 (type, expr) build_dynamic_cast_1 (tree type, tree expr)
tree type, expr;
{ {
enum tree_code tc = TREE_CODE (type); enum tree_code tc = TREE_CODE (type);
tree exprtype = TREE_TYPE (expr); tree exprtype = TREE_TYPE (expr);
...@@ -683,8 +674,7 @@ build_dynamic_cast_1 (type, expr) ...@@ -683,8 +674,7 @@ build_dynamic_cast_1 (type, expr)
} }
tree tree
build_dynamic_cast (type, expr) build_dynamic_cast (tree type, tree expr)
tree type, expr;
{ {
if (type == error_mark_node || expr == error_mark_node) if (type == error_mark_node || expr == error_mark_node)
return error_mark_node; return error_mark_node;
...@@ -698,8 +688,7 @@ build_dynamic_cast (type, expr) ...@@ -698,8 +688,7 @@ build_dynamic_cast (type, expr)
/* Return the runtime bit mask encoding the qualifiers of TYPE. */ /* Return the runtime bit mask encoding the qualifiers of TYPE. */
static int static int
qualifier_flags (type) qualifier_flags (tree type)
tree type;
{ {
int flags = 0; int flags = 0;
int quals = cp_type_quals (type); int quals = cp_type_quals (type);
...@@ -713,26 +702,25 @@ qualifier_flags (type) ...@@ -713,26 +702,25 @@ qualifier_flags (type)
return flags; return flags;
} }
/* Return nonzero, if the pointer chain TYPE ends at an incomplete type, or /* Return true, if the pointer chain TYPE ends at an incomplete type, or
contains a pointer to member of an incomplete class. */ contains a pointer to member of an incomplete class. */
static int static bool
target_incomplete_p (type) target_incomplete_p (tree type)
tree type;
{ {
while (TREE_CODE (type) == POINTER_TYPE) while (TREE_CODE (type) == POINTER_TYPE)
if (TYPE_PTRMEM_P (type)) if (TYPE_PTRMEM_P (type))
{ {
if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type))) if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
return 1; return true;
type = TYPE_PTRMEM_POINTED_TO_TYPE (type); type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
} }
else else
type = TREE_TYPE (type); type = TREE_TYPE (type);
if (!COMPLETE_OR_VOID_TYPE_P (type)) if (!COMPLETE_OR_VOID_TYPE_P (type))
return 1; return true;
return 0; return false;
} }
/* Return a CONSTRUCTOR for the common part of the type_info objects. This /* Return a CONSTRUCTOR for the common part of the type_info objects. This
...@@ -742,9 +730,7 @@ target_incomplete_p (type) ...@@ -742,9 +730,7 @@ target_incomplete_p (type)
as comdat, because of pointers to incomplete.) */ as comdat, because of pointers to incomplete.) */
static tree static tree
tinfo_base_init (desc, target) tinfo_base_init (tree desc, tree target)
tree desc;
tree target;
{ {
tree init = NULL_TREE; tree init = NULL_TREE;
tree name_decl; tree name_decl;
...@@ -826,9 +812,7 @@ tinfo_base_init (desc, target) ...@@ -826,9 +812,7 @@ tinfo_base_init (desc, target)
additional fields to the type_info base. */ additional fields to the type_info base. */
static tree static tree
generic_initializer (desc, target) generic_initializer (tree desc, tree target)
tree desc;
tree target;
{ {
tree init = tinfo_base_init (desc, target); tree init = tinfo_base_init (desc, target);
...@@ -842,20 +826,17 @@ generic_initializer (desc, target) ...@@ -842,20 +826,17 @@ generic_initializer (desc, target)
which adds target type and qualifier flags members to the type_info base. */ which adds target type and qualifier flags members to the type_info base. */
static tree static tree
ptr_initializer (desc, target, non_public_ptr) ptr_initializer (tree desc, tree target, bool *non_public_ptr)
tree desc;
tree target;
int *non_public_ptr;
{ {
tree init = tinfo_base_init (desc, target); tree init = tinfo_base_init (desc, target);
tree to = TREE_TYPE (target); tree to = TREE_TYPE (target);
int flags = qualifier_flags (to); int flags = qualifier_flags (to);
int incomplete = target_incomplete_p (to); bool incomplete = target_incomplete_p (to);
if (incomplete) if (incomplete)
{ {
flags |= 8; flags |= 8;
*non_public_ptr = 1; *non_public_ptr = true;
} }
init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init); init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
init = tree_cons (NULL_TREE, init = tree_cons (NULL_TREE,
...@@ -873,26 +854,23 @@ ptr_initializer (desc, target, non_public_ptr) ...@@ -873,26 +854,23 @@ ptr_initializer (desc, target, non_public_ptr)
base. */ base. */
static tree static tree
ptm_initializer (desc, target, non_public_ptr) ptm_initializer (tree desc, tree target, bool *non_public_ptr)
tree desc;
tree target;
int *non_public_ptr;
{ {
tree init = tinfo_base_init (desc, target); tree init = tinfo_base_init (desc, target);
tree to = TYPE_PTRMEM_POINTED_TO_TYPE (target); tree to = TYPE_PTRMEM_POINTED_TO_TYPE (target);
tree klass = TYPE_PTRMEM_CLASS_TYPE (target); tree klass = TYPE_PTRMEM_CLASS_TYPE (target);
int flags = qualifier_flags (to); int flags = qualifier_flags (to);
int incomplete = target_incomplete_p (to); bool incomplete = target_incomplete_p (to);
if (incomplete) if (incomplete)
{ {
flags |= 0x8; flags |= 0x8;
*non_public_ptr = 1; *non_public_ptr = true;
} }
if (!COMPLETE_TYPE_P (klass)) if (!COMPLETE_TYPE_P (klass))
{ {
flags |= 0x10; flags |= 0x10;
*non_public_ptr = 1; *non_public_ptr = true;
} }
init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init); init = tree_cons (NULL_TREE, build_int_2 (flags, 0), init);
init = tree_cons (NULL_TREE, init = tree_cons (NULL_TREE,
...@@ -913,9 +891,7 @@ ptm_initializer (desc, target, non_public_ptr) ...@@ -913,9 +891,7 @@ ptm_initializer (desc, target, non_public_ptr)
possible for a type to be both a virtual and non-virtual base. */ possible for a type to be both a virtual and non-virtual base. */
static tree static tree
dfs_class_hint_mark (binfo, data) dfs_class_hint_mark (tree binfo, void *data)
tree binfo;
void *data;
{ {
tree basetype = BINFO_TYPE (binfo); tree basetype = BINFO_TYPE (binfo);
int *hint = (int *) data; int *hint = (int *) data;
...@@ -942,9 +918,7 @@ dfs_class_hint_mark (binfo, data) ...@@ -942,9 +918,7 @@ dfs_class_hint_mark (binfo, data)
/* Clear the base's dfs marks, after searching for duplicate bases. */ /* Clear the base's dfs marks, after searching for duplicate bases. */
static tree static tree
dfs_class_hint_unmark (binfo, data) dfs_class_hint_unmark (tree binfo, void *data ATTRIBUTE_UNUSED)
tree binfo;
void *data ATTRIBUTE_UNUSED;
{ {
tree basetype = BINFO_TYPE (binfo); tree basetype = BINFO_TYPE (binfo);
...@@ -956,8 +930,7 @@ dfs_class_hint_unmark (binfo, data) ...@@ -956,8 +930,7 @@ dfs_class_hint_unmark (binfo, data)
/* Determine the hint flags describing the features of a class's hierarchy. */ /* Determine the hint flags describing the features of a class's hierarchy. */
static int static int
class_hint_flags (type) class_hint_flags (tree type)
tree type;
{ {
int hint_flags = 0; int hint_flags = 0;
int i; int i;
...@@ -980,10 +953,7 @@ class_hint_flags (type) ...@@ -980,10 +953,7 @@ class_hint_flags (type)
which adds hint flags and TRAIL initializers to the type_info base. */ which adds hint flags and TRAIL initializers to the type_info base. */
static tree static tree
class_initializer (desc, target, trail) class_initializer (tree desc, tree target, tree trail)
tree desc;
tree target;
tree trail;
{ {
tree init = tinfo_base_init (desc, target); tree init = tinfo_base_init (desc, target);
...@@ -993,12 +963,11 @@ class_initializer (desc, target, trail) ...@@ -993,12 +963,11 @@ class_initializer (desc, target, trail)
return init; return init;
} }
/* Returns nonzero if the typeinfo for type should be placed in /* Returns true if the typeinfo for type should be placed in
the runtime library. */ the runtime library. */
static int static bool
typeinfo_in_lib_p (type) typeinfo_in_lib_p (tree type)
tree type;
{ {
/* The typeinfo objects for `T*' and `const T*' are in the runtime /* The typeinfo objects for `T*' and `const T*' are in the runtime
library for simple types T. */ library for simple types T. */
...@@ -1014,10 +983,10 @@ typeinfo_in_lib_p (type) ...@@ -1014,10 +983,10 @@ typeinfo_in_lib_p (type)
case CHAR_TYPE: case CHAR_TYPE:
case REAL_TYPE: case REAL_TYPE:
case VOID_TYPE: case VOID_TYPE:
return 1; return true;
default: default:
return 0; return false;
} }
} }
...@@ -1028,10 +997,7 @@ typeinfo_in_lib_p (type) ...@@ -1028,10 +997,7 @@ typeinfo_in_lib_p (type)
types will be completed. */ types will be completed. */
static tree static tree
get_pseudo_ti_init (type, var_desc, non_public_p) get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
tree type;
tree var_desc;
int *non_public_p;
{ {
my_friendly_assert (at_eof, 20021120); my_friendly_assert (at_eof, 20021120);
switch (TREE_CODE (type)) switch (TREE_CODE (type))
...@@ -1059,7 +1025,7 @@ get_pseudo_ti_init (type, var_desc, non_public_p) ...@@ -1059,7 +1025,7 @@ get_pseudo_ti_init (type, var_desc, non_public_p)
{ {
if (!COMPLETE_TYPE_P (type)) if (!COMPLETE_TYPE_P (type))
/* Emit a non-public class_type_info. */ /* Emit a non-public class_type_info. */
*non_public_p = 1; *non_public_p = true;
return class_initializer (var_desc, type, NULL_TREE); return class_initializer (var_desc, type, NULL_TREE);
} }
else if (var_desc == si_class_desc_type_node) else if (var_desc == si_class_desc_type_node)
...@@ -1151,7 +1117,7 @@ get_pseudo_ti_init (type, var_desc, non_public_p) ...@@ -1151,7 +1117,7 @@ get_pseudo_ti_init (type, var_desc, non_public_p)
NULL. */ NULL. */
static tree static tree
create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...)) create_pseudo_type_info (const char *real_name, int ident, ...)
{ {
tree pseudo_type; tree pseudo_type;
char *pseudo_name; char *pseudo_name;
...@@ -1199,8 +1165,7 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...)) ...@@ -1199,8 +1165,7 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
translation unit. */ translation unit. */
static tree static tree
get_pseudo_ti_desc (type) get_pseudo_ti_desc (tree type)
tree type;
{ {
switch (TREE_CODE (type)) switch (TREE_CODE (type))
{ {
...@@ -1283,7 +1248,7 @@ get_pseudo_ti_desc (type) ...@@ -1283,7 +1248,7 @@ get_pseudo_ti_desc (type)
varable definitions. */ varable definitions. */
static void static void
create_tinfo_types () create_tinfo_types (void)
{ {
my_friendly_assert (!ti_desc_type_node, 20020609); my_friendly_assert (!ti_desc_type_node, 20020609);
...@@ -1385,7 +1350,7 @@ create_tinfo_types () ...@@ -1385,7 +1350,7 @@ create_tinfo_types ()
destructor is defined, then the runtime is being built. */ destructor is defined, then the runtime is being built. */
void void
emit_support_tinfos () emit_support_tinfos (void)
{ {
static tree *const fundamentals[] = static tree *const fundamentals[] =
{ {
...@@ -1437,13 +1402,11 @@ emit_support_tinfos () ...@@ -1437,13 +1402,11 @@ emit_support_tinfos ()
} }
} }
/* Return nonzero, iff T is a type_info variable which has not had a /* Return true, iff T is a type_info variable which has not had a
definition emitted for it. */ definition emitted for it. */
int bool
unemitted_tinfo_decl_p (t, data) unemitted_tinfo_decl_p (tree t, void *data ATTRIBUTE_UNUSED)
tree t;
void *data ATTRIBUTE_UNUSED;
{ {
if (/* It's a var decl */ if (/* It's a var decl */
TREE_CODE (t) == VAR_DECL TREE_CODE (t) == VAR_DECL
...@@ -1459,33 +1422,31 @@ unemitted_tinfo_decl_p (t, data) ...@@ -1459,33 +1422,31 @@ unemitted_tinfo_decl_p (t, data)
&& TYPE_FIELDS (TREE_TYPE (t)) && TYPE_FIELDS (TREE_TYPE (t))
/* which is our pseudo type info */ /* which is our pseudo type info */
&& TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node) && TREE_TYPE (TYPE_FIELDS (TREE_TYPE (t))) == ti_desc_type_node)
return 1; return true;
return 0; return false;
} }
/* Finish a type info decl. DECL_PTR is a pointer to an unemitted /* Finish a type info decl. DECL_PTR is a pointer to an unemitted
tinfo decl. Determine whether it needs emitting, and if so tinfo decl. Determine whether it needs emitting, and if so
generate the initializer. */ generate the initializer. */
int bool
emit_tinfo_decl (decl_ptr, data) emit_tinfo_decl (tree *decl_ptr, void *data ATTRIBUTE_UNUSED)
tree *decl_ptr;
void *data ATTRIBUTE_UNUSED;
{ {
tree decl = *decl_ptr; tree decl = *decl_ptr;
tree type = TREE_TYPE (DECL_NAME (decl)); tree type = TREE_TYPE (DECL_NAME (decl));
int non_public; bool non_public;
int in_library = typeinfo_in_lib_p (type); int in_library = typeinfo_in_lib_p (type);
tree var_desc, var_init; tree var_desc, var_init;
import_export_tinfo (decl, type, in_library); import_export_tinfo (decl, type, in_library);
if (DECL_REALLY_EXTERN (decl) || !DECL_NEEDED_P (decl)) if (DECL_REALLY_EXTERN (decl) || !DECL_NEEDED_P (decl))
return 0; return false;
if (!doing_runtime && in_library) if (!doing_runtime && in_library)
return 0; return false;
non_public = 0; non_public = false;
var_desc = get_pseudo_ti_desc (type); var_desc = get_pseudo_ti_desc (type);
var_init = get_pseudo_ti_init (type, var_desc, &non_public); var_init = get_pseudo_ti_init (type, var_desc, &non_public);
...@@ -1501,5 +1462,5 @@ emit_tinfo_decl (decl_ptr, data) ...@@ -1501,5 +1462,5 @@ emit_tinfo_decl (decl_ptr, data)
/* Say we've dealt with it. */ /* Say we've dealt with it. */
TREE_TYPE (DECL_NAME (decl)) = NULL_TREE; TREE_TYPE (DECL_NAME (decl)) = NULL_TREE;
return 1; return true;
} }
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