Commit 2f6e4e97 by Andreas Jaeger Committed by Andreas Jaeger

c-lex.c: Convert to ISO C90.


	* c-lex.c: Convert to ISO C90.
	* c-objc-common.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-ppoutput.c: Likewise.
	* c-pragma.h: Likewise.
	* c-pretty-print.c: Likewise.
	* c-pretty-print.h: Likewise.
	* c-semantics.c: Likewise.
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.

From-SVN: r68327
parent 3346b668
2003-06-22 Andreas Jaeger <aj@suse.de> 2003-06-22 Andreas Jaeger <aj@suse.de>
* c-lex.c: Convert to ISO C90.
* c-objc-common.c: Likewise.
* c-opts.c: Likewise.
* c-pch.c: Likewise.
* c-ppoutput.c: Likewise.
* c-pragma.h: Likewise.
* c-pretty-print.c: Likewise.
* c-pretty-print.h: Likewise.
* c-semantics.c: Likewise.
* c-tree.h: Likewise.
* c-typeck.c: Likewise.
* c-lang.c: Convert to ISO C90. * c-lang.c: Convert to ISO C90.
2003-06-22 Neil Booth <neil@daikokuya.co.uk> 2003-06-22 Neil Booth <neil@daikokuya.co.uk>
......
...@@ -64,27 +64,24 @@ int c_header_level; /* depth in C headers - C++ only */ ...@@ -64,27 +64,24 @@ int c_header_level; /* depth in C headers - C++ only */
/* Nonzero tells yylex to ignore \ in string constants. */ /* Nonzero tells yylex to ignore \ in string constants. */
static int ignore_escape_flag; static int ignore_escape_flag;
static tree interpret_integer PARAMS ((const cpp_token *, unsigned int)); static tree interpret_integer (const cpp_token *, unsigned int);
static tree interpret_float PARAMS ((const cpp_token *, unsigned int)); static tree interpret_float (const cpp_token *, unsigned int);
static enum integer_type_kind static enum integer_type_kind
narrowest_unsigned_type PARAMS ((tree, unsigned int)); narrowest_unsigned_type (tree, unsigned int);
static enum integer_type_kind static enum integer_type_kind
narrowest_signed_type PARAMS ((tree, unsigned int)); narrowest_signed_type (tree, unsigned int);
static tree lex_string PARAMS ((const cpp_string *)); static tree lex_string (const cpp_string *);
static tree lex_charconst PARAMS ((const cpp_token *)); static tree lex_charconst (const cpp_token *);
static void update_header_times PARAMS ((const char *)); static void update_header_times (const char *);
static int dump_one_header PARAMS ((splay_tree_node, void *)); static int dump_one_header (splay_tree_node, void *);
static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int)); static void cb_line_change (cpp_reader *, const cpp_token *, int);
static void cb_ident PARAMS ((cpp_reader *, unsigned int, static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
const cpp_string *)); static void cb_def_pragma (cpp_reader *, unsigned int);
static void cb_def_pragma PARAMS ((cpp_reader *, unsigned int)); static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_define PARAMS ((cpp_reader *, unsigned int, static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
cpp_hashnode *));
static void cb_undef PARAMS ((cpp_reader *, unsigned int,
cpp_hashnode *));
void void
init_c_lex () init_c_lex (void)
{ {
struct cpp_callbacks *cb; struct cpp_callbacks *cb;
struct c_fileinfo *toplevel; struct c_fileinfo *toplevel;
...@@ -100,7 +97,7 @@ init_c_lex () ...@@ -100,7 +97,7 @@ init_c_lex ()
body_time = get_run_time (); body_time = get_run_time ();
toplevel->time = body_time; toplevel->time = body_time;
} }
cb = cpp_get_callbacks (parse_in); cb = cpp_get_callbacks (parse_in);
cb->line_change = cb_line_change; cb->line_change = cb_line_change;
...@@ -120,8 +117,7 @@ init_c_lex () ...@@ -120,8 +117,7 @@ init_c_lex ()
} }
struct c_fileinfo * struct c_fileinfo *
get_fileinfo (name) get_fileinfo (const char *name)
const char *name;
{ {
splay_tree_node n; splay_tree_node n;
struct c_fileinfo *fi; struct c_fileinfo *fi;
...@@ -140,8 +136,7 @@ get_fileinfo (name) ...@@ -140,8 +136,7 @@ get_fileinfo (name)
} }
static void static void
update_header_times (name) update_header_times (const char *name)
const char *name;
{ {
/* Changing files again. This means currently collected time /* Changing files again. This means currently collected time
is charged against header time, and body time starts back at 0. */ is charged against header time, and body time starts back at 0. */
...@@ -156,9 +151,7 @@ update_header_times (name) ...@@ -156,9 +151,7 @@ update_header_times (name)
} }
static int static int
dump_one_header (n, dummy) dump_one_header (splay_tree_node n, void *dummy ATTRIBUTE_UNUSED)
splay_tree_node n;
void *dummy ATTRIBUTE_UNUSED;
{ {
print_time ((const char *) n->key, print_time ((const char *) n->key,
((struct c_fileinfo *) n->value)->time); ((struct c_fileinfo *) n->value)->time);
...@@ -166,7 +159,7 @@ dump_one_header (n, dummy) ...@@ -166,7 +159,7 @@ dump_one_header (n, dummy)
} }
void void
dump_time_statistics () dump_time_statistics (void)
{ {
struct c_fileinfo *file = get_fileinfo (input_filename); struct c_fileinfo *file = get_fileinfo (input_filename);
int this_time = get_run_time (); int this_time = get_run_time ();
...@@ -183,10 +176,9 @@ dump_time_statistics () ...@@ -183,10 +176,9 @@ dump_time_statistics ()
} }
static void static void
cb_ident (pfile, line, str) cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED,
cpp_reader *pfile ATTRIBUTE_UNUSED; unsigned int line ATTRIBUTE_UNUSED,
unsigned int line ATTRIBUTE_UNUSED; const cpp_string *str ATTRIBUTE_UNUSED)
const cpp_string *str ATTRIBUTE_UNUSED;
{ {
#ifdef ASM_OUTPUT_IDENT #ifdef ASM_OUTPUT_IDENT
if (! flag_no_ident) if (! flag_no_ident)
...@@ -201,17 +193,14 @@ cb_ident (pfile, line, str) ...@@ -201,17 +193,14 @@ cb_ident (pfile, line, str)
/* Called at the start of every non-empty line. TOKEN is the first /* Called at the start of every non-empty line. TOKEN is the first
lexed token on the line. Used for diagnostic line numbers. */ lexed token on the line. Used for diagnostic line numbers. */
static void static void
cb_line_change (pfile, token, parsing_args) cb_line_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const cpp_token *token,
cpp_reader *pfile ATTRIBUTE_UNUSED; int parsing_args ATTRIBUTE_UNUSED)
const cpp_token *token;
int parsing_args ATTRIBUTE_UNUSED;
{ {
src_lineno = SOURCE_LINE (map, token->line); src_lineno = SOURCE_LINE (map, token->line);
} }
void void
fe_file_change (new_map) fe_file_change (const struct line_map *new_map)
const struct line_map *new_map;
{ {
unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line); unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line);
...@@ -250,7 +239,7 @@ fe_file_change (new_map) ...@@ -250,7 +239,7 @@ fe_file_change (new_map)
} }
#endif #endif
pop_srcloc (); pop_srcloc ();
(*debug_hooks->end_source_file) (to_line); (*debug_hooks->end_source_file) (to_line);
} }
...@@ -265,9 +254,7 @@ fe_file_change (new_map) ...@@ -265,9 +254,7 @@ fe_file_change (new_map)
} }
static void static void
cb_def_pragma (pfile, line) cb_def_pragma (cpp_reader *pfile, unsigned int line)
cpp_reader *pfile;
unsigned int line;
{ {
/* Issue a warning message if we have been asked to do so. Ignore /* Issue a warning message if we have been asked to do so. Ignore
unknown pragmas in system headers unless an explicit unknown pragmas in system headers unless an explicit
...@@ -294,10 +281,7 @@ cb_def_pragma (pfile, line) ...@@ -294,10 +281,7 @@ cb_def_pragma (pfile, line)
/* #define callback for DWARF and DWARF2 debug info. */ /* #define callback for DWARF and DWARF2 debug info. */
static void static void
cb_define (pfile, line, node) cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
cpp_reader *pfile;
unsigned int line;
cpp_hashnode *node;
{ {
(*debug_hooks->define) (SOURCE_LINE (map, line), (*debug_hooks->define) (SOURCE_LINE (map, line),
(const char *) cpp_macro_definition (pfile, node)); (const char *) cpp_macro_definition (pfile, node));
...@@ -305,18 +289,15 @@ cb_define (pfile, line, node) ...@@ -305,18 +289,15 @@ cb_define (pfile, line, node)
/* #undef callback for DWARF and DWARF2 debug info. */ /* #undef callback for DWARF and DWARF2 debug info. */
static void static void
cb_undef (pfile, line, node) cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; cpp_hashnode *node)
unsigned int line;
cpp_hashnode *node;
{ {
(*debug_hooks->undef) (SOURCE_LINE (map, line), (*debug_hooks->undef) (SOURCE_LINE (map, line),
(const char *) NODE_NAME (node)); (const char *) NODE_NAME (node));
} }
int int
c_lex (value) c_lex (tree *value)
tree *value;
{ {
const cpp_token *tok; const cpp_token *tok;
...@@ -403,9 +384,7 @@ c_lex (value) ...@@ -403,9 +384,7 @@ c_lex (value)
minimum specified by FLAGS, that can fit VALUE, or itk_none if minimum specified by FLAGS, that can fit VALUE, or itk_none if
there isn't one. */ there isn't one. */
static enum integer_type_kind static enum integer_type_kind
narrowest_unsigned_type (value, flags) narrowest_unsigned_type (tree value, unsigned int flags)
tree value;
unsigned int flags;
{ {
enum integer_type_kind itk; enum integer_type_kind itk;
...@@ -429,9 +408,7 @@ narrowest_unsigned_type (value, flags) ...@@ -429,9 +408,7 @@ narrowest_unsigned_type (value, flags)
/* Ditto, but narrowest signed type. */ /* Ditto, but narrowest signed type. */
static enum integer_type_kind static enum integer_type_kind
narrowest_signed_type (value, flags) narrowest_signed_type (tree value, unsigned int flags)
tree value;
unsigned int flags;
{ {
enum integer_type_kind itk; enum integer_type_kind itk;
...@@ -455,9 +432,7 @@ narrowest_signed_type (value, flags) ...@@ -455,9 +432,7 @@ narrowest_signed_type (value, flags)
/* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */ /* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */
static tree static tree
interpret_integer (token, flags) interpret_integer (const cpp_token *token, unsigned int flags)
const cpp_token *token;
unsigned int flags;
{ {
tree value, type; tree value, type;
enum integer_type_kind itk; enum integer_type_kind itk;
...@@ -535,9 +510,7 @@ interpret_integer (token, flags) ...@@ -535,9 +510,7 @@ interpret_integer (token, flags)
/* Interpret TOKEN, a floating point number with FLAGS as classified /* Interpret TOKEN, a floating point number with FLAGS as classified
by cpplib. */ by cpplib. */
static tree static tree
interpret_float (token, flags) interpret_float (const cpp_token *token, unsigned int flags)
const cpp_token *token;
unsigned int flags;
{ {
tree type; tree type;
tree value; tree value;
...@@ -599,15 +572,14 @@ interpret_float (token, flags) ...@@ -599,15 +572,14 @@ interpret_float (token, flags)
} }
static tree static tree
lex_string (str) lex_string (const cpp_string *str)
const cpp_string *str;
{ {
bool wide; bool wide;
tree value; tree value;
char *buf, *q; char *buf, *q;
cppchar_t c; cppchar_t c;
const unsigned char *p, *limit; const unsigned char *p, *limit;
wide = str->text[0] == 'L'; wide = str->text[0] == 'L';
p = str->text + 1 + wide; p = str->text + 1 + wide;
limit = str->text + str->len - 1; limit = str->text + str->len - 1;
...@@ -619,7 +591,7 @@ lex_string (str) ...@@ -619,7 +591,7 @@ lex_string (str)
if (c == '\\' && !ignore_escape_flag) if (c == '\\' && !ignore_escape_flag)
c = cpp_parse_escape (parse_in, &p, limit, wide); c = cpp_parse_escape (parse_in, &p, limit, wide);
/* Add this single character into the buffer either as a wchar_t, /* Add this single character into the buffer either as a wchar_t,
a multibyte sequence, or as a single byte. */ a multibyte sequence, or as a single byte. */
if (wide) if (wide)
...@@ -672,8 +644,7 @@ lex_string (str) ...@@ -672,8 +644,7 @@ lex_string (str)
/* Converts a (possibly wide) character constant token into a tree. */ /* Converts a (possibly wide) character constant token into a tree. */
static tree static tree
lex_charconst (token) lex_charconst (const cpp_token *token)
const cpp_token *token;
{ {
cppchar_t result; cppchar_t result;
tree type, value; tree type, value;
...@@ -681,7 +652,7 @@ lex_charconst (token) ...@@ -681,7 +652,7 @@ lex_charconst (token)
int unsignedp; int unsignedp;
result = cpp_interpret_charconst (parse_in, token, result = cpp_interpret_charconst (parse_in, token,
&chars_seen, &unsignedp); &chars_seen, &unsignedp);
/* Cast to cppchar_signed_t to get correct sign-extension of RESULT /* Cast to cppchar_signed_t to get correct sign-extension of RESULT
before possibly widening to HOST_WIDE_INT for build_int_2. */ before possibly widening to HOST_WIDE_INT for build_int_2. */
......
/* Some code common to C and ObjC front ends. /* Some code common to C and ObjC front ends.
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -39,17 +39,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -39,17 +39,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "target.h" #include "target.h"
#include "cgraph.h" #include "cgraph.h"
static bool c_tree_printer PARAMS ((output_buffer *, text_info *)); static bool c_tree_printer (output_buffer *, text_info *);
static tree inline_forbidden_p PARAMS ((tree *, int *, void *)); static tree inline_forbidden_p (tree *, int *, void *);
static void expand_deferred_fns PARAMS ((void)); static void expand_deferred_fns (void);
static tree start_cdtor PARAMS ((int)); static tree start_cdtor (int);
static void finish_cdtor PARAMS ((tree)); static void finish_cdtor (tree);
static GTY(()) varray_type deferred_fns; static GTY(()) varray_type deferred_fns;
int int
c_missing_noreturn_ok_p (decl) c_missing_noreturn_ok_p (tree decl)
tree decl;
{ {
/* A missing noreturn is not ok for freestanding implementations and /* A missing noreturn is not ok for freestanding implementations and
ok for the `main' function in hosted implementations. */ ok for the `main' function in hosted implementations. */
...@@ -61,8 +60,7 @@ c_missing_noreturn_ok_p (decl) ...@@ -61,8 +60,7 @@ c_missing_noreturn_ok_p (decl)
such functions always being inlined when optimizing. */ such functions always being inlined when optimizing. */
int int
c_disregard_inline_limits (fn) c_disregard_inline_limits (tree fn)
tree fn;
{ {
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL) if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
return 1; return 1;
...@@ -71,10 +69,8 @@ c_disregard_inline_limits (fn) ...@@ -71,10 +69,8 @@ c_disregard_inline_limits (fn)
} }
static tree static tree
inline_forbidden_p (nodep, walk_subtrees, fn) inline_forbidden_p (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
tree *nodep; void *fn)
int *walk_subtrees ATTRIBUTE_UNUSED;
void *fn;
{ {
tree node = *nodep; tree node = *nodep;
tree t; tree t;
...@@ -160,8 +156,7 @@ inline_forbidden_p (nodep, walk_subtrees, fn) ...@@ -160,8 +156,7 @@ inline_forbidden_p (nodep, walk_subtrees, fn)
} }
int int
c_cannot_inline_tree_fn (fnp) c_cannot_inline_tree_fn (tree *fnp)
tree *fnp;
{ {
tree fn = *fnp; tree fn = *fnp;
tree t; tree t;
...@@ -170,7 +165,7 @@ c_cannot_inline_tree_fn (fnp) ...@@ -170,7 +165,7 @@ c_cannot_inline_tree_fn (fnp)
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
return 1; return 1;
/* Don't auto-inline anything that might not be bound within /* Don't auto-inline anything that might not be bound within
this unit of translation. */ this unit of translation. */
if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn)) if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn))
goto cannot_inline; goto cannot_inline;
...@@ -215,7 +210,7 @@ c_cannot_inline_tree_fn (fnp) ...@@ -215,7 +210,7 @@ c_cannot_inline_tree_fn (fnp)
if (! t) if (! t)
return 0; return 0;
} }
if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL)) if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
goto cannot_inline; goto cannot_inline;
...@@ -229,8 +224,7 @@ c_cannot_inline_tree_fn (fnp) ...@@ -229,8 +224,7 @@ c_cannot_inline_tree_fn (fnp)
/* Called from check_global_declarations. */ /* Called from check_global_declarations. */
bool bool
c_warn_unused_global_decl (decl) c_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;
...@@ -242,7 +236,7 @@ c_warn_unused_global_decl (decl) ...@@ -242,7 +236,7 @@ c_warn_unused_global_decl (decl)
/* Initialization common to C and Objective-C front ends. */ /* Initialization common to C and Objective-C front ends. */
bool bool
c_objc_common_init () c_objc_common_init (void)
{ {
static const enum tree_code stmt_codes[] = { static const enum tree_code stmt_codes[] = {
c_common_stmt_codes c_common_stmt_codes
...@@ -282,8 +276,7 @@ c_objc_common_init () ...@@ -282,8 +276,7 @@ c_objc_common_init ()
to RTL is only done at the end of the compilation. */ to RTL is only done at the end of the compilation. */
int int
defer_fn (fn) defer_fn (tree fn)
tree fn;
{ {
VARRAY_PUSH_TREE (deferred_fns, fn); VARRAY_PUSH_TREE (deferred_fns, fn);
...@@ -293,7 +286,7 @@ defer_fn (fn) ...@@ -293,7 +286,7 @@ defer_fn (fn)
/* Expand deferred functions for C and ObjC. */ /* Expand deferred functions for C and ObjC. */
static void static void
expand_deferred_fns () expand_deferred_fns (void)
{ {
unsigned int i; unsigned int i;
...@@ -315,8 +308,7 @@ expand_deferred_fns () ...@@ -315,8 +308,7 @@ expand_deferred_fns ()
} }
static tree static tree
start_cdtor (method_type) start_cdtor (int method_type)
int method_type;
{ {
tree fnname = get_file_function_name (method_type); tree fnname = get_file_function_name (method_type);
tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node); tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node);
...@@ -342,8 +334,7 @@ start_cdtor (method_type) ...@@ -342,8 +334,7 @@ start_cdtor (method_type)
} }
static void static void
finish_cdtor (body) finish_cdtor (tree body)
tree body;
{ {
tree scope; tree scope;
tree block; tree block;
...@@ -361,7 +352,7 @@ finish_cdtor (body) ...@@ -361,7 +352,7 @@ finish_cdtor (body)
/* Called at end of parsing, but before end-of-file processing. */ /* Called at end of parsing, but before end-of-file processing. */
void void
c_objc_common_finish_file () c_objc_common_finish_file (void)
{ {
if (pch_file) if (pch_file)
c_common_write_pch (); c_common_write_pch ();
...@@ -420,9 +411,7 @@ c_objc_common_finish_file () ...@@ -420,9 +411,7 @@ c_objc_common_finish_file ()
Please notice when called, the `%' part was already skipped by the Please notice when called, the `%' part was already skipped by the
diagnostic machinery. */ diagnostic machinery. */
static bool static bool
c_tree_printer (buffer, text) c_tree_printer (output_buffer *buffer, text_info *text)
output_buffer *buffer;
text_info *text;
{ {
tree t = va_arg (*text->args_ptr, tree); tree t = va_arg (*text->args_ptr, tree);
......
...@@ -100,22 +100,22 @@ static size_t deferred_count, deferred_size; ...@@ -100,22 +100,22 @@ static size_t deferred_count, deferred_size;
/* Number of deferred options scanned for -include. */ /* Number of deferred options scanned for -include. */
static size_t include_cursor; static size_t include_cursor;
static void missing_arg PARAMS ((enum opt_code)); static void missing_arg (enum opt_code);
static void set_Wimplicit PARAMS ((int)); static void set_Wimplicit (int);
static void complain_wrong_lang PARAMS ((size_t, int)); static void complain_wrong_lang (size_t, int);
static void write_langs PARAMS ((char *, int)); static void write_langs (char *, int);
static void print_help PARAMS ((void)); static void print_help (void);
static void handle_OPT_d PARAMS ((const char *)); static void handle_OPT_d (const char *);
static void set_std_cxx98 PARAMS ((int)); static void set_std_cxx98 (int);
static void set_std_c89 PARAMS ((int, int)); static void set_std_c89 (int, int);
static void set_std_c99 PARAMS ((int)); static void set_std_c99 (int);
static void check_deps_environment_vars PARAMS ((void)); static void check_deps_environment_vars (void);
static void handle_deferred_opts PARAMS ((void)); static void handle_deferred_opts (void);
static void sanitize_cpp_opts PARAMS ((void)); static void sanitize_cpp_opts (void);
static void add_prefixed_path PARAMS ((const char *, size_t)); static void add_prefixed_path (const char *, size_t);
static void push_command_line_include PARAMS ((void)); static void push_command_line_include (void);
static void cb_file_change PARAMS ((cpp_reader *, const struct line_map *)); static void cb_file_change (cpp_reader *, const struct line_map *);
static void finish_options PARAMS ((void)); static void finish_options (void);
#ifndef STDC_0_IN_SYSTEM_HEADERS #ifndef STDC_0_IN_SYSTEM_HEADERS
#define STDC_0_IN_SYSTEM_HEADERS 0 #define STDC_0_IN_SYSTEM_HEADERS 0
...@@ -123,7 +123,7 @@ static void finish_options PARAMS ((void)); ...@@ -123,7 +123,7 @@ static void finish_options PARAMS ((void));
/* Holds switches parsed by c_common_handle_option (), but whose /* Holds switches parsed by c_common_handle_option (), but whose
handling is deferred to c_common_post_options (). */ handling is deferred to c_common_post_options (). */
static void defer_opt PARAMS ((enum opt_code, const char *)); static void defer_opt (enum opt_code, const char *);
static struct deferred_opt static struct deferred_opt
{ {
enum opt_code code; enum opt_code code;
...@@ -193,9 +193,7 @@ missing_arg (enum opt_code code) ...@@ -193,9 +193,7 @@ missing_arg (enum opt_code code)
/* Defer option CODE with argument ARG. */ /* Defer option CODE with argument ARG. */
static void static void
defer_opt (code, arg) defer_opt (enum opt_code code, const char *arg)
enum opt_code code;
const char *arg;
{ {
/* FIXME: this should be in c_common_init_options, which should take /* FIXME: this should be in c_common_init_options, which should take
argc and argv. */ argc and argv. */
...@@ -217,8 +215,7 @@ defer_opt (code, arg) ...@@ -217,8 +215,7 @@ defer_opt (code, arg)
/* Common initialization before parsing options. */ /* Common initialization before parsing options. */
int int
c_common_init_options (lang) c_common_init_options (enum c_language_kind lang)
enum c_language_kind lang;
{ {
c_language = lang; c_language = lang;
parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX, parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX,
...@@ -388,9 +385,9 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -388,9 +385,9 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_sign_compare = value; warn_sign_compare = value;
warn_switch = value; warn_switch = value;
warn_strict_aliasing = value; warn_strict_aliasing = value;
/* Only warn about unknown pragmas that are not in system /* Only warn about unknown pragmas that are not in system
headers. */ headers. */
warn_unknown_pragmas = value; warn_unknown_pragmas = value;
/* We save the value of warn_uninitialized, since if they put /* We save the value of warn_uninitialized, since if they put
...@@ -653,7 +650,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -653,7 +650,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_Wunknown_pragmas: case OPT_Wunknown_pragmas:
/* Set to greater than 1, so that even unknown pragmas in /* Set to greater than 1, so that even unknown pragmas in
system headers will be warned about. */ system headers will be warned about. */
warn_unknown_pragmas = value * 2; warn_unknown_pragmas = value * 2;
break; break;
...@@ -667,7 +664,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -667,7 +664,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
else else
warn_write_strings = value; warn_write_strings = value;
break; break;
case OPT_ansi: case OPT_ansi:
if (c_language == clk_c) if (c_language == clk_c)
set_std_c89 (false, true); set_std_c89 (false, true);
...@@ -1054,8 +1051,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -1054,8 +1051,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
/* Post-switch processing. */ /* Post-switch processing. */
bool bool
c_common_post_options (pfilename) c_common_post_options (const char **pfilename)
const char **pfilename;
{ {
/* Canonicalize the input and output filenames. */ /* Canonicalize the input and output filenames. */
if (in_fname == NULL || !strcmp (in_fname, "-")) if (in_fname == NULL || !strcmp (in_fname, "-"))
...@@ -1153,7 +1149,7 @@ c_common_post_options (pfilename) ...@@ -1153,7 +1149,7 @@ c_common_post_options (pfilename)
/* Front end initialization common to C, ObjC and C++. */ /* Front end initialization common to C, ObjC and C++. */
bool bool
c_common_init () c_common_init (void)
{ {
input_line = saved_lineno; input_line = saved_lineno;
...@@ -1179,13 +1175,12 @@ c_common_init () ...@@ -1179,13 +1175,12 @@ c_common_init ()
return true; return true;
} }
/* A thin wrapper around the real parser that initializes the /* A thin wrapper around the real parser that initializes the
integrated preprocessor after debug output has been initialized. integrated preprocessor after debug output has been initialized.
Also, make sure the start_source_file debug hook gets called for Also, make sure the start_source_file debug hook gets called for
the primary source file. */ the primary source file. */
void void
c_common_parse_file (set_yydebug) c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
int set_yydebug ATTRIBUTE_UNUSED;
{ {
#if YYDEBUG != 0 #if YYDEBUG != 0
yydebug = set_yydebug; yydebug = set_yydebug;
...@@ -1202,7 +1197,7 @@ c_common_parse_file (set_yydebug) ...@@ -1202,7 +1197,7 @@ c_common_parse_file (set_yydebug)
/* Common finish hook for the C, ObjC and C++ front ends. */ /* Common finish hook for the C, ObjC and C++ front ends. */
void void
c_common_finish () c_common_finish (void)
{ {
FILE *deps_stream = NULL; FILE *deps_stream = NULL;
...@@ -1240,7 +1235,7 @@ c_common_finish () ...@@ -1240,7 +1235,7 @@ c_common_finish ()
rather than overwriting it, and like Sun's compiler rather than overwriting it, and like Sun's compiler
SUNPRO_DEPENDENCIES suppresses the dependency on the main file. */ SUNPRO_DEPENDENCIES suppresses the dependency on the main file. */
static void static void
check_deps_environment_vars () check_deps_environment_vars (void)
{ {
char *spec; char *spec;
...@@ -1278,7 +1273,7 @@ check_deps_environment_vars () ...@@ -1278,7 +1273,7 @@ check_deps_environment_vars ()
/* Handle deferred command line switches. */ /* Handle deferred command line switches. */
static void static void
handle_deferred_opts () handle_deferred_opts (void)
{ {
size_t i; size_t i;
...@@ -1294,7 +1289,7 @@ handle_deferred_opts () ...@@ -1294,7 +1289,7 @@ handle_deferred_opts ()
/* These settings are appropriate for GCC, but not necessarily so for /* These settings are appropriate for GCC, but not necessarily so for
cpplib as a library. */ cpplib as a library. */
static void static void
sanitize_cpp_opts () sanitize_cpp_opts (void)
{ {
/* If we don't know what style of dependencies to output, complain /* If we don't know what style of dependencies to output, complain
if any other dependency switches have been given. */ if any other dependency switches have been given. */
...@@ -1326,9 +1321,7 @@ sanitize_cpp_opts () ...@@ -1326,9 +1321,7 @@ sanitize_cpp_opts ()
/* Add include path with a prefix at the front of its name. */ /* Add include path with a prefix at the front of its name. */
static void static void
add_prefixed_path (suffix, chain) add_prefixed_path (const char *suffix, size_t chain)
const char *suffix;
size_t chain;
{ {
char *path; char *path;
const char *prefix; const char *prefix;
...@@ -1348,7 +1341,7 @@ add_prefixed_path (suffix, chain) ...@@ -1348,7 +1341,7 @@ add_prefixed_path (suffix, chain)
/* Handle -D, -U, -A, -imacros, and the first -include. */ /* Handle -D, -U, -A, -imacros, and the first -include. */
static void static void
finish_options () finish_options (void)
{ {
if (!cpp_opts->preprocessed) if (!cpp_opts->preprocessed)
{ {
...@@ -1403,15 +1396,15 @@ finish_options () ...@@ -1403,15 +1396,15 @@ finish_options ()
/* Give CPP the next file given by -include, if any. */ /* Give CPP the next file given by -include, if any. */
static void static void
push_command_line_include () push_command_line_include (void)
{ {
if (cpp_opts->preprocessed) if (cpp_opts->preprocessed)
return; return;
while (include_cursor < deferred_count) while (include_cursor < deferred_count)
{ {
struct deferred_opt *opt = &deferred_opts[include_cursor++]; struct deferred_opt *opt = &deferred_opts[include_cursor++];
if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg)) if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg))
return; return;
} }
...@@ -1428,9 +1421,8 @@ push_command_line_include () ...@@ -1428,9 +1421,8 @@ push_command_line_include ()
/* File change callback. Has to handle -include files. */ /* File change callback. Has to handle -include files. */
static void static void
cb_file_change (pfile, new_map) cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED,
cpp_reader *pfile ATTRIBUTE_UNUSED; const struct line_map *new_map)
const struct line_map *new_map;
{ {
if (flag_preprocess_only) if (flag_preprocess_only)
pp_file_change (new_map); pp_file_change (new_map);
...@@ -1444,8 +1436,7 @@ cb_file_change (pfile, new_map) ...@@ -1444,8 +1436,7 @@ cb_file_change (pfile, new_map)
/* Set the C 89 standard (with 1994 amendments if C94, without GNU /* Set the C 89 standard (with 1994 amendments if C94, without GNU
extensions if ISO). There is no concept of gnu94. */ extensions if ISO). There is no concept of gnu94. */
static void static void
set_std_c89 (c94, iso) set_std_c89 (int c94, int iso)
int c94, iso;
{ {
cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89); cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89);
flag_iso = iso; flag_iso = iso;
...@@ -1460,8 +1451,7 @@ set_std_c89 (c94, iso) ...@@ -1460,8 +1451,7 @@ set_std_c89 (c94, iso)
/* Set the C 99 standard (without GNU extensions if ISO). */ /* Set the C 99 standard (without GNU extensions if ISO). */
static void static void
set_std_c99 (iso) set_std_c99 (int iso)
int iso;
{ {
cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99); cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99);
flag_no_asm = iso; flag_no_asm = iso;
...@@ -1475,8 +1465,7 @@ set_std_c99 (iso) ...@@ -1475,8 +1465,7 @@ set_std_c99 (iso)
/* Set the C++ 98 standard (without GNU extensions if ISO). */ /* Set the C++ 98 standard (without GNU extensions if ISO). */
static void static void
set_std_cxx98 (iso) set_std_cxx98 (int iso)
int iso;
{ {
cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX); cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX);
flag_no_gnu_keywords = iso; flag_no_gnu_keywords = iso;
...@@ -1487,8 +1476,7 @@ set_std_cxx98 (iso) ...@@ -1487,8 +1476,7 @@ set_std_cxx98 (iso)
/* Handle setting implicit to ON. */ /* Handle setting implicit to ON. */
static void static void
set_Wimplicit (on) set_Wimplicit (int on)
int on;
{ {
warn_implicit = on; warn_implicit = on;
warn_implicit_int = on; warn_implicit_int = on;
...@@ -1504,8 +1492,7 @@ set_Wimplicit (on) ...@@ -1504,8 +1492,7 @@ set_Wimplicit (on)
/* Args to -d specify what to dump. Silently ignore /* Args to -d specify what to dump. Silently ignore
unrecognized options; they may be aimed at toplev.c. */ unrecognized options; they may be aimed at toplev.c. */
static void static void
handle_OPT_d (arg) handle_OPT_d (const char *arg)
const char *arg;
{ {
char c; char c;
...@@ -1526,9 +1513,7 @@ handle_OPT_d (arg) ...@@ -1526,9 +1513,7 @@ handle_OPT_d (arg)
/* Write a slash-separated list of languages in FLAGS to BUF. */ /* Write a slash-separated list of languages in FLAGS to BUF. */
static void static void
write_langs (buf, flags) write_langs (char *buf, int flags)
char *buf;
int flags;
{ {
*buf = '\0'; *buf = '\0';
if (flags & CL_C) if (flags & CL_C)
...@@ -1549,9 +1534,7 @@ write_langs (buf, flags) ...@@ -1549,9 +1534,7 @@ write_langs (buf, flags)
/* Complain that switch OPT_INDEX does not apply to this front end. */ /* Complain that switch OPT_INDEX does not apply to this front end. */
static void static void
complain_wrong_lang (opt_index, on) complain_wrong_lang (size_t opt_index, int on)
size_t opt_index;
int on;
{ {
char ok_langs[60], bad_langs[60]; char ok_langs[60], bad_langs[60];
int ok_flags = cl_options[opt_index].flags; int ok_flags = cl_options[opt_index].flags;
...@@ -1566,7 +1549,7 @@ complain_wrong_lang (opt_index, on) ...@@ -1566,7 +1549,7 @@ complain_wrong_lang (opt_index, on)
/* Handle --help output. */ /* Handle --help output. */
static void static void
print_help () print_help (void)
{ {
/* To keep the lines from getting too long for some compilers, limit /* To keep the lines from getting too long for some compilers, limit
to about 500 characters (6 lines) per chunk. */ to about 500 characters (6 lines) per chunk. */
......
/* Precompiled header implementation for the C languages. /* Precompiled header implementation for the C languages.
Copyright (C) 2000, 2002 Free Software Foundation, Inc. Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -48,7 +48,7 @@ static FILE *pch_outfile; ...@@ -48,7 +48,7 @@ static FILE *pch_outfile;
static long asm_file_startpos; static long asm_file_startpos;
static const char * get_ident PARAMS((void)); static const char *get_ident (void);
/* Compute an appropriate 8-byte magic number for the PCH file, so that /* Compute an appropriate 8-byte magic number for the PCH file, so that
utilities like file(1) can identify it, and so that GCC can quickly utilities like file(1) can identify it, and so that GCC can quickly
...@@ -56,7 +56,7 @@ static const char * get_ident PARAMS((void)); ...@@ -56,7 +56,7 @@ static const char * get_ident PARAMS((void));
format. */ format. */
static const char * static const char *
get_ident() get_ident(void)
{ {
static char result[IDENT_LENGTH]; static char result[IDENT_LENGTH];
static const char template[IDENT_LENGTH] = "gpch.011"; static const char template[IDENT_LENGTH] = "gpch.011";
...@@ -75,7 +75,7 @@ get_ident() ...@@ -75,7 +75,7 @@ get_ident()
compilation. */ compilation. */
void void
pch_init () pch_init (void)
{ {
FILE *f; FILE *f;
struct c_pch_validity v; struct c_pch_validity v;
...@@ -111,7 +111,7 @@ pch_init () ...@@ -111,7 +111,7 @@ pch_init ()
will produce a PCH file. */ will produce a PCH file. */
void void
c_common_write_pch () c_common_write_pch (void)
{ {
char *buf; char *buf;
long asm_file_end; long asm_file_end;
...@@ -157,10 +157,7 @@ c_common_write_pch () ...@@ -157,10 +157,7 @@ c_common_write_pch ()
in this compilation. */ in this compilation. */
int int
c_common_valid_pch (pfile, name, fd) c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
cpp_reader *pfile;
const char *name;
int fd;
{ {
int sizeread; int sizeread;
int result; int result;
...@@ -232,11 +229,8 @@ c_common_valid_pch (pfile, name, fd) ...@@ -232,11 +229,8 @@ c_common_valid_pch (pfile, name, fd)
by ORIG_NAME. */ by ORIG_NAME. */
void void
c_common_read_pch (pfile, name, fd, orig_name) c_common_read_pch (cpp_reader *pfile, const char *name,
cpp_reader *pfile; int fd, const char *orig_name ATTRIBUTE_UNUSED)
const char *name;
int fd;
const char *orig_name ATTRIBUTE_UNUSED;
{ {
FILE *f; FILE *f;
struct c_pch_header h; struct c_pch_header h;
......
...@@ -40,30 +40,28 @@ static struct ...@@ -40,30 +40,28 @@ static struct
} print; } print;
/* General output routines. */ /* General output routines. */
static void scan_translation_unit PARAMS ((cpp_reader *)); static void scan_translation_unit (cpp_reader *);
static void scan_translation_unit_trad PARAMS ((cpp_reader *)); static void scan_translation_unit_trad (cpp_reader *);
static void account_for_newlines PARAMS ((const uchar *, size_t)); static void account_for_newlines (const uchar *, size_t);
static int dump_macro PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
static void print_line PARAMS ((const struct line_map *, unsigned int, static void print_line (const struct line_map *, unsigned int,
const char *)); const char *);
static void maybe_print_line PARAMS ((const struct line_map *, unsigned int)); static void maybe_print_line (const struct line_map *, unsigned int);
/* Callback routines for the parser. Most of these are active only /* Callback routines for the parser. Most of these are active only
in specific modes. */ in specific modes. */
static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int)); static void cb_line_change (cpp_reader *, const cpp_token *, int);
static void cb_define PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *)); static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_undef PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *)); static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_include PARAMS ((cpp_reader *, unsigned int, static void cb_include (cpp_reader *, unsigned int, const unsigned char *,
const unsigned char *, const char *, int)); const char *, int);
static void cb_ident PARAMS ((cpp_reader *, unsigned int, static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
const cpp_string *)); static void cb_def_pragma (cpp_reader *, unsigned int);
static void cb_def_pragma PARAMS ((cpp_reader *, unsigned int));
/* Preprocess and output. */ /* Preprocess and output. */
void void
preprocess_file (pfile) preprocess_file (cpp_reader *pfile)
cpp_reader *pfile;
{ {
/* A successful cpp_read_main_file guarantees that we can call /* A successful cpp_read_main_file guarantees that we can call
cpp_scan_nooutput or cpp_get_token next. */ cpp_scan_nooutput or cpp_get_token next. */
...@@ -90,8 +88,7 @@ preprocess_file (pfile) ...@@ -90,8 +88,7 @@ preprocess_file (pfile)
/* Set up the callbacks as appropriate. */ /* Set up the callbacks as appropriate. */
void void
init_pp_output (out_stream) init_pp_output (FILE *out_stream)
FILE *out_stream;
{ {
cpp_callbacks *cb = cpp_get_callbacks (parse_in); cpp_callbacks *cb = cpp_get_callbacks (parse_in);
...@@ -129,8 +126,7 @@ init_pp_output (out_stream) ...@@ -129,8 +126,7 @@ init_pp_output (out_stream)
/* Writes out the preprocessed file, handling spacing and paste /* Writes out the preprocessed file, handling spacing and paste
avoidance issues. */ avoidance issues. */
static void static void
scan_translation_unit (pfile) scan_translation_unit (cpp_reader *pfile)
cpp_reader *pfile;
{ {
bool avoid_paste = false; bool avoid_paste = false;
...@@ -178,9 +174,7 @@ scan_translation_unit (pfile) ...@@ -178,9 +174,7 @@ scan_translation_unit (pfile)
/* Adjust print.line for newlines embedded in output. */ /* Adjust print.line for newlines embedded in output. */
static void static void
account_for_newlines (str, len) account_for_newlines (const uchar *str, size_t len)
const uchar *str;
size_t len;
{ {
while (len--) while (len--)
if (*str++ == '\n') if (*str++ == '\n')
...@@ -189,8 +183,7 @@ account_for_newlines (str, len) ...@@ -189,8 +183,7 @@ account_for_newlines (str, len)
/* Writes out a traditionally preprocessed file. */ /* Writes out a traditionally preprocessed file. */
static void static void
scan_translation_unit_trad (pfile) scan_translation_unit_trad (cpp_reader *pfile)
cpp_reader *pfile;
{ {
while (_cpp_read_logical_line_trad (pfile)) while (_cpp_read_logical_line_trad (pfile))
{ {
...@@ -207,9 +200,7 @@ scan_translation_unit_trad (pfile) ...@@ -207,9 +200,7 @@ scan_translation_unit_trad (pfile)
different line to the current one, output the required newlines or different line to the current one, output the required newlines or
a line marker, and return 1. Otherwise return 0. */ a line marker, and return 1. Otherwise return 0. */
static void static void
maybe_print_line (map, line) maybe_print_line (const struct line_map *map, unsigned int line)
const struct line_map *map;
unsigned int line;
{ {
/* End the previous line of text. */ /* End the previous line of text. */
if (print.printed) if (print.printed)
...@@ -234,10 +225,7 @@ maybe_print_line (map, line) ...@@ -234,10 +225,7 @@ maybe_print_line (map, line)
/* Output a line marker for logical line LINE. Special flags are "1" /* Output a line marker for logical line LINE. Special flags are "1"
or "2" indicating entering or leaving a file. */ or "2" indicating entering or leaving a file. */
static void static void
print_line (map, line, special_flags) print_line (const struct line_map *map, unsigned int line, const char *special_flags)
const struct line_map *map;
unsigned int line;
const char *special_flags;
{ {
/* End any previous line of text. */ /* End any previous line of text. */
if (print.printed) if (print.printed)
...@@ -272,10 +260,7 @@ print_line (map, line, special_flags) ...@@ -272,10 +260,7 @@ print_line (map, line, special_flags)
/* Called when a line of output is started. TOKEN is the first token /* Called when a line of output is started. TOKEN is the first token
of the line, and at end of file will be CPP_EOF. */ of the line, and at end of file will be CPP_EOF. */
static void static void
cb_line_change (pfile, token, parsing_args) cb_line_change (cpp_reader *pfile, const cpp_token *token, int parsing_args)
cpp_reader *pfile;
const cpp_token *token;
int parsing_args;
{ {
if (token->type == CPP_EOF || parsing_args) if (token->type == CPP_EOF || parsing_args)
return; return;
...@@ -303,10 +288,8 @@ cb_line_change (pfile, token, parsing_args) ...@@ -303,10 +288,8 @@ cb_line_change (pfile, token, parsing_args)
} }
static void static void
cb_ident (pfile, line, str) cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; const cpp_string *str)
unsigned int line;
const cpp_string * str;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fprintf (print.outf, "#ident \"%s\"\n", str->text); fprintf (print.outf, "#ident \"%s\"\n", str->text);
...@@ -314,10 +297,7 @@ cb_ident (pfile, line, str) ...@@ -314,10 +297,7 @@ cb_ident (pfile, line, str)
} }
static void static void
cb_define (pfile, line, node) cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
cpp_reader *pfile;
unsigned int line;
cpp_hashnode *node;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fputs ("#define ", print.outf); fputs ("#define ", print.outf);
...@@ -334,10 +314,8 @@ cb_define (pfile, line, node) ...@@ -334,10 +314,8 @@ cb_define (pfile, line, node)
} }
static void static void
cb_undef (pfile, line, node) cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; cpp_hashnode *node)
unsigned int line;
cpp_hashnode *node;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fprintf (print.outf, "#undef %s\n", NODE_NAME (node)); fprintf (print.outf, "#undef %s\n", NODE_NAME (node));
...@@ -345,12 +323,8 @@ cb_undef (pfile, line, node) ...@@ -345,12 +323,8 @@ cb_undef (pfile, line, node)
} }
static void static void
cb_include (pfile, line, dir, header, angle_brackets) cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; const unsigned char *dir, const char *header, int angle_brackets)
unsigned int line;
const unsigned char *dir;
const char *header;
int angle_brackets;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
if (angle_brackets) if (angle_brackets)
...@@ -365,8 +339,7 @@ cb_include (pfile, line, dir, header, angle_brackets) ...@@ -365,8 +339,7 @@ cb_include (pfile, line, dir, header, angle_brackets)
pointing to freed memory, and so must not be dereferenced. */ pointing to freed memory, and so must not be dereferenced. */
void void
pp_file_change (map) pp_file_change (const struct line_map *map)
const struct line_map *map;
{ {
const char *flags = ""; const char *flags = "";
...@@ -398,9 +371,7 @@ pp_file_change (map) ...@@ -398,9 +371,7 @@ pp_file_change (map)
/* Copy a #pragma directive to the preprocessed output. */ /* Copy a #pragma directive to the preprocessed output. */
static void static void
cb_def_pragma (pfile, line) cb_def_pragma (cpp_reader *pfile, unsigned int line)
cpp_reader *pfile;
unsigned int line;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fputs ("#pragma ", print.outf); fputs ("#pragma ", print.outf);
...@@ -410,10 +381,7 @@ cb_def_pragma (pfile, line) ...@@ -410,10 +381,7 @@ cb_def_pragma (pfile, line)
/* Dump out the hash table. */ /* Dump out the hash table. */
static int static int
dump_macro (pfile, node, v) dump_macro (cpp_reader *pfile, cpp_hashnode *node, void *v ATTRIBUTE_UNUSED)
cpp_reader *pfile;
cpp_hashnode *node;
void *v ATTRIBUTE_UNUSED;
{ {
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN)) if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
{ {
......
/* Subroutines common to both C and C++ pretty-printers. /* Subroutines common to both C and C++ pretty-printers.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC. This file is part of GCC.
...@@ -28,55 +28,51 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -28,55 +28,51 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "c-tree.h" #include "c-tree.h"
/* literal */ /* literal */
static void pp_c_char PARAMS ((c_pretty_printer, int)); static void pp_c_char (c_pretty_printer, int);
static void pp_c_character_literal PARAMS ((c_pretty_printer, tree)); static void pp_c_character_literal (c_pretty_printer, tree);
static void pp_c_bool_literal PARAMS ((c_pretty_printer, tree)); static void pp_c_bool_literal (c_pretty_printer, tree);
static bool pp_c_enumerator PARAMS ((c_pretty_printer, tree)); static bool pp_c_enumerator (c_pretty_printer, tree);
static void pp_c_integer_literal PARAMS ((c_pretty_printer, tree)); static void pp_c_integer_literal (c_pretty_printer, tree);
static void pp_c_real_literal PARAMS ((c_pretty_printer, tree)); static void pp_c_real_literal (c_pretty_printer, tree);
static void pp_c_string_literal PARAMS ((c_pretty_printer, tree)); static void pp_c_string_literal (c_pretty_printer, tree);
static void pp_c_primary_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_primary_expression (c_pretty_printer, tree);
/* postfix-expression */ /* postfix-expression */
static void pp_c_initializer_list PARAMS ((c_pretty_printer, tree)); static void pp_c_initializer_list (c_pretty_printer, tree);
static void pp_c_unary_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_unary_expression (c_pretty_printer, tree);
static void pp_c_multiplicative_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_multiplicative_expression (c_pretty_printer, tree);
static void pp_c_additive_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_additive_expression (c_pretty_printer, tree);
static void pp_c_shift_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_shift_expression (c_pretty_printer, tree);
static void pp_c_relational_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_relational_expression (c_pretty_printer, tree);
static void pp_c_equality_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_equality_expression (c_pretty_printer, tree);
static void pp_c_and_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_and_expression (c_pretty_printer, tree);
static void pp_c_exclusive_or_expression PARAMS ((c_pretty_printer, static void pp_c_exclusive_or_expression (c_pretty_printer, tree);
tree)); static void pp_c_inclusive_or_expression (c_pretty_printer, tree);
static void pp_c_inclusive_or_expression PARAMS ((c_pretty_printer, static void pp_c_logical_and_expression (c_pretty_printer, tree);
tree)); static void pp_c_conditional_expression (c_pretty_printer, tree);
static void pp_c_logical_and_expression PARAMS ((c_pretty_printer, tree)); static void pp_c_assignment_expression (c_pretty_printer, tree);
static void pp_c_conditional_expression PARAMS ((c_pretty_printer, tree));
static void pp_c_assignment_expression PARAMS ((c_pretty_printer, tree));
/* declarations. */ /* declarations. */
static void pp_c_declaration_specifiers PARAMS ((c_pretty_printer, tree)); static void pp_c_declaration_specifiers (c_pretty_printer, tree);
static void pp_c_init_declarator PARAMS ((c_pretty_printer, tree)); static void pp_c_init_declarator (c_pretty_printer, tree);
static void pp_c_declarator PARAMS ((c_pretty_printer, tree)); static void pp_c_declarator (c_pretty_printer, tree);
static void pp_c_direct_declarator PARAMS ((c_pretty_printer, tree)); static void pp_c_direct_declarator (c_pretty_printer, tree);
static void pp_c_abstract_declarator PARAMS ((c_pretty_printer, tree)); static void pp_c_abstract_declarator (c_pretty_printer, tree);
static void pp_c_specifier_qualifier_list PARAMS ((c_pretty_printer, tree)); static void pp_c_specifier_qualifier_list (c_pretty_printer, tree);
static void pp_c_simple_type_specifier PARAMS ((c_pretty_printer, tree)); static void pp_c_simple_type_specifier (c_pretty_printer, tree);
static void pp_c_parameter_declaration PARAMS ((c_pretty_printer, tree)); static void pp_c_parameter_declaration (c_pretty_printer, tree);
static void pp_c_type_id PARAMS ((c_pretty_printer, tree)); static void pp_c_type_id (c_pretty_printer, tree);
static void pp_c_storage_class_specifier PARAMS ((c_pretty_printer, tree)); static void pp_c_storage_class_specifier (c_pretty_printer, tree);
static void pp_c_function_specifier PARAMS ((c_pretty_printer, tree)); static void pp_c_function_specifier (c_pretty_printer, tree);
/* Declarations. */ /* Declarations. */
/* Print out CV-qualifiers. Take care of possible extensions. */ /* Print out CV-qualifiers. Take care of possible extensions. */
void void
pp_c_cv_qualifier (ppi, cv) pp_c_cv_qualifier (c_pretty_printer ppi, int cv)
c_pretty_printer ppi;
int cv;
{ {
if (cv & TYPE_QUAL_CONST) if (cv & TYPE_QUAL_CONST)
pp_c_identifier (ppi, "const"); pp_c_identifier (ppi, "const");
...@@ -87,9 +83,7 @@ pp_c_cv_qualifier (ppi, cv) ...@@ -87,9 +83,7 @@ pp_c_cv_qualifier (ppi, cv)
} }
static void static void
pp_c_simple_type_specifier (ppi, t) pp_c_simple_type_specifier (c_pretty_printer ppi, tree t)
c_pretty_printer ppi;
tree t;
{ {
const enum tree_code code = TREE_CODE (t); const enum tree_code code = TREE_CODE (t);
switch (code) switch (code)
...@@ -107,7 +101,7 @@ pp_c_simple_type_specifier (ppi, t) ...@@ -107,7 +101,7 @@ pp_c_simple_type_specifier (ppi, t)
case IDENTIFIER_NODE: case IDENTIFIER_NODE:
pp_c_tree_identifier (ppi, t); pp_c_tree_identifier (ppi, t);
break; break;
case VOID_TYPE: case VOID_TYPE:
case BOOLEAN_TYPE: case BOOLEAN_TYPE:
case CHAR_TYPE: case CHAR_TYPE:
...@@ -115,7 +109,7 @@ pp_c_simple_type_specifier (ppi, t) ...@@ -115,7 +109,7 @@ pp_c_simple_type_specifier (ppi, t)
case REAL_TYPE: case REAL_TYPE:
pp_c_tree_identifier (ppi, DECL_NAME (t)); pp_c_tree_identifier (ppi, DECL_NAME (t));
break; break;
case COMPLEX_TYPE: case COMPLEX_TYPE:
case VECTOR_TYPE: case VECTOR_TYPE:
pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t))); pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
...@@ -143,7 +137,7 @@ pp_c_simple_type_specifier (ppi, t) ...@@ -143,7 +137,7 @@ pp_c_simple_type_specifier (ppi, t)
pp_c_identifier (ppi, "enum"); pp_c_identifier (ppi, "enum");
else else
pp_c_identifier (ppi, "<tag-error>"); pp_c_identifier (ppi, "<tag-error>");
if (TYPE_NAME (t)) if (TYPE_NAME (t))
pp_c_tree_identifier (ppi, TYPE_NAME (t)); pp_c_tree_identifier (ppi, TYPE_NAME (t));
else else
...@@ -156,36 +150,28 @@ pp_c_simple_type_specifier (ppi, t) ...@@ -156,36 +150,28 @@ pp_c_simple_type_specifier (ppi, t)
} }
static inline void static inline void
pp_c_specifier_qualifier_list (ppi, t) pp_c_specifier_qualifier_list (c_pretty_printer ppi, tree t)
c_pretty_printer ppi;
tree t;
{ {
pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t))); pp_c_simple_type_specifier (ppi, TYPE_MAIN_VARIANT (TREE_TYPE (t)));
pp_c_cv_qualifier (ppi, TYPE_QUALS (t)); pp_c_cv_qualifier (ppi, TYPE_QUALS (t));
} }
static void static void
pp_c_abstract_declarator (ppi, t) pp_c_abstract_declarator (c_pretty_printer ppi, tree t)
c_pretty_printer ppi;
tree t;
{ {
pp_unsupported_tree (ppi, t); pp_unsupported_tree (ppi, t);
} }
static inline void static inline void
pp_c_type_id (ppi, t) pp_c_type_id (c_pretty_printer ppi, tree t)
c_pretty_printer ppi;
tree t;
{ {
pp_c_specifier_qualifier_list (ppi, t); pp_c_specifier_qualifier_list (ppi, t);
pp_c_abstract_declarator (ppi, t); pp_c_abstract_declarator (ppi, t);
} }
static inline void static inline void
pp_c_storage_class_specifier (pp, t) pp_c_storage_class_specifier (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
if (TREE_CODE (t) == TYPE_DECL) if (TREE_CODE (t) == TYPE_DECL)
pp_c_identifier (pp, "typedef"); pp_c_identifier (pp, "typedef");
...@@ -194,18 +180,14 @@ pp_c_storage_class_specifier (pp, t) ...@@ -194,18 +180,14 @@ pp_c_storage_class_specifier (pp, t)
} }
static inline void static inline void
pp_c_function_specifier (pp, t) pp_c_function_specifier (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
if (TREE_CODE (t) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (t)) if (TREE_CODE (t) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (t))
pp_c_identifier (pp, "inline"); pp_c_identifier (pp, "inline");
} }
static inline void static inline void
pp_c_declaration_specifiers (pp, t) pp_c_declaration_specifiers (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
pp_c_storage_class_specifier (pp, t); pp_c_storage_class_specifier (pp, t);
pp_c_function_specifier (pp, t); pp_c_function_specifier (pp, t);
...@@ -214,25 +196,19 @@ pp_c_declaration_specifiers (pp, t) ...@@ -214,25 +196,19 @@ pp_c_declaration_specifiers (pp, t)
} }
static inline void static inline void
pp_c_direct_declarator (pp, t) pp_c_direct_declarator (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
pp_unsupported_tree (pp, t); pp_unsupported_tree (pp, t);
} }
static inline void static inline void
pp_c_declarator (pp, t) pp_c_declarator (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
pp_unsupported_tree (pp, t); pp_unsupported_tree (pp, t);
} }
static inline void static inline void
pp_c_init_declarator (pp, t) pp_c_init_declarator (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
pp_declarator (pp, t); pp_declarator (pp, t);
if (DECL_INITIAL (t)) if (DECL_INITIAL (t))
...@@ -245,33 +221,27 @@ pp_c_init_declarator (pp, t) ...@@ -245,33 +221,27 @@ pp_c_init_declarator (pp, t)
} }
void void
pp_c_declaration (pp, t) pp_c_declaration (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
pp_declaration_specifiers (pp, t); pp_declaration_specifiers (pp, t);
pp_c_init_declarator (pp, t); pp_c_init_declarator (pp, t);
} }
static void static void
pp_c_parameter_declaration (pp, t) pp_c_parameter_declaration (c_pretty_printer pp, tree t)
c_pretty_printer pp;
tree t;
{ {
pp_unsupported_tree (pp, t); pp_unsupported_tree (pp, t);
} }
/* Pretty-print ATTRIBUTES using GNU C extension syntax. */ /* Pretty-print ATTRIBUTES using GNU C extension syntax. */
void void
pp_c_attributes (pp, attributes) pp_c_attributes (c_pretty_printer pp, tree attributes)
c_pretty_printer pp;
tree attributes;
{ {
if (attributes == NULL_TREE) if (attributes == NULL_TREE)
return; return;
pp_c_identifier (pp, "__attribute__"); pp_c_identifier (pp, "__attribute__");
pp_c_left_paren (pp); pp_c_left_paren (pp);
pp_c_left_paren (pp); pp_c_left_paren (pp);
for (; attributes != NULL_TREE; attributes = TREE_CHAIN (attributes)) for (; attributes != NULL_TREE; attributes = TREE_CHAIN (attributes))
{ {
...@@ -282,7 +252,7 @@ pp_c_attributes (pp, attributes) ...@@ -282,7 +252,7 @@ pp_c_attributes (pp, attributes)
pp_c_expression_list (pp, TREE_VALUE (attributes)); pp_c_expression_list (pp, TREE_VALUE (attributes));
pp_c_right_paren (pp); pp_c_right_paren (pp);
} }
if (TREE_CHAIN (attributes)) if (TREE_CHAIN (attributes))
pp_separate_with (pp, ','); pp_separate_with (pp, ',');
} }
...@@ -295,9 +265,7 @@ pp_c_attributes (pp, attributes) ...@@ -295,9 +265,7 @@ pp_c_attributes (pp, attributes)
/* Print out a c-char. */ /* Print out a c-char. */
static void static void
pp_c_char (ppi, c) pp_c_char (c_pretty_printer ppi, int c)
c_pretty_printer ppi;
int c;
{ {
switch (c) switch (c)
{ {
...@@ -342,9 +310,7 @@ pp_c_char (ppi, c) ...@@ -342,9 +310,7 @@ pp_c_char (ppi, c)
/* Print out a STRING literal. */ /* Print out a STRING literal. */
static inline void static inline void
pp_c_string_literal (ppi, s) pp_c_string_literal (c_pretty_printer ppi, tree s)
c_pretty_printer ppi;
tree s;
{ {
const char *p = TREE_STRING_POINTER (s); const char *p = TREE_STRING_POINTER (s);
int n = TREE_STRING_LENGTH (s) - 1; int n = TREE_STRING_LENGTH (s) - 1;
...@@ -357,9 +323,7 @@ pp_c_string_literal (ppi, s) ...@@ -357,9 +323,7 @@ pp_c_string_literal (ppi, s)
/* Print out a CHARACTER literal. */ /* Print out a CHARACTER literal. */
static inline void static inline void
pp_c_character_literal (ppi, c) pp_c_character_literal (c_pretty_printer ppi, tree c)
c_pretty_printer ppi;
tree c;
{ {
pp_quote (ppi); pp_quote (ppi);
pp_c_char (ppi, tree_low_cst (c, 0)); pp_c_char (ppi, tree_low_cst (c, 0));
...@@ -368,9 +332,7 @@ pp_c_character_literal (ppi, c) ...@@ -368,9 +332,7 @@ pp_c_character_literal (ppi, c)
/* Print out a BOOLEAN literal. */ /* Print out a BOOLEAN literal. */
static inline void static inline void
pp_c_bool_literal (ppi, b) pp_c_bool_literal (c_pretty_printer ppi, tree b)
c_pretty_printer ppi;
tree b;
{ {
if (b == boolean_false_node || integer_zerop (b)) if (b == boolean_false_node || integer_zerop (b))
{ {
...@@ -394,24 +356,22 @@ pp_c_bool_literal (ppi, b) ...@@ -394,24 +356,22 @@ pp_c_bool_literal (ppi, b)
pp_unsupported_tree (ppi, b); pp_unsupported_tree (ppi, b);
} }
/* Attempt to print out an ENUMERATOR. Return true on success. Else return /* Attempt to print out an ENUMERATOR. Return true on success. Else return
false; that means the value was obtained by a cast, in which case false; that means the value was obtained by a cast, in which case
print out the type-id part of the cast-expression -- the casted value print out the type-id part of the cast-expression -- the casted value
is then printed by pp_c_integer_literal. */ is then printed by pp_c_integer_literal. */
static bool static bool
pp_c_enumerator (ppi, e) pp_c_enumerator (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
tree type = TREE_TYPE (e); tree type = TREE_TYPE (e);
tree value; tree value;
/* Find the name of this constant. */ /* Find the name of this constant. */
for (value = TYPE_VALUES (type); for (value = TYPE_VALUES (type);
value != NULL_TREE && !tree_int_cst_equal (TREE_VALUE (value), e); value != NULL_TREE && !tree_int_cst_equal (TREE_VALUE (value), e);
value = TREE_CHAIN (value)) value = TREE_CHAIN (value))
; ;
if (value != NULL_TREE) if (value != NULL_TREE)
pp_c_tree_identifier (ppi, TREE_PURPOSE (value)); pp_c_tree_identifier (ppi, TREE_PURPOSE (value));
else else
...@@ -422,18 +382,16 @@ pp_c_enumerator (ppi, e) ...@@ -422,18 +382,16 @@ pp_c_enumerator (ppi, e)
pp_c_right_paren (ppi); pp_c_right_paren (ppi);
return false; return false;
} }
return true; return true;
} }
/* Print out an INTEGER constant value. */ /* Print out an INTEGER constant value. */
static void static void
pp_c_integer_literal (ppi, i) pp_c_integer_literal (c_pretty_printer ppi, tree i)
c_pretty_printer ppi;
tree i;
{ {
tree type = TREE_TYPE (i); tree type = TREE_TYPE (i);
if (type == boolean_type_node) if (type == boolean_type_node)
pp_c_bool_literal (ppi, i); pp_c_bool_literal (ppi, i);
else if (type == char_type_node) else if (type == char_type_node)
...@@ -453,7 +411,7 @@ pp_c_integer_literal (ppi, i) ...@@ -453,7 +411,7 @@ pp_c_integer_literal (ppi, i)
i = build_int_2 (-TREE_INT_CST_LOW (i), i = build_int_2 (-TREE_INT_CST_LOW (i),
~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i)); ~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i));
sprintf (pp_buffer (ppi)->digit_buffer, sprintf (pp_buffer (ppi)->digit_buffer,
HOST_WIDE_INT_PRINT_DOUBLE_HEX, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i)); TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i));
pp_identifier (ppi, pp_buffer (ppi)->digit_buffer); pp_identifier (ppi, pp_buffer (ppi)->digit_buffer);
...@@ -464,9 +422,7 @@ pp_c_integer_literal (ppi, i) ...@@ -464,9 +422,7 @@ pp_c_integer_literal (ppi, i)
/* Print out a REAL value. */ /* Print out a REAL value. */
static inline void static inline void
pp_c_real_literal (ppi, r) pp_c_real_literal (c_pretty_printer ppi, tree r)
c_pretty_printer ppi;
tree r;
{ {
real_to_decimal (pp_buffer (ppi)->digit_buffer, &TREE_REAL_CST (r), real_to_decimal (pp_buffer (ppi)->digit_buffer, &TREE_REAL_CST (r),
sizeof (pp_buffer (ppi)->digit_buffer), 0, 1); sizeof (pp_buffer (ppi)->digit_buffer), 0, 1);
...@@ -475,23 +431,21 @@ pp_c_real_literal (ppi, r) ...@@ -475,23 +431,21 @@ pp_c_real_literal (ppi, r)
void void
pp_c_literal (ppi, e) pp_c_literal (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
switch (TREE_CODE (e)) switch (TREE_CODE (e))
{ {
case INTEGER_CST: case INTEGER_CST:
pp_c_integer_literal (ppi, e); pp_c_integer_literal (ppi, e);
break; break;
case REAL_CST: case REAL_CST:
pp_c_real_literal (ppi, e); pp_c_real_literal (ppi, e);
break; break;
case STRING_CST: case STRING_CST:
pp_c_string_literal (ppi, e); pp_c_string_literal (ppi, e);
break; break;
default: default:
pp_unsupported_tree (ppi, e); pp_unsupported_tree (ppi, e);
...@@ -501,9 +455,7 @@ pp_c_literal (ppi, e) ...@@ -501,9 +455,7 @@ pp_c_literal (ppi, e)
/* Pretty-print a C primary-expression. */ /* Pretty-print a C primary-expression. */
static void static void
pp_c_primary_expression (ppi, e) pp_c_primary_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
switch (TREE_CODE (e)) switch (TREE_CODE (e))
{ {
...@@ -522,7 +474,7 @@ pp_c_primary_expression (ppi, e) ...@@ -522,7 +474,7 @@ pp_c_primary_expression (ppi, e)
case ERROR_MARK: case ERROR_MARK:
pp_c_identifier (ppi, "<erroneous-expression>"); pp_c_identifier (ppi, "<erroneous-expression>");
break; break;
case RESULT_DECL: case RESULT_DECL:
pp_c_identifier (ppi, "<return-value>"); pp_c_identifier (ppi, "<return-value>");
break; break;
...@@ -566,9 +518,7 @@ pp_c_primary_expression (ppi, e) ...@@ -566,9 +518,7 @@ pp_c_primary_expression (ppi, e)
/* Print out a C initializer -- also support C compound-literals. */ /* Print out a C initializer -- also support C compound-literals. */
void void
pp_c_initializer (ppi, e) pp_c_initializer (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == CONSTRUCTOR) if (TREE_CODE (e) == CONSTRUCTOR)
{ {
...@@ -587,9 +537,7 @@ pp_c_initializer (ppi, e) ...@@ -587,9 +537,7 @@ pp_c_initializer (ppi, e)
} }
static void static void
pp_c_initializer_list (ppi, e) pp_c_initializer_list (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
tree type = TREE_TYPE (e); tree type = TREE_TYPE (e);
const enum tree_code code = TREE_CODE (type); const enum tree_code code = TREE_CODE (type);
...@@ -624,9 +572,7 @@ pp_c_initializer_list (ppi, e) ...@@ -624,9 +572,7 @@ pp_c_initializer_list (ppi, e)
} }
void void
pp_c_postfix_expression (ppi, e) pp_c_postfix_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -636,7 +582,7 @@ pp_c_postfix_expression (ppi, e) ...@@ -636,7 +582,7 @@ pp_c_postfix_expression (ppi, e)
pp_postfix_expression (ppi, TREE_OPERAND (e, 0)); pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
pp_identifier (ppi, code == POSTINCREMENT_EXPR ? "++" : "--"); pp_identifier (ppi, code == POSTINCREMENT_EXPR ? "++" : "--");
break; break;
case ARROW_EXPR: case ARROW_EXPR:
pp_postfix_expression (ppi, TREE_OPERAND (e, 0)); pp_postfix_expression (ppi, TREE_OPERAND (e, 0));
pp_arrow (ppi); pp_arrow (ppi);
...@@ -658,7 +604,7 @@ pp_c_postfix_expression (ppi, e) ...@@ -658,7 +604,7 @@ pp_c_postfix_expression (ppi, e)
case ABS_EXPR: case ABS_EXPR:
case FFS_EXPR: case FFS_EXPR:
pp_c_identifier (ppi, pp_c_identifier (ppi,
code == ABS_EXPR ? "__builtin_abs" : "__builtin_ffs"); code == ABS_EXPR ? "__builtin_abs" : "__builtin_ffs");
pp_c_left_paren (ppi); pp_c_left_paren (ppi);
pp_c_expression (ppi, TREE_OPERAND (e, 0)); pp_c_expression (ppi, TREE_OPERAND (e, 0));
...@@ -689,7 +635,7 @@ pp_c_postfix_expression (ppi, e) ...@@ -689,7 +635,7 @@ pp_c_postfix_expression (ppi, e)
pp_type_id (ppi, TREE_TYPE (e)); pp_type_id (ppi, TREE_TYPE (e));
pp_c_right_paren (ppi); pp_c_right_paren (ppi);
pp_left_brace (ppi); pp_left_brace (ppi);
if (code == COMPLEX_CST) if (code == COMPLEX_CST)
{ {
pp_c_expression (ppi, TREE_REALPART (e)); pp_c_expression (ppi, TREE_REALPART (e));
...@@ -704,7 +650,7 @@ pp_c_postfix_expression (ppi, e) ...@@ -704,7 +650,7 @@ pp_c_postfix_expression (ppi, e)
pp_separate_with (ppi, ','); pp_separate_with (ppi, ',');
pp_c_expression (ppi, TREE_OPERAND (e, 1)); pp_c_expression (ppi, TREE_OPERAND (e, 1));
} }
pp_right_brace (ppi); pp_right_brace (ppi);
break; break;
...@@ -714,7 +660,7 @@ pp_c_postfix_expression (ppi, e) ...@@ -714,7 +660,7 @@ pp_c_postfix_expression (ppi, e)
case CONSTRUCTOR: case CONSTRUCTOR:
pp_initializer (ppi, e); pp_initializer (ppi, e);
break; break;
case VA_ARG_EXPR: case VA_ARG_EXPR:
pp_c_identifier (ppi, "__builtin_va_arg"); pp_c_identifier (ppi, "__builtin_va_arg");
pp_c_left_paren (ppi); pp_c_left_paren (ppi);
...@@ -732,9 +678,7 @@ pp_c_postfix_expression (ppi, e) ...@@ -732,9 +678,7 @@ pp_c_postfix_expression (ppi, e)
/* Print out an expression-list; E is expected to be a TREE_LIST */ /* Print out an expression-list; E is expected to be a TREE_LIST */
void void
pp_c_expression_list (ppi, e) pp_c_expression_list (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
for (; e != NULL_TREE; e = TREE_CHAIN (e)) for (; e != NULL_TREE; e = TREE_CHAIN (e))
{ {
...@@ -745,9 +689,7 @@ pp_c_expression_list (ppi, e) ...@@ -745,9 +689,7 @@ pp_c_expression_list (ppi, e)
} }
static void static void
pp_c_unary_expression (ppi, e) pp_c_unary_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -757,7 +699,7 @@ pp_c_unary_expression (ppi, e) ...@@ -757,7 +699,7 @@ pp_c_unary_expression (ppi, e)
pp_identifier (ppi, code == PREINCREMENT_EXPR ? "++" : "--"); pp_identifier (ppi, code == PREINCREMENT_EXPR ? "++" : "--");
pp_c_unary_expression (ppi, TREE_OPERAND (e, 0)); pp_c_unary_expression (ppi, TREE_OPERAND (e, 0));
break; break;
case ADDR_EXPR: case ADDR_EXPR:
case INDIRECT_REF: case INDIRECT_REF:
case CONVERT_EXPR: case CONVERT_EXPR:
...@@ -798,7 +740,7 @@ pp_c_unary_expression (ppi, e) ...@@ -798,7 +740,7 @@ pp_c_unary_expression (ppi, e)
pp_c_whitespace (ppi); pp_c_whitespace (ppi);
pp_unary_expression (ppi, TREE_OPERAND (e, 0)); pp_unary_expression (ppi, TREE_OPERAND (e, 0));
break; break;
default: default:
pp_postfix_expression (ppi, e); pp_postfix_expression (ppi, e);
break; break;
...@@ -806,9 +748,7 @@ pp_c_unary_expression (ppi, e) ...@@ -806,9 +748,7 @@ pp_c_unary_expression (ppi, e)
} }
void void
pp_c_cast_expression (ppi, e) pp_c_cast_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == CONVERT_EXPR || TREE_CODE (e) == FLOAT_EXPR) if (TREE_CODE (e) == CONVERT_EXPR || TREE_CODE (e) == FLOAT_EXPR)
{ {
...@@ -822,9 +762,7 @@ pp_c_cast_expression (ppi, e) ...@@ -822,9 +762,7 @@ pp_c_cast_expression (ppi, e)
} }
static void static void
pp_c_multiplicative_expression (ppi, e) pp_c_multiplicative_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -851,9 +789,7 @@ pp_c_multiplicative_expression (ppi, e) ...@@ -851,9 +789,7 @@ pp_c_multiplicative_expression (ppi, e)
} }
static inline void static inline void
pp_c_additive_expression (ppi, e) pp_c_additive_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -877,9 +813,7 @@ pp_c_additive_expression (ppi, e) ...@@ -877,9 +813,7 @@ pp_c_additive_expression (ppi, e)
} }
static inline void static inline void
pp_c_shift_expression (ppi, e) pp_c_shift_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -899,9 +833,7 @@ pp_c_shift_expression (ppi, e) ...@@ -899,9 +833,7 @@ pp_c_shift_expression (ppi, e)
} }
static void static void
pp_c_relational_expression (ppi, e) pp_c_relational_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -931,9 +863,7 @@ pp_c_relational_expression (ppi, e) ...@@ -931,9 +863,7 @@ pp_c_relational_expression (ppi, e)
} }
static inline void static inline void
pp_c_equality_expression (ppi, e) pp_c_equality_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
enum tree_code code = TREE_CODE (e); enum tree_code code = TREE_CODE (e);
switch (code) switch (code)
...@@ -945,8 +875,8 @@ pp_c_equality_expression (ppi, e) ...@@ -945,8 +875,8 @@ pp_c_equality_expression (ppi, e)
pp_identifier (ppi, code == EQ_EXPR ? "==" : "!="); pp_identifier (ppi, code == EQ_EXPR ? "==" : "!=");
pp_c_whitespace (ppi); pp_c_whitespace (ppi);
pp_c_relational_expression (ppi, TREE_OPERAND (e, 1)); pp_c_relational_expression (ppi, TREE_OPERAND (e, 1));
break; break;
default: default:
pp_c_relational_expression (ppi, e); pp_c_relational_expression (ppi, e);
break; break;
...@@ -954,9 +884,7 @@ pp_c_equality_expression (ppi, e) ...@@ -954,9 +884,7 @@ pp_c_equality_expression (ppi, e)
} }
static inline void static inline void
pp_c_and_expression (ppi, e) pp_c_and_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == BIT_AND_EXPR) if (TREE_CODE (e) == BIT_AND_EXPR)
{ {
...@@ -971,9 +899,7 @@ pp_c_and_expression (ppi, e) ...@@ -971,9 +899,7 @@ pp_c_and_expression (ppi, e)
} }
static inline void static inline void
pp_c_exclusive_or_expression (ppi, e) pp_c_exclusive_or_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == BIT_XOR_EXPR) if (TREE_CODE (e) == BIT_XOR_EXPR)
{ {
...@@ -988,9 +914,7 @@ pp_c_exclusive_or_expression (ppi, e) ...@@ -988,9 +914,7 @@ pp_c_exclusive_or_expression (ppi, e)
} }
static inline void static inline void
pp_c_inclusive_or_expression (ppi, e) pp_c_inclusive_or_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == BIT_IOR_EXPR) if (TREE_CODE (e) == BIT_IOR_EXPR)
{ {
...@@ -1005,9 +929,7 @@ pp_c_inclusive_or_expression (ppi, e) ...@@ -1005,9 +929,7 @@ pp_c_inclusive_or_expression (ppi, e)
} }
static inline void static inline void
pp_c_logical_and_expression (ppi, e) pp_c_logical_and_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == TRUTH_ANDIF_EXPR) if (TREE_CODE (e) == TRUTH_ANDIF_EXPR)
{ {
...@@ -1022,9 +944,7 @@ pp_c_logical_and_expression (ppi, e) ...@@ -1022,9 +944,7 @@ pp_c_logical_and_expression (ppi, e)
} }
void void
pp_c_logical_or_expression (ppi, e) pp_c_logical_or_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == TRUTH_ORIF_EXPR) if (TREE_CODE (e) == TRUTH_ORIF_EXPR)
{ {
...@@ -1039,9 +959,7 @@ pp_c_logical_or_expression (ppi, e) ...@@ -1039,9 +959,7 @@ pp_c_logical_or_expression (ppi, e)
} }
static void static void
pp_c_conditional_expression (ppi, e) pp_c_conditional_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == COND_EXPR) if (TREE_CODE (e) == COND_EXPR)
{ {
...@@ -1062,9 +980,7 @@ pp_c_conditional_expression (ppi, e) ...@@ -1062,9 +980,7 @@ pp_c_conditional_expression (ppi, e)
/* Pretty-print a C assignment-expression. */ /* Pretty-print a C assignment-expression. */
static void static void
pp_c_assignment_expression (ppi, e) pp_c_assignment_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR) if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR)
{ {
...@@ -1080,16 +996,14 @@ pp_c_assignment_expression (ppi, e) ...@@ -1080,16 +996,14 @@ pp_c_assignment_expression (ppi, e)
/* Pretty-print an expression. */ /* Pretty-print an expression. */
void void
pp_c_expression (ppi, e) pp_c_expression (c_pretty_printer ppi, tree e)
c_pretty_printer ppi;
tree e;
{ {
switch (TREE_CODE (e)) switch (TREE_CODE (e))
{ {
case INTEGER_CST: case INTEGER_CST:
pp_c_integer_literal (ppi, e); pp_c_integer_literal (ppi, e);
break; break;
case REAL_CST: case REAL_CST:
pp_c_real_literal (ppi, e); pp_c_real_literal (ppi, e);
break; break;
...@@ -1097,7 +1011,7 @@ pp_c_expression (ppi, e) ...@@ -1097,7 +1011,7 @@ pp_c_expression (ppi, e)
case STRING_CST: case STRING_CST:
pp_c_string_literal (ppi, e); pp_c_string_literal (ppi, e);
break; break;
case FUNCTION_DECL: case FUNCTION_DECL:
case VAR_DECL: case VAR_DECL:
case CONST_DECL: case CONST_DECL:
...@@ -1206,7 +1120,7 @@ pp_c_expression (ppi, e) ...@@ -1206,7 +1120,7 @@ pp_c_expression (ppi, e)
pp_assignment_expression (ppi, TREE_OPERAND (e, 1)); pp_assignment_expression (ppi, TREE_OPERAND (e, 1));
pp_c_right_paren (ppi); pp_c_right_paren (ppi);
break; break;
default: default:
pp_unsupported_tree (ppi, e); pp_unsupported_tree (ppi, e);
...@@ -1217,9 +1131,7 @@ pp_c_expression (ppi, e) ...@@ -1217,9 +1131,7 @@ pp_c_expression (ppi, e)
/* Statements. */ /* Statements. */
void void
pp_c_statement (ppi, stmt) pp_c_statement (c_pretty_printer ppi, tree stmt)
c_pretty_printer ppi;
tree stmt;
{ {
const enum tree_code code = TREE_CODE (stmt); const enum tree_code code = TREE_CODE (stmt);
switch (code) switch (code)
...@@ -1262,7 +1174,7 @@ pp_c_statement (ppi, stmt) ...@@ -1262,7 +1174,7 @@ pp_c_statement (ppi, stmt)
case EXPR_STMT: case EXPR_STMT:
case CLEANUP_STMT: case CLEANUP_STMT:
pp_newline (ppi); pp_newline (ppi);
pp_c_expression (ppi, code == EXPR_STMT pp_c_expression (ppi, code == EXPR_STMT
? EXPR_STMT_EXPR (stmt) ? EXPR_STMT_EXPR (stmt)
: CLEANUP_EXPR (stmt)); : CLEANUP_EXPR (stmt));
pp_semicolon (ppi); pp_semicolon (ppi);
...@@ -1346,7 +1258,7 @@ pp_c_statement (ppi, stmt) ...@@ -1346,7 +1258,7 @@ pp_c_statement (ppi, stmt)
pp_statement (ppi, FOR_BODY (stmt)); pp_statement (ppi, FOR_BODY (stmt));
pp_newline_and_indent (ppi, -3); pp_newline_and_indent (ppi, -3);
break; break;
case BREAK_STMT: case BREAK_STMT:
case CONTINUE_STMT: case CONTINUE_STMT:
pp_newline (ppi); pp_newline (ppi);
...@@ -1358,7 +1270,7 @@ pp_c_statement (ppi, stmt) ...@@ -1358,7 +1270,7 @@ pp_c_statement (ppi, stmt)
case RETURN_STMT: case RETURN_STMT:
case GOTO_STMT: case GOTO_STMT:
{ {
tree e = code == RETURN_STMT tree e = code == RETURN_STMT
? RETURN_STMT_EXPR (stmt) ? RETURN_STMT_EXPR (stmt)
: GOTO_DESTINATION (stmt); : GOTO_DESTINATION (stmt);
...@@ -1396,7 +1308,7 @@ pp_c_statement (ppi, stmt) ...@@ -1396,7 +1308,7 @@ pp_c_statement (ppi, stmt)
case ASM_STMT: case ASM_STMT:
{ {
bool has_volatile_p = ASM_VOLATILE_P (stmt); bool has_volatile_p = ASM_VOLATILE_P (stmt);
bool is_extended = has_volatile_p || ASM_INPUTS (stmt) bool is_extended = has_volatile_p || ASM_INPUTS (stmt)
|| ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt); || ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt);
pp_c_identifier (ppi, is_extended ? "__asm__" : "asm"); pp_c_identifier (ppi, is_extended ? "__asm__" : "asm");
if (has_volatile_p) if (has_volatile_p)
...@@ -1443,8 +1355,7 @@ pp_c_statement (ppi, stmt) ...@@ -1443,8 +1355,7 @@ pp_c_statement (ppi, stmt)
/* Initialize the PRETTY-PRINTER for handling C codes. */ /* Initialize the PRETTY-PRINTER for handling C codes. */
void void
pp_c_pretty_printer_init (pp) pp_c_pretty_printer_init (c_pretty_printer pp)
c_pretty_printer pp;
{ {
pp->offset_list = 0; pp->offset_list = 0;
......
/* Various declarations for the C and C++ pretty-printers. /* Various declarations for the C and C++ pretty-printers.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC. This file is part of GCC.
...@@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
typedef struct c_pretty_print_info *c_pretty_printer; typedef struct c_pretty_print_info *c_pretty_printer;
/* The type of a C pretty-printer 'member' function. */ /* The type of a C pretty-printer 'member' function. */
typedef void (*c_pretty_print_fn) PARAMS ((c_pretty_printer, tree)); typedef void (*c_pretty_print_fn) (c_pretty_printer, tree);
struct c_pretty_print_info struct c_pretty_print_info
{ {
...@@ -144,22 +144,22 @@ struct c_pretty_print_info ...@@ -144,22 +144,22 @@ struct c_pretty_print_info
macro must be overridden by any subclass of c_pretty_print_info. */ macro must be overridden by any subclass of c_pretty_print_info. */
#define pp_c_base(PP) (PP) #define pp_c_base(PP) (PP)
extern void pp_c_pretty_printer_init PARAMS ((c_pretty_printer)); extern void pp_c_pretty_printer_init (c_pretty_printer);
/* Declarations. */ /* Declarations. */
void pp_c_attributes PARAMS ((c_pretty_printer, tree)); void pp_c_attributes (c_pretty_printer, tree);
void pp_c_cv_qualifier PARAMS ((c_pretty_printer, int)); void pp_c_cv_qualifier (c_pretty_printer, int);
void pp_c_parameter_declaration_clause PARAMS ((c_pretty_printer, tree)); void pp_c_parameter_declaration_clause (c_pretty_printer, tree);
void pp_c_declaration PARAMS ((c_pretty_printer, tree)); void pp_c_declaration (c_pretty_printer, tree);
/* Statements. */ /* Statements. */
void pp_c_statement PARAMS ((c_pretty_printer, tree)); void pp_c_statement (c_pretty_printer, tree);
/* Expressions. */ /* Expressions. */
void pp_c_expression PARAMS ((c_pretty_printer, tree)); void pp_c_expression (c_pretty_printer, tree);
void pp_c_logical_or_expression PARAMS ((c_pretty_printer, tree)); void pp_c_logical_or_expression (c_pretty_printer, tree);
void pp_c_expression_list PARAMS ((c_pretty_printer, tree)); void pp_c_expression_list (c_pretty_printer, tree);
void pp_c_cast_expression PARAMS ((c_pretty_printer, tree)); void pp_c_cast_expression (c_pretty_printer, tree);
void pp_c_postfix_expression PARAMS ((c_pretty_printer, tree)); void pp_c_postfix_expression (c_pretty_printer, tree);
void pp_c_initializer PARAMS ((c_pretty_printer, tree)); void pp_c_initializer (c_pretty_printer, tree);
void pp_c_literal PARAMS ((c_pretty_printer, tree)); void pp_c_literal (c_pretty_printer, tree);
#endif /* GCC_C_PRETTY_PRINTER */ #endif /* GCC_C_PRETTY_PRINTER */
/* This file contains the definitions and documentation for the common /* This file contains the definitions and documentation for the common
tree codes used in the GNU C and C++ compilers (see c-common.def tree codes used in the GNU C and C++ compilers (see c-common.def
for the standard codes). for the standard codes).
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Benjamin Chelf (chelf@codesourcery.com). Written by Benjamin Chelf (chelf@codesourcery.com).
...@@ -43,26 +43,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -43,26 +43,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* If non-NULL, the address of a language-specific function for /* If non-NULL, the address of a language-specific function for
expanding statements. */ expanding statements. */
void (*lang_expand_stmt) PARAMS ((tree)); void (*lang_expand_stmt) (tree);
/* If non-NULL, the address of a language-specific function for /* If non-NULL, the address of a language-specific function for
expanding a DECL_STMT. After the language-independent cases are expanding a DECL_STMT. After the language-independent cases are
handled, this function will be called. If this function is not handled, this function will be called. If this function is not
defined, it is assumed that declarations other than those for defined, it is assumed that declarations other than those for
variables and labels do not require any RTL generation. */ variables and labels do not require any RTL generation. */
void (*lang_expand_decl_stmt) PARAMS ((tree)); void (*lang_expand_decl_stmt) (tree);
static tree find_reachable_label_1 PARAMS ((tree *, int *, void *)); static tree find_reachable_label_1 (tree *, int *, void *);
static tree find_reachable_label PARAMS ((tree)); static tree find_reachable_label (tree);
static bool expand_unreachable_if_stmt PARAMS ((tree)); static bool expand_unreachable_if_stmt (tree);
static tree expand_unreachable_stmt PARAMS ((tree, int)); static tree expand_unreachable_stmt (tree, int);
static void genrtl_do_stmt_1 PARAMS ((tree, tree)); static void genrtl_do_stmt_1 (tree, tree);
/* Create an empty statement tree rooted at T. */ /* Create an empty statement tree rooted at T. */
void void
begin_stmt_tree (t) begin_stmt_tree (tree *t)
tree *t;
{ {
/* We create a trivial EXPR_STMT so that last_tree is never NULL in /* We create a trivial EXPR_STMT so that last_tree is never NULL in
what follows. We remove the extraneous statement in what follows. We remove the extraneous statement in
...@@ -76,8 +75,7 @@ begin_stmt_tree (t) ...@@ -76,8 +75,7 @@ begin_stmt_tree (t)
/* T is a statement. Add it to the statement-tree. */ /* T is a statement. Add it to the statement-tree. */
tree tree
add_stmt (t) add_stmt (tree t)
tree t;
{ {
if (input_filename != last_expr_filename) if (input_filename != last_expr_filename)
{ {
...@@ -95,7 +93,7 @@ add_stmt (t) ...@@ -95,7 +93,7 @@ add_stmt (t)
/* Add T to the statement-tree. */ /* Add T to the statement-tree. */
TREE_CHAIN (last_tree) = t; TREE_CHAIN (last_tree) = t;
last_tree = t; last_tree = t;
/* When we expand a statement-tree, we must know whether or not the /* When we expand a statement-tree, we must know whether or not the
statements are full-expressions. We record that fact here. */ statements are full-expressions. We record that fact here. */
STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p (); STMT_IS_FULL_EXPR_P (last_tree) = stmts_are_full_exprs_p ();
...@@ -111,14 +109,13 @@ add_stmt (t) ...@@ -111,14 +109,13 @@ add_stmt (t)
DECL. */ DECL. */
void void
add_decl_stmt (decl) add_decl_stmt (tree decl)
tree decl;
{ {
tree decl_stmt; tree decl_stmt;
/* We need the type to last until instantiation time. */ /* We need the type to last until instantiation time. */
decl_stmt = build_stmt (DECL_STMT, decl); decl_stmt = build_stmt (DECL_STMT, decl);
add_stmt (decl_stmt); add_stmt (decl_stmt);
} }
/* Add a scope-statement to the statement-tree. BEGIN_P indicates /* Add a scope-statement to the statement-tree. BEGIN_P indicates
...@@ -132,9 +129,7 @@ add_decl_stmt (decl) ...@@ -132,9 +129,7 @@ add_decl_stmt (decl)
SCOPE_BEGIN_P set. */ SCOPE_BEGIN_P set. */
tree tree
add_scope_stmt (begin_p, partial_p) add_scope_stmt (int begin_p, int partial_p)
int begin_p;
int partial_p;
{ {
tree *stack_ptr = current_scope_stmt_stack (); tree *stack_ptr = current_scope_stmt_stack ();
tree ss; tree ss;
...@@ -168,11 +163,10 @@ add_scope_stmt (begin_p, partial_p) ...@@ -168,11 +163,10 @@ add_scope_stmt (begin_p, partial_p)
/* Finish the statement tree rooted at T. */ /* Finish the statement tree rooted at T. */
void void
finish_stmt_tree (t) finish_stmt_tree (tree *t)
tree *t;
{ {
tree stmt; tree stmt;
/* Remove the fake extra statement added in begin_stmt_tree. */ /* Remove the fake extra statement added in begin_stmt_tree. */
stmt = TREE_CHAIN (*t); stmt = TREE_CHAIN (*t);
*t = stmt; *t = stmt;
...@@ -200,7 +194,7 @@ build_stmt (enum tree_code code, ...) ...@@ -200,7 +194,7 @@ build_stmt (enum tree_code code, ...)
int length; int length;
int i; int i;
va_list p; va_list p;
va_start (p, code); va_start (p, code);
t = make_node (code); t = make_node (code);
...@@ -220,23 +214,21 @@ build_stmt (enum tree_code code, ...) ...@@ -220,23 +214,21 @@ build_stmt (enum tree_code code, ...)
as the condition is returned. Otherwise, T itself is returned. */ as the condition is returned. Otherwise, T itself is returned. */
tree tree
expand_cond (t) expand_cond (tree t)
tree t;
{ {
if (t && TREE_CODE (t) == TREE_LIST) if (t && TREE_CODE (t) == TREE_LIST)
{ {
expand_stmt (TREE_PURPOSE (t)); expand_stmt (TREE_PURPOSE (t));
return TREE_VALUE (t); return TREE_VALUE (t);
} }
else else
return t; return t;
} }
/* Create RTL for the local static variable DECL. */ /* Create RTL for the local static variable DECL. */
void void
make_rtl_for_local_static (decl) make_rtl_for_local_static (tree decl)
tree decl;
{ {
const char *asmspec = NULL; const char *asmspec = NULL;
...@@ -271,8 +263,7 @@ make_rtl_for_local_static (decl) ...@@ -271,8 +263,7 @@ make_rtl_for_local_static (decl)
/* Let the back-end know about DECL. */ /* Let the back-end know about DECL. */
void void
emit_local_var (decl) emit_local_var (tree decl)
tree decl;
{ {
/* Create RTL for this variable. */ /* Create RTL for this variable. */
if (!DECL_RTL_SET_P (decl)) if (!DECL_RTL_SET_P (decl))
...@@ -303,7 +294,7 @@ emit_local_var (decl) ...@@ -303,7 +294,7 @@ emit_local_var (decl)
/* Helper for generating the RTL at the beginning of a scope. */ /* Helper for generating the RTL at the beginning of a scope. */
void void
genrtl_do_pushlevel () genrtl_do_pushlevel (void)
{ {
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
clear_last_expr (); clear_last_expr ();
...@@ -312,23 +303,22 @@ genrtl_do_pushlevel () ...@@ -312,23 +303,22 @@ genrtl_do_pushlevel ()
/* Generate the RTL for DESTINATION, which is a GOTO_STMT. */ /* Generate the RTL for DESTINATION, which is a GOTO_STMT. */
void void
genrtl_goto_stmt (destination) genrtl_goto_stmt (tree destination)
tree destination;
{ {
if (TREE_CODE (destination) == IDENTIFIER_NODE) if (TREE_CODE (destination) == IDENTIFIER_NODE)
abort (); abort ();
/* We warn about unused labels with -Wunused. That means we have to /* We warn about unused labels with -Wunused. That means we have to
mark the used labels as used. */ mark the used labels as used. */
if (TREE_CODE (destination) == LABEL_DECL) if (TREE_CODE (destination) == LABEL_DECL)
TREE_USED (destination) = 1; TREE_USED (destination) = 1;
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
if (TREE_CODE (destination) == LABEL_DECL) if (TREE_CODE (destination) == LABEL_DECL)
{ {
label_rtx (destination); label_rtx (destination);
expand_goto (destination); expand_goto (destination);
} }
else else
expand_computed_goto (destination); expand_computed_goto (destination);
...@@ -339,8 +329,7 @@ genrtl_goto_stmt (destination) ...@@ -339,8 +329,7 @@ genrtl_goto_stmt (destination)
used for new code. */ used for new code. */
void void
genrtl_expr_stmt (expr) genrtl_expr_stmt (tree expr)
tree expr;
{ {
genrtl_expr_stmt_value (expr, -1, 1); genrtl_expr_stmt_value (expr, -1, 1);
} }
...@@ -352,21 +341,19 @@ genrtl_expr_stmt (expr) ...@@ -352,21 +341,19 @@ genrtl_expr_stmt (expr)
MAYBE_LAST is nonzero if this EXPR_STMT might be the last statement MAYBE_LAST is nonzero if this EXPR_STMT might be the last statement
in expression statement. */ in expression statement. */
void void
genrtl_expr_stmt_value (expr, want_value, maybe_last) genrtl_expr_stmt_value (tree expr, int want_value, int maybe_last)
tree expr;
int want_value, maybe_last;
{ {
if (expr != NULL_TREE) if (expr != NULL_TREE)
{ {
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
if (stmts_are_full_exprs_p ()) if (stmts_are_full_exprs_p ())
expand_start_target_temps (); expand_start_target_temps ();
if (expr != error_mark_node) if (expr != error_mark_node)
expand_expr_stmt_value (expr, want_value, maybe_last); expand_expr_stmt_value (expr, want_value, maybe_last);
if (stmts_are_full_exprs_p ()) if (stmts_are_full_exprs_p ())
expand_end_target_temps (); expand_end_target_temps ();
} }
...@@ -375,8 +362,7 @@ genrtl_expr_stmt_value (expr, want_value, maybe_last) ...@@ -375,8 +362,7 @@ genrtl_expr_stmt_value (expr, want_value, maybe_last)
/* Generate the RTL for T, which is a DECL_STMT. */ /* Generate the RTL for T, which is a DECL_STMT. */
void void
genrtl_decl_stmt (t) genrtl_decl_stmt (tree t)
tree t;
{ {
tree decl; tree decl;
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
...@@ -387,7 +373,7 @@ genrtl_decl_stmt (t) ...@@ -387,7 +373,7 @@ genrtl_decl_stmt (t)
`extern'). We don't have to handle the initialization `extern'). We don't have to handle the initialization
of those objects here; they can only be declarations, of those objects here; they can only be declarations,
rather than definitions. */ rather than definitions. */
if (TREE_CODE (decl) == VAR_DECL if (TREE_CODE (decl) == VAR_DECL
&& !TREE_STATIC (decl) && !TREE_STATIC (decl)
&& !DECL_EXTERNAL (decl)) && !DECL_EXTERNAL (decl))
{ {
...@@ -395,12 +381,12 @@ genrtl_decl_stmt (t) ...@@ -395,12 +381,12 @@ genrtl_decl_stmt (t)
if (!anon_aggr_type_p (TREE_TYPE (decl))) if (!anon_aggr_type_p (TREE_TYPE (decl)))
emit_local_var (decl); emit_local_var (decl);
else else
expand_anon_union_decl (decl, NULL_TREE, expand_anon_union_decl (decl, NULL_TREE,
DECL_ANON_UNION_ELEMS (decl)); DECL_ANON_UNION_ELEMS (decl));
} }
else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) else if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
make_rtl_for_local_static (decl); make_rtl_for_local_static (decl);
else if (TREE_CODE (decl) == LABEL_DECL else if (TREE_CODE (decl) == LABEL_DECL
&& C_DECLARED_LABEL_FLAG (decl)) && C_DECLARED_LABEL_FLAG (decl))
declare_nonlocal_label (decl); declare_nonlocal_label (decl);
else if (lang_expand_decl_stmt) else if (lang_expand_decl_stmt)
...@@ -410,8 +396,7 @@ genrtl_decl_stmt (t) ...@@ -410,8 +396,7 @@ genrtl_decl_stmt (t)
/* Generate the RTL for T, which is an IF_STMT. */ /* Generate the RTL for T, which is an IF_STMT. */
void void
genrtl_if_stmt (t) genrtl_if_stmt (tree t)
tree t;
{ {
tree cond; tree cond;
genrtl_do_pushlevel (); genrtl_do_pushlevel ();
...@@ -421,7 +406,7 @@ genrtl_if_stmt (t) ...@@ -421,7 +406,7 @@ genrtl_if_stmt (t)
if (THEN_CLAUSE (t)) if (THEN_CLAUSE (t))
{ {
tree nextt = THEN_CLAUSE (t); tree nextt = THEN_CLAUSE (t);
if (cond && integer_zerop (cond)) if (cond && integer_zerop (cond))
nextt = expand_unreachable_stmt (nextt, warn_notreached); nextt = expand_unreachable_stmt (nextt, warn_notreached);
expand_stmt (nextt); expand_stmt (nextt);
...@@ -441,14 +426,13 @@ genrtl_if_stmt (t) ...@@ -441,14 +426,13 @@ genrtl_if_stmt (t)
/* Generate the RTL for T, which is a WHILE_STMT. */ /* Generate the RTL for T, which is a WHILE_STMT. */
void void
genrtl_while_stmt (t) genrtl_while_stmt (tree t)
tree t;
{ {
tree cond = WHILE_COND (t); tree cond = WHILE_COND (t);
emit_nop (); emit_nop ();
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
expand_start_loop (1); expand_start_loop (1);
genrtl_do_pushlevel (); genrtl_do_pushlevel ();
if (cond && !integer_nonzerop (cond)) if (cond && !integer_nonzerop (cond))
...@@ -458,7 +442,7 @@ genrtl_while_stmt (t) ...@@ -458,7 +442,7 @@ genrtl_while_stmt (t)
expand_exit_loop_top_cond (0, cond); expand_exit_loop_top_cond (0, cond);
genrtl_do_pushlevel (); genrtl_do_pushlevel ();
} }
expand_stmt (WHILE_BODY (t)); expand_stmt (WHILE_BODY (t));
expand_end_loop (); expand_end_loop ();
...@@ -468,8 +452,7 @@ genrtl_while_stmt (t) ...@@ -468,8 +452,7 @@ genrtl_while_stmt (t)
body. This is reused for expanding unreachable WHILE_STMTS. */ body. This is reused for expanding unreachable WHILE_STMTS. */
static void static void
genrtl_do_stmt_1 (cond, body) genrtl_do_stmt_1 (tree cond, tree body)
tree cond, body;
{ {
/* Recognize the common special-case of do { ... } while (0) and do /* Recognize the common special-case of do { ... } while (0) and do
not emit the loop widgetry in this case. In particular this not emit the loop widgetry in this case. In particular this
...@@ -512,8 +495,7 @@ genrtl_do_stmt_1 (cond, body) ...@@ -512,8 +495,7 @@ genrtl_do_stmt_1 (cond, body)
/* Generate the RTL for T, which is a DO_STMT. */ /* Generate the RTL for T, which is a DO_STMT. */
void void
genrtl_do_stmt (t) genrtl_do_stmt (tree t)
tree t;
{ {
genrtl_do_stmt_1 (DO_COND (t), DO_BODY (t)); genrtl_do_stmt_1 (DO_COND (t), DO_BODY (t));
} }
...@@ -521,8 +503,7 @@ genrtl_do_stmt (t) ...@@ -521,8 +503,7 @@ genrtl_do_stmt (t)
/* Build the node for a return statement and return it. */ /* Build the node for a return statement and return it. */
tree tree
build_return_stmt (expr) build_return_stmt (tree expr)
tree expr;
{ {
return (build_stmt (RETURN_STMT, expr)); return (build_stmt (RETURN_STMT, expr));
} }
...@@ -530,8 +511,7 @@ build_return_stmt (expr) ...@@ -530,8 +511,7 @@ build_return_stmt (expr)
/* Generate the RTL for STMT, which is a RETURN_STMT. */ /* Generate the RTL for STMT, which is a RETURN_STMT. */
void void
genrtl_return_stmt (stmt) genrtl_return_stmt (tree stmt)
tree stmt;
{ {
tree expr; tree expr;
...@@ -551,8 +531,7 @@ genrtl_return_stmt (stmt) ...@@ -551,8 +531,7 @@ genrtl_return_stmt (stmt)
/* Generate the RTL for T, which is a FOR_STMT. */ /* Generate the RTL for T, which is a FOR_STMT. */
void void
genrtl_for_stmt (t) genrtl_for_stmt (tree t)
tree t;
{ {
tree cond = FOR_COND (t); tree cond = FOR_COND (t);
location_t saved_loc; location_t saved_loc;
...@@ -566,7 +545,7 @@ genrtl_for_stmt (t) ...@@ -566,7 +545,7 @@ genrtl_for_stmt (t)
emit_nop (); emit_nop ();
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
if (FOR_EXPR (t)) if (FOR_EXPR (t))
expand_start_loop_continue_elsewhere (1); expand_start_loop_continue_elsewhere (1);
else else
expand_start_loop (1); expand_start_loop (1);
genrtl_do_pushlevel (); genrtl_do_pushlevel ();
...@@ -601,7 +580,7 @@ genrtl_for_stmt (t) ...@@ -601,7 +580,7 @@ genrtl_for_stmt (t)
/* Build a break statement node and return it. */ /* Build a break statement node and return it. */
tree tree
build_break_stmt () build_break_stmt (void)
{ {
return (build_stmt (BREAK_STMT)); return (build_stmt (BREAK_STMT));
} }
...@@ -609,7 +588,7 @@ build_break_stmt () ...@@ -609,7 +588,7 @@ build_break_stmt ()
/* Generate the RTL for a BREAK_STMT. */ /* Generate the RTL for a BREAK_STMT. */
void void
genrtl_break_stmt () genrtl_break_stmt (void)
{ {
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
if ( ! expand_exit_something ()) if ( ! expand_exit_something ())
...@@ -619,7 +598,7 @@ genrtl_break_stmt () ...@@ -619,7 +598,7 @@ genrtl_break_stmt ()
/* Build a continue statement node and return it. */ /* Build a continue statement node and return it. */
tree tree
build_continue_stmt () build_continue_stmt (void)
{ {
return (build_stmt (CONTINUE_STMT)); return (build_stmt (CONTINUE_STMT));
} }
...@@ -627,18 +606,17 @@ build_continue_stmt () ...@@ -627,18 +606,17 @@ build_continue_stmt ()
/* Generate the RTL for a CONTINUE_STMT. */ /* Generate the RTL for a CONTINUE_STMT. */
void void
genrtl_continue_stmt () genrtl_continue_stmt (void)
{ {
emit_line_note (input_filename, input_line); emit_line_note (input_filename, input_line);
if (! expand_continue_loop (0)) if (! expand_continue_loop (0))
error ("continue statement not within a loop"); error ("continue statement not within a loop");
} }
/* Generate the RTL for T, which is a SCOPE_STMT. */ /* Generate the RTL for T, which is a SCOPE_STMT. */
void void
genrtl_scope_stmt (t) genrtl_scope_stmt (tree t)
tree t;
{ {
tree block = SCOPE_STMT_BLOCK (t); tree block = SCOPE_STMT_BLOCK (t);
...@@ -652,7 +630,7 @@ genrtl_scope_stmt (t) ...@@ -652,7 +630,7 @@ genrtl_scope_stmt (t)
else if (!SCOPE_NULLIFIED_P (t)) else if (!SCOPE_NULLIFIED_P (t))
{ {
rtx note = emit_note (NULL, rtx note = emit_note (NULL,
(SCOPE_BEGIN_P (t) (SCOPE_BEGIN_P (t)
? NOTE_INSN_BLOCK_BEG ? NOTE_INSN_BLOCK_BEG
: NOTE_INSN_BLOCK_END)); : NOTE_INSN_BLOCK_END));
NOTE_BLOCK (note) = block; NOTE_BLOCK (note) = block;
...@@ -666,7 +644,7 @@ genrtl_scope_stmt (t) ...@@ -666,7 +644,7 @@ genrtl_scope_stmt (t)
for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn)) for (fn = BLOCK_VARS (block); fn; fn = TREE_CHAIN (fn))
{ {
if (TREE_CODE (fn) == FUNCTION_DECL if (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_CONTEXT (fn) == current_function_decl && DECL_CONTEXT (fn) == current_function_decl
&& DECL_SAVED_INSNS (fn) && DECL_SAVED_INSNS (fn)
&& !TREE_ASM_WRITTEN (fn) && !TREE_ASM_WRITTEN (fn)
...@@ -683,12 +661,11 @@ genrtl_scope_stmt (t) ...@@ -683,12 +661,11 @@ genrtl_scope_stmt (t)
/* Generate the RTL for T, which is a SWITCH_STMT. */ /* Generate the RTL for T, which is a SWITCH_STMT. */
void void
genrtl_switch_stmt (t) genrtl_switch_stmt (tree t)
tree t;
{ {
tree cond; tree cond;
genrtl_do_pushlevel (); genrtl_do_pushlevel ();
cond = expand_cond (SWITCH_COND (t)); cond = expand_cond (SWITCH_COND (t));
if (cond == error_mark_node) if (cond == error_mark_node)
/* The code is in error, but we don't want expand_end_case to /* The code is in error, but we don't want expand_end_case to
...@@ -704,10 +681,7 @@ genrtl_switch_stmt (t) ...@@ -704,10 +681,7 @@ genrtl_switch_stmt (t)
/* Create a CASE_LABEL tree node and return it. */ /* Create a CASE_LABEL tree node and return it. */
tree tree
build_case_label (low_value, high_value, label_decl) build_case_label (tree low_value, tree high_value, tree label_decl)
tree low_value;
tree high_value;
tree label_decl;
{ {
return build_stmt (CASE_LABEL, low_value, high_value, label_decl); return build_stmt (CASE_LABEL, low_value, high_value, label_decl);
} }
...@@ -715,9 +689,8 @@ build_case_label (low_value, high_value, label_decl) ...@@ -715,9 +689,8 @@ build_case_label (low_value, high_value, label_decl)
/* Generate the RTL for a CASE_LABEL. */ /* Generate the RTL for a CASE_LABEL. */
void void
genrtl_case_label (case_label) genrtl_case_label (tree case_label)
tree case_label;
{ {
tree duplicate; tree duplicate;
tree cleanup; tree cleanup;
...@@ -735,15 +708,14 @@ genrtl_case_label (case_label) ...@@ -735,15 +708,14 @@ genrtl_case_label (case_label)
} }
} }
add_case_node (CASE_LOW (case_label), CASE_HIGH (case_label), add_case_node (CASE_LOW (case_label), CASE_HIGH (case_label),
CASE_LABEL_DECL (case_label), &duplicate); CASE_LABEL_DECL (case_label), &duplicate);
} }
/* Generate the RTL for T, which is a COMPOUND_STMT. */ /* Generate the RTL for T, which is a COMPOUND_STMT. */
void void
genrtl_compound_stmt (t) genrtl_compound_stmt (tree t)
tree t;
{ {
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
struct nesting *n = current_nesting_level (); struct nesting *n = current_nesting_level ();
...@@ -761,14 +733,8 @@ genrtl_compound_stmt (t) ...@@ -761,14 +733,8 @@ genrtl_compound_stmt (t)
/* Generate the RTL for an ASM_STMT. */ /* Generate the RTL for an ASM_STMT. */
void void
genrtl_asm_stmt (cv_qualifier, string, output_operands, genrtl_asm_stmt (tree cv_qualifier, tree string, tree output_operands,
input_operands, clobbers, asm_input_p) tree input_operands, tree clobbers, int asm_input_p)
tree cv_qualifier;
tree string;
tree output_operands;
tree input_operands;
tree clobbers;
int asm_input_p;
{ {
if (cv_qualifier != NULL_TREE if (cv_qualifier != NULL_TREE
&& cv_qualifier != ridpointers[(int) RID_VOLATILE]) && cv_qualifier != ridpointers[(int) RID_VOLATILE])
...@@ -782,16 +748,15 @@ genrtl_asm_stmt (cv_qualifier, string, output_operands, ...@@ -782,16 +748,15 @@ genrtl_asm_stmt (cv_qualifier, string, output_operands,
if (asm_input_p) if (asm_input_p)
expand_asm (string, cv_qualifier != NULL_TREE); expand_asm (string, cv_qualifier != NULL_TREE);
else else
c_expand_asm_operands (string, output_operands, input_operands, c_expand_asm_operands (string, output_operands, input_operands,
clobbers, cv_qualifier != NULL_TREE, clobbers, cv_qualifier != NULL_TREE,
input_filename, input_line); input_filename, input_line);
} }
/* Generate the RTL for a CLEANUP_STMT. */ /* Generate the RTL for a CLEANUP_STMT. */
void void
genrtl_cleanup_stmt (t) genrtl_cleanup_stmt (tree t)
tree t;
{ {
tree decl = CLEANUP_DECL (t); tree decl = CLEANUP_DECL (t);
if (!decl || (DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node)) if (!decl || (DECL_SIZE (decl) && TREE_TYPE (decl) != error_mark_node))
...@@ -802,8 +767,7 @@ genrtl_cleanup_stmt (t) ...@@ -802,8 +767,7 @@ genrtl_cleanup_stmt (t)
for the substitution. */ for the substitution. */
void void
prep_stmt (t) prep_stmt (tree t)
tree t;
{ {
if (!STMT_LINENO_FOR_FN_P (t)) if (!STMT_LINENO_FOR_FN_P (t))
input_line = STMT_LINENO (t); input_line = STMT_LINENO (t);
...@@ -814,8 +778,7 @@ prep_stmt (t) ...@@ -814,8 +778,7 @@ prep_stmt (t)
other statements at its nesting level. */ other statements at its nesting level. */
void void
expand_stmt (t) expand_stmt (tree t)
tree t;
{ {
while (t && t != error_mark_node) while (t && t != error_mark_node)
{ {
...@@ -920,7 +883,7 @@ expand_stmt (t) ...@@ -920,7 +883,7 @@ expand_stmt (t)
default: default:
if (lang_expand_stmt) if (lang_expand_stmt)
(*lang_expand_stmt) (t); (*lang_expand_stmt) (t);
else else
abort (); abort ();
break; break;
} }
...@@ -938,10 +901,8 @@ expand_stmt (t) ...@@ -938,10 +901,8 @@ expand_stmt (t)
/* If *TP is a potentially reachable label, return nonzero. */ /* If *TP is a potentially reachable label, return nonzero. */
static tree static tree
find_reachable_label_1 (tp, walk_subtrees, data) find_reachable_label_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
tree *tp; void *data ATTRIBUTE_UNUSED)
int *walk_subtrees ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{ {
switch (TREE_CODE (*tp)) switch (TREE_CODE (*tp))
{ {
...@@ -958,8 +919,7 @@ find_reachable_label_1 (tp, walk_subtrees, data) ...@@ -958,8 +919,7 @@ find_reachable_label_1 (tp, walk_subtrees, data)
/* Determine whether expression EXP contains a potentially /* Determine whether expression EXP contains a potentially
reachable label. */ reachable label. */
static tree static tree
find_reachable_label (exp) find_reachable_label (tree exp)
tree exp;
{ {
location_t saved_loc = input_location; location_t saved_loc = input_location;
tree ret = walk_tree (&exp, find_reachable_label_1, NULL, NULL); tree ret = walk_tree (&exp, find_reachable_label_1, NULL, NULL);
...@@ -970,11 +930,10 @@ find_reachable_label (exp) ...@@ -970,11 +930,10 @@ find_reachable_label (exp)
/* Expand an unreachable if statement, T. This function returns /* Expand an unreachable if statement, T. This function returns
true if the IF_STMT contains a potentially reachable code_label. */ true if the IF_STMT contains a potentially reachable code_label. */
static bool static bool
expand_unreachable_if_stmt (t) expand_unreachable_if_stmt (tree t)
tree t;
{ {
tree n; tree n;
if (find_reachable_label (IF_COND (t)) != NULL_TREE) if (find_reachable_label (IF_COND (t)) != NULL_TREE)
{ {
genrtl_if_stmt (t); genrtl_if_stmt (t);
...@@ -984,7 +943,7 @@ expand_unreachable_if_stmt (t) ...@@ -984,7 +943,7 @@ expand_unreachable_if_stmt (t)
if (THEN_CLAUSE (t) && ELSE_CLAUSE (t)) if (THEN_CLAUSE (t) && ELSE_CLAUSE (t))
{ {
n = expand_unreachable_stmt (THEN_CLAUSE (t), 0); n = expand_unreachable_stmt (THEN_CLAUSE (t), 0);
if (n != NULL_TREE) if (n != NULL_TREE)
{ {
rtx label; rtx label;
...@@ -1004,9 +963,9 @@ expand_unreachable_if_stmt (t) ...@@ -1004,9 +963,9 @@ expand_unreachable_if_stmt (t)
n = expand_unreachable_stmt (ELSE_CLAUSE (t), 0); n = expand_unreachable_stmt (ELSE_CLAUSE (t), 0);
else else
n = NULL_TREE; n = NULL_TREE;
expand_stmt (n); expand_stmt (n);
return n != NULL_TREE; return n != NULL_TREE;
} }
...@@ -1015,9 +974,7 @@ expand_unreachable_if_stmt (t) ...@@ -1015,9 +974,7 @@ expand_unreachable_if_stmt (t)
then returns the label (or, in same cases, the statement after then returns the label (or, in same cases, the statement after
one containing the label). */ one containing the label). */
static tree static tree
expand_unreachable_stmt (t, warn) expand_unreachable_stmt (tree t, int warn)
tree t;
int warn;
{ {
int saved; int saved;
...@@ -1102,4 +1059,3 @@ expand_unreachable_stmt (t, warn) ...@@ -1102,4 +1059,3 @@ expand_unreachable_stmt (t, warn)
} }
return NULL_TREE; return NULL_TREE;
} }
...@@ -153,90 +153,88 @@ struct lang_type GTY(()) ...@@ -153,90 +153,88 @@ struct lang_type GTY(())
/* in c-lang.c and objc-act.c */ /* in c-lang.c and objc-act.c */
extern tree lookup_interface PARAMS ((tree)); extern tree lookup_interface (tree);
extern tree is_class_name PARAMS ((tree)); extern tree is_class_name (tree);
extern tree objc_is_id PARAMS ((tree)); extern tree objc_is_id (tree);
extern void objc_check_decl PARAMS ((tree)); extern void objc_check_decl (tree);
extern void finish_file PARAMS ((void)); extern void finish_file (void);
extern int objc_comptypes PARAMS ((tree, tree, int)); extern int objc_comptypes (tree, tree, int);
extern tree objc_message_selector PARAMS ((void)); extern tree objc_message_selector (void);
extern tree lookup_objc_ivar PARAMS ((tree)); extern tree lookup_objc_ivar (tree);
extern void c_expand_body PARAMS ((tree)); extern void c_expand_body (tree);
/* in c-parse.in */ /* in c-parse.in */
extern void c_parse_init PARAMS ((void)); extern void c_parse_init (void);
/* in c-aux-info.c */ /* in c-aux-info.c */
extern void gen_aux_info_record PARAMS ((tree, int, int, int)); extern void gen_aux_info_record (tree, int, int, int);
/* in c-decl.c */ /* in c-decl.c */
extern int global_bindings_p PARAMS ((void)); extern int global_bindings_p (void);
extern int kept_level_p PARAMS ((void)); extern int kept_level_p (void);
extern tree getdecls PARAMS ((void)); extern tree getdecls (void);
extern void pushlevel PARAMS ((int)); extern void pushlevel (int);
extern void insert_block PARAMS ((tree)); extern void insert_block (tree);
extern void set_block PARAMS ((tree)); extern void set_block (tree);
extern tree pushdecl PARAMS ((tree)); extern tree pushdecl (tree);
extern void c_insert_default_attributes PARAMS ((tree)); extern void c_insert_default_attributes (tree);
extern void c_init_decl_processing PARAMS ((void)); extern void c_init_decl_processing (void);
extern void c_dup_lang_specific_decl PARAMS ((tree)); extern void c_dup_lang_specific_decl (tree);
extern void c_print_identifier PARAMS ((FILE *, tree, int)); extern void c_print_identifier (FILE *, tree, int);
extern tree build_array_declarator PARAMS ((tree, tree, int, int)); extern tree build_array_declarator (tree, tree, int, int);
extern tree build_enumerator PARAMS ((tree, tree)); extern tree build_enumerator (tree, tree);
extern void check_for_loop_decls PARAMS ((void)); extern void check_for_loop_decls (void);
extern void clear_parm_order PARAMS ((void)); extern void clear_parm_order (void);
extern int complete_array_type PARAMS ((tree, tree, int)); extern int complete_array_type (tree, tree, int);
extern void declare_parm_level PARAMS ((int)); extern void declare_parm_level (int);
extern tree define_label PARAMS ((const char *, int, extern tree define_label (const char *, int, tree);
tree)); extern void finish_decl (tree, tree, tree);
extern void finish_decl PARAMS ((tree, tree, tree)); extern tree finish_enum (tree, tree, tree);
extern tree finish_enum PARAMS ((tree, tree, tree)); extern void finish_function (int, int);
extern void finish_function PARAMS ((int, int)); extern tree finish_struct (tree, tree, tree);
extern tree finish_struct PARAMS ((tree, tree, tree)); extern tree get_parm_info (int);
extern tree get_parm_info PARAMS ((int)); extern tree grokfield (const char *, int, tree, tree, tree);
extern tree grokfield PARAMS ((const char *, int, tree, tree, tree)); extern tree groktypename (tree);
extern tree groktypename PARAMS ((tree)); extern tree groktypename_in_parm_context (tree);
extern tree groktypename_in_parm_context PARAMS ((tree)); extern tree implicitly_declare (tree);
extern tree implicitly_declare PARAMS ((tree)); extern int in_parm_level_p (void);
extern int in_parm_level_p PARAMS ((void)); extern void keep_next_level (void);
extern void keep_next_level PARAMS ((void)); extern tree lookup_name (tree);
extern tree lookup_name PARAMS ((tree)); extern void parmlist_tags_warning (void);
extern void parmlist_tags_warning PARAMS ((void)); extern void pending_xref_error (void);
extern void pending_xref_error PARAMS ((void)); extern void c_push_function_context (struct function *);
extern void c_push_function_context PARAMS ((struct function *)); extern void c_pop_function_context (struct function *);
extern void c_pop_function_context PARAMS ((struct function *)); extern void pop_label_level (void);
extern void pop_label_level PARAMS ((void)); extern void push_label_level (void);
extern void push_label_level PARAMS ((void)); extern void push_parm_decl (tree);
extern void push_parm_decl PARAMS ((tree)); extern tree pushdecl_top_level (tree);
extern tree pushdecl_top_level PARAMS ((tree)); extern tree pushdecl_function_level (tree, tree);
extern tree pushdecl_function_level PARAMS ((tree, tree)); extern void pushtag (tree, tree);
extern void pushtag PARAMS ((tree, tree)); extern tree set_array_declarator_type (tree, tree, int);
extern tree set_array_declarator_type PARAMS ((tree, tree, int)); extern tree shadow_label (tree);
extern tree shadow_label PARAMS ((tree)); extern void shadow_tag (tree);
extern void shadow_tag PARAMS ((tree)); extern void shadow_tag_warned (tree, int);
extern void shadow_tag_warned PARAMS ((tree, int)); extern tree start_enum (tree);
extern tree start_enum PARAMS ((tree)); extern int start_function (tree, tree, tree);
extern int start_function PARAMS ((tree, tree, tree)); extern tree start_decl (tree, tree, int, tree);
extern tree start_decl PARAMS ((tree, tree, int, extern tree start_struct (enum tree_code, tree);
tree)); extern void store_parm_decls (void);
extern tree start_struct PARAMS ((enum tree_code, tree)); extern tree xref_tag (enum tree_code, tree);
extern void store_parm_decls PARAMS ((void)); extern tree c_begin_compound_stmt (void);
extern tree xref_tag PARAMS ((enum tree_code, tree)); extern void c_expand_deferred_function (tree);
extern tree c_begin_compound_stmt PARAMS ((void)); extern void c_expand_decl_stmt (tree);
extern void c_expand_deferred_function PARAMS ((tree)); extern tree make_pointer_declarator (tree, tree);
extern void c_expand_decl_stmt PARAMS ((tree));
extern tree make_pointer_declarator PARAMS ((tree, tree));
/* in c-objc-common.c */ /* in c-objc-common.c */
extern int c_disregard_inline_limits PARAMS ((tree)); extern int c_disregard_inline_limits (tree);
extern int c_cannot_inline_tree_fn PARAMS ((tree *)); extern int c_cannot_inline_tree_fn (tree *);
extern bool c_objc_common_init PARAMS ((void)); extern bool c_objc_common_init (void);
extern int c_missing_noreturn_ok_p PARAMS ((tree)); extern int c_missing_noreturn_ok_p (tree);
extern void c_objc_common_finish_file PARAMS ((void)); extern void c_objc_common_finish_file (void);
extern int defer_fn PARAMS ((tree)); extern int defer_fn (tree);
extern bool c_warn_unused_global_decl PARAMS ((tree)); extern bool c_warn_unused_global_decl (tree);
#define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \ #define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \
c_build_qualified_type ((TYPE), \ c_build_qualified_type ((TYPE), \
...@@ -245,46 +243,42 @@ extern bool c_warn_unused_global_decl PARAMS ((tree)); ...@@ -245,46 +243,42 @@ extern bool c_warn_unused_global_decl PARAMS ((tree));
#define c_sizeof_nowarn(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 0) #define c_sizeof_nowarn(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 0)
/* in c-typeck.c */ /* in c-typeck.c */
extern tree require_complete_type PARAMS ((tree)); extern tree require_complete_type (tree);
extern int comptypes PARAMS ((tree, tree)); extern int comptypes (tree, tree);
extern tree c_size_in_bytes PARAMS ((tree)); extern tree c_size_in_bytes (tree);
extern bool c_mark_addressable PARAMS ((tree)); extern bool c_mark_addressable (tree);
extern void c_incomplete_type_error PARAMS ((tree, tree)); extern void c_incomplete_type_error (tree, tree);
extern tree c_type_promotes_to PARAMS ((tree)); extern tree c_type_promotes_to (tree);
extern tree build_component_ref PARAMS ((tree, tree)); extern tree build_component_ref (tree, tree);
extern tree build_indirect_ref PARAMS ((tree, const char *)); extern tree build_indirect_ref (tree, const char *);
extern tree build_array_ref PARAMS ((tree, tree)); extern tree build_array_ref (tree, tree);
extern tree build_external_ref PARAMS ((tree, int)); extern tree build_external_ref (tree, int);
extern tree parser_build_binary_op PARAMS ((enum tree_code, extern tree parser_build_binary_op (enum tree_code, tree, tree);
tree, tree)); extern int c_tree_expr_nonnegative_p (tree);
extern int c_tree_expr_nonnegative_p PARAMS ((tree)); extern void readonly_warning (tree, const char *);
extern void readonly_warning PARAMS ((tree, const char *)); extern tree build_conditional_expr (tree, tree, tree);
extern tree build_conditional_expr PARAMS ((tree, tree, tree)); extern tree build_compound_expr (tree);
extern tree build_compound_expr PARAMS ((tree)); extern tree c_cast_expr (tree, tree);
extern tree c_cast_expr PARAMS ((tree, tree)); extern tree build_c_cast (tree, tree);
extern tree build_c_cast PARAMS ((tree, tree)); extern tree build_modify_expr (tree, enum tree_code, tree);
extern tree build_modify_expr PARAMS ((tree, enum tree_code, extern void store_init_value (tree, tree);
tree)); extern void error_init (const char *);
extern void store_init_value PARAMS ((tree, tree)); extern void pedwarn_init (const char *);
extern void error_init PARAMS ((const char *)); extern void start_init (tree, tree, int);
extern void pedwarn_init PARAMS ((const char *)); extern void finish_init (void);
extern void start_init PARAMS ((tree, tree, int)); extern void really_start_incremental_init (tree);
extern void finish_init PARAMS ((void)); extern void push_init_level (int);
extern void really_start_incremental_init PARAMS ((tree)); extern tree pop_init_level (int);
extern void push_init_level PARAMS ((int)); extern void set_init_index (tree, tree);
extern tree pop_init_level PARAMS ((int)); extern void set_init_label (tree);
extern void set_init_index PARAMS ((tree, tree)); extern void process_init_element (tree);
extern void set_init_label PARAMS ((tree)); extern tree build_compound_literal (tree, tree);
extern void process_init_element PARAMS ((tree)); extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_PRINTF_1;
extern tree build_compound_literal PARAMS ((tree, tree)); extern tree c_start_case (tree);
extern void pedwarn_c99 PARAMS ((const char *, ...)) extern void c_finish_case (void);
ATTRIBUTE_PRINTF_1; extern tree simple_asm_stmt (tree);
extern tree c_start_case PARAMS ((tree)); extern tree build_asm_stmt (tree, tree, tree, tree, tree);
extern void c_finish_case PARAMS ((void)); extern tree c_convert_parm_for_inlining (tree, tree, tree);
extern tree simple_asm_stmt PARAMS ((tree));
extern tree build_asm_stmt PARAMS ((tree, tree, tree,
tree, tree));
extern tree c_convert_parm_for_inlining PARAMS ((tree, tree, tree));
/* Set to 0 at beginning of a function definition, set to 1 if /* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */ a return statement that specifies a return value is seen. */
...@@ -306,7 +300,7 @@ extern int current_function_returns_abnormally; ...@@ -306,7 +300,7 @@ extern int current_function_returns_abnormally;
extern int system_header_p; extern int system_header_p;
/* In c-decl.c */ /* In c-decl.c */
extern void c_finish_incomplete_decl PARAMS ((tree)); extern void c_finish_incomplete_decl (tree);
extern GTY(()) tree static_ctors; extern GTY(()) tree static_ctors;
extern GTY(()) tree static_dtors; extern GTY(()) tree static_dtors;
......
...@@ -90,8 +90,7 @@ static tree find_init_member PARAMS ((tree)); ...@@ -90,8 +90,7 @@ static tree find_init_member PARAMS ((tree));
does not have an incomplete type. (That includes void types.) */ does not have an incomplete type. (That includes void types.) */
tree tree
require_complete_type (value) require_complete_type (tree value)
tree value;
{ {
tree type = TREE_TYPE (value); tree type = TREE_TYPE (value);
...@@ -111,9 +110,7 @@ require_complete_type (value) ...@@ -111,9 +110,7 @@ require_complete_type (value)
and TYPE is the type that was invalid. */ and TYPE is the type that was invalid. */
void void
c_incomplete_type_error (value, type) c_incomplete_type_error (tree value, tree type)
tree value;
tree type;
{ {
const char *type_code_string; const char *type_code_string;
...@@ -180,8 +177,7 @@ c_incomplete_type_error (value, type) ...@@ -180,8 +177,7 @@ c_incomplete_type_error (value, type)
arguments and return the new type. */ arguments and return the new type. */
tree tree
c_type_promotes_to (type) c_type_promotes_to (tree type)
tree type;
{ {
if (TYPE_MAIN_VARIANT (type) == float_type_node) if (TYPE_MAIN_VARIANT (type) == float_type_node)
return double_type_node; return double_type_node;
...@@ -202,10 +198,9 @@ c_type_promotes_to (type) ...@@ -202,10 +198,9 @@ c_type_promotes_to (type)
as well as those of TYPE. */ as well as those of TYPE. */
static tree static tree
qualify_type (type, like) qualify_type (tree type, tree like)
tree type, like;
{ {
return c_build_qualified_type (type, return c_build_qualified_type (type,
TYPE_QUALS (type) | TYPE_QUALS (like)); TYPE_QUALS (type) | TYPE_QUALS (like));
} }
...@@ -218,8 +213,7 @@ qualify_type (type, like) ...@@ -218,8 +213,7 @@ qualify_type (type, like)
if the operands have the given two types. */ if the operands have the given two types. */
tree tree
common_type (t1, t2) common_type (tree t1, tree t2)
tree t1, t2;
{ {
enum tree_code code1; enum tree_code code1;
enum tree_code code2; enum tree_code code2;
...@@ -328,9 +322,9 @@ common_type (t1, t2) ...@@ -328,9 +322,9 @@ common_type (t1, t2)
tree pointed_to_2 = TREE_TYPE (t2); tree pointed_to_2 = TREE_TYPE (t2);
tree target = common_type (TYPE_MAIN_VARIANT (pointed_to_1), tree target = common_type (TYPE_MAIN_VARIANT (pointed_to_1),
TYPE_MAIN_VARIANT (pointed_to_2)); TYPE_MAIN_VARIANT (pointed_to_2));
t1 = build_pointer_type (c_build_qualified_type t1 = build_pointer_type (c_build_qualified_type
(target, (target,
TYPE_QUALS (pointed_to_1) | TYPE_QUALS (pointed_to_1) |
TYPE_QUALS (pointed_to_2))); TYPE_QUALS (pointed_to_2)));
return build_type_attribute_variant (t1, attributes); return build_type_attribute_variant (t1, attributes);
} }
...@@ -406,7 +400,7 @@ common_type (t1, t2) ...@@ -406,7 +400,7 @@ common_type (t1, t2)
TREE_VALUE (n) = TREE_VALUE (p1); TREE_VALUE (n) = TREE_VALUE (p1);
goto parm_done; goto parm_done;
} }
/* Given wait (union {union wait *u; int *i} *) /* Given wait (union {union wait *u; int *i} *)
and wait (union wait *), and wait (union wait *),
prefer union wait * as type of parm. */ prefer union wait * as type of parm. */
...@@ -459,8 +453,7 @@ common_type (t1, t2) ...@@ -459,8 +453,7 @@ common_type (t1, t2)
but a warning may be needed if you use them together. */ but a warning may be needed if you use them together. */
int int
comptypes (type1, type2) comptypes (tree type1, tree type2)
tree type1, type2;
{ {
tree t1 = type1; tree t1 = type1;
tree t2 = type2; tree t2 = type2;
...@@ -482,7 +475,7 @@ comptypes (type1, type2) ...@@ -482,7 +475,7 @@ comptypes (type1, type2)
&& TYPE_DOMAIN (t2) != 0) && TYPE_DOMAIN (t2) != 0)
t2 = TYPE_DOMAIN (t2); t2 = TYPE_DOMAIN (t2);
/* Treat an enum type as the integer type of the same width and /* Treat an enum type as the integer type of the same width and
signedness. */ signedness. */
if (TREE_CODE (t1) == ENUMERAL_TYPE) if (TREE_CODE (t1) == ENUMERAL_TYPE)
...@@ -591,9 +584,7 @@ comptypes (type1, type2) ...@@ -591,9 +584,7 @@ comptypes (type1, type2)
*/ */
static int static int
comp_target_types (ttl, ttr, reflexive) comp_target_types (tree ttl, tree ttr, int reflexive)
tree ttl, ttr;
int reflexive;
{ {
int val; int val;
...@@ -614,13 +605,12 @@ comp_target_types (ttl, ttr, reflexive) ...@@ -614,13 +605,12 @@ comp_target_types (ttl, ttr, reflexive)
/* Return 1 if two function types F1 and F2 are compatible. /* Return 1 if two function types F1 and F2 are compatible.
If either type specifies no argument types, If either type specifies no argument types,
the other must specify a fixed number of self-promoting arg types. the other must specify a fixed number of self-promoting arg types.
Otherwise, if one type specifies only the number of arguments, Otherwise, if one type specifies only the number of arguments,
the other must specify that number of self-promoting arg types. the other must specify that number of self-promoting arg types.
Otherwise, the argument types must match. */ Otherwise, the argument types must match. */
static int static int
function_types_compatible_p (f1, f2) function_types_compatible_p (tree f1, tree f2)
tree f1, f2;
{ {
tree args1, args2; tree args1, args2;
/* 1 if no need for warning yet, 2 if warning cause has been seen. */ /* 1 if no need for warning yet, 2 if warning cause has been seen. */
...@@ -683,8 +673,7 @@ function_types_compatible_p (f1, f2) ...@@ -683,8 +673,7 @@ function_types_compatible_p (f1, f2)
or 2 for compatible with warning. */ or 2 for compatible with warning. */
static int static int
type_lists_compatible_p (args1, args2) type_lists_compatible_p (tree args1, tree args2)
tree args1, args2;
{ {
/* 1 if no need for warning yet, 2 if warning cause has been seen. */ /* 1 if no need for warning yet, 2 if warning cause has been seen. */
int val = 1; int val = 1;
...@@ -712,7 +701,7 @@ type_lists_compatible_p (args1, args2) ...@@ -712,7 +701,7 @@ type_lists_compatible_p (args1, args2)
if (c_type_promotes_to (TREE_VALUE (args1)) != TREE_VALUE (args1)) if (c_type_promotes_to (TREE_VALUE (args1)) != TREE_VALUE (args1))
return 0; return 0;
} }
else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)), else if (! (newval = comptypes (TYPE_MAIN_VARIANT (TREE_VALUE (args1)),
TYPE_MAIN_VARIANT (TREE_VALUE (args2))))) TYPE_MAIN_VARIANT (TREE_VALUE (args2)))))
{ {
/* Allow wait (union {union wait *u; int *i} *) /* Allow wait (union {union wait *u; int *i} *)
...@@ -763,8 +752,7 @@ type_lists_compatible_p (args1, args2) ...@@ -763,8 +752,7 @@ type_lists_compatible_p (args1, args2)
/* Compute the size to increment a pointer by. */ /* Compute the size to increment a pointer by. */
tree tree
c_size_in_bytes (type) c_size_in_bytes (tree type)
tree type;
{ {
enum tree_code code = TREE_CODE (type); enum tree_code code = TREE_CODE (type);
...@@ -786,8 +774,7 @@ c_size_in_bytes (type) ...@@ -786,8 +774,7 @@ c_size_in_bytes (type)
/* Return either DECL or its known constant value (if it has one). */ /* Return either DECL or its known constant value (if it has one). */
tree tree
decl_constant_value (decl) decl_constant_value (tree decl)
tree decl;
{ {
if (/* Don't change a variable array bound or initial value to a constant if (/* Don't change a variable array bound or initial value to a constant
in a place where a variable is invalid. */ in a place where a variable is invalid. */
...@@ -815,8 +802,7 @@ decl_constant_value (decl) ...@@ -815,8 +802,7 @@ decl_constant_value (decl)
right test for avoiding misoptimizations either. */ right test for avoiding misoptimizations either. */
static tree static tree
decl_constant_value_for_broken_optimization (decl) decl_constant_value_for_broken_optimization (tree decl)
tree decl;
{ {
if (pedantic || DECL_MODE (decl) == BLKmode) if (pedantic || DECL_MODE (decl) == BLKmode)
return decl; return decl;
...@@ -830,8 +816,7 @@ decl_constant_value_for_broken_optimization (decl) ...@@ -830,8 +816,7 @@ decl_constant_value_for_broken_optimization (decl)
return EXP. */ return EXP. */
static tree static tree
default_function_array_conversion (exp) default_function_array_conversion (tree exp)
tree exp;
{ {
tree orig_exp; tree orig_exp;
tree type = TREE_TYPE (exp); tree type = TREE_TYPE (exp);
...@@ -839,7 +824,7 @@ default_function_array_conversion (exp) ...@@ -839,7 +824,7 @@ default_function_array_conversion (exp)
int not_lvalue = 0; int not_lvalue = 0;
/* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as /* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as
an lvalue. an lvalue.
Do not use STRIP_NOPS here! It will remove conversions from pointer Do not use STRIP_NOPS here! It will remove conversions from pointer
to integer and cause infinite recursion. */ to integer and cause infinite recursion. */
...@@ -877,9 +862,9 @@ default_function_array_conversion (exp) ...@@ -877,9 +862,9 @@ default_function_array_conversion (exp)
} }
if (TYPE_QUALS (type) || constp || volatilep) if (TYPE_QUALS (type) || constp || volatilep)
restype restype
= c_build_qualified_type (restype, = c_build_qualified_type (restype,
TYPE_QUALS (type) TYPE_QUALS (type)
| (constp * TYPE_QUAL_CONST) | (constp * TYPE_QUAL_CONST)
| (volatilep * TYPE_QUAL_VOLATILE)); | (volatilep * TYPE_QUAL_VOLATILE));
...@@ -933,8 +918,7 @@ default_function_array_conversion (exp) ...@@ -933,8 +918,7 @@ default_function_array_conversion (exp)
In addition, manifest constants symbols are replaced by their values. */ In addition, manifest constants symbols are replaced by their values. */
tree tree
default_conversion (exp) default_conversion (tree exp)
tree exp;
{ {
tree orig_exp; tree orig_exp;
tree type = TREE_TYPE (exp); tree type = TREE_TYPE (exp);
...@@ -957,7 +941,7 @@ default_conversion (exp) ...@@ -957,7 +941,7 @@ default_conversion (exp)
} }
/* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as /* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as
an lvalue. an lvalue.
Do not use STRIP_NOPS here! It will remove conversions from pointer Do not use STRIP_NOPS here! It will remove conversions from pointer
to integer and cause infinite recursion. */ to integer and cause infinite recursion. */
...@@ -1018,10 +1002,9 @@ default_conversion (exp) ...@@ -1018,10 +1002,9 @@ default_conversion (exp)
TREE_VALUE of the list. Normally the list is of length one, but if TREE_VALUE of the list. Normally the list is of length one, but if
the component is embedded within (nested) anonymous structures or the component is embedded within (nested) anonymous structures or
unions, the list steps down the chain to the component. */ unions, the list steps down the chain to the component. */
static tree static tree
lookup_field (decl, component) lookup_field (tree decl, tree component)
tree decl, component;
{ {
tree type = TREE_TYPE (decl); tree type = TREE_TYPE (decl);
tree field; tree field;
...@@ -1057,7 +1040,7 @@ lookup_field (decl, component) ...@@ -1057,7 +1040,7 @@ lookup_field (decl, component)
if (anon) if (anon)
return tree_cons (NULL_TREE, field, anon); return tree_cons (NULL_TREE, field, anon);
} }
} }
/* Entire record is only anon unions. */ /* Entire record is only anon unions. */
...@@ -1110,8 +1093,7 @@ lookup_field (decl, component) ...@@ -1110,8 +1093,7 @@ lookup_field (decl, component)
structure or union value DATUM. COMPONENT is an IDENTIFIER_NODE. */ structure or union value DATUM. COMPONENT is an IDENTIFIER_NODE. */
tree tree
build_component_ref (datum, component) build_component_ref (tree datum, tree component)
tree datum, component;
{ {
tree type = TREE_TYPE (datum); tree type = TREE_TYPE (datum);
enum tree_code code = TREE_CODE (type); enum tree_code code = TREE_CODE (type);
...@@ -1199,9 +1181,7 @@ build_component_ref (datum, component) ...@@ -1199,9 +1181,7 @@ build_component_ref (datum, component)
ERRORSTRING is the name of the operator to appear in error messages. */ ERRORSTRING is the name of the operator to appear in error messages. */
tree tree
build_indirect_ref (ptr, errorstring) build_indirect_ref (tree ptr, const char *errorstring)
tree ptr;
const char *errorstring;
{ {
tree pointer = default_conversion (ptr); tree pointer = default_conversion (ptr);
tree type = TREE_TYPE (pointer); tree type = TREE_TYPE (pointer);
...@@ -1254,8 +1234,7 @@ build_indirect_ref (ptr, errorstring) ...@@ -1254,8 +1234,7 @@ build_indirect_ref (ptr, errorstring)
by functions). */ by functions). */
tree tree
build_array_ref (array, index) build_array_ref (tree array, tree index)
tree array, index;
{ {
if (index == 0) if (index == 0)
{ {
...@@ -1339,7 +1318,7 @@ build_array_ref (array, index) ...@@ -1339,7 +1318,7 @@ build_array_ref (array, index)
TREE_THIS_VOLATILE (rval) TREE_THIS_VOLATILE (rval)
|= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array))) |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array)))
/* This was added by rms on 16 Nov 91. /* This was added by rms on 16 Nov 91.
It fixes vol struct foo *a; a->elts[1] It fixes vol struct foo *a; a->elts[1]
in an inline function. in an inline function.
Hope it doesn't break something else. */ Hope it doesn't break something else. */
| TREE_THIS_VOLATILE (array)); | TREE_THIS_VOLATILE (array));
...@@ -1390,8 +1369,7 @@ build_array_ref (array, index) ...@@ -1390,8 +1369,7 @@ build_array_ref (array, index)
including a reference to a builtin outside of function-call context. including a reference to a builtin outside of function-call context.
Arrange to suppress further errors for the same identifier. */ Arrange to suppress further errors for the same identifier. */
static void static void
undeclared_variable (id) undeclared_variable (tree id)
tree id;
{ {
if (current_function_decl == 0) if (current_function_decl == 0)
{ {
...@@ -1421,9 +1399,7 @@ undeclared_variable (id) ...@@ -1421,9 +1399,7 @@ undeclared_variable (id)
/* Build an external reference to identifier ID. FUN indicates /* Build an external reference to identifier ID. FUN indicates
whether this will be used for a function call. */ whether this will be used for a function call. */
tree tree
build_external_ref (id, fun) build_external_ref (tree id, int fun)
tree id;
int fun;
{ {
tree ref; tree ref;
tree decl = lookup_name (id); tree decl = lookup_name (id);
...@@ -1480,7 +1456,7 @@ build_external_ref (id, fun) ...@@ -1480,7 +1456,7 @@ build_external_ref (id, fun)
|| TREE_CODE (ref) == FUNCTION_DECL)) || TREE_CODE (ref) == FUNCTION_DECL))
{ {
tree context = decl_function_context (ref); tree context = decl_function_context (ref);
if (context != 0 && context != current_function_decl) if (context != 0 && context != current_function_decl)
DECL_NONLOCAL (ref) = 1; DECL_NONLOCAL (ref) = 1;
} }
...@@ -1494,8 +1470,7 @@ build_external_ref (id, fun) ...@@ -1494,8 +1470,7 @@ build_external_ref (id, fun)
FUNCTION's data type may be a function type or a pointer-to-function. */ FUNCTION's data type may be a function type or a pointer-to-function. */
tree tree
build_function_call (function, params) build_function_call (tree function, tree params)
tree function, params;
{ {
tree fntype, fundecl = 0; tree fntype, fundecl = 0;
tree coerced_params; tree coerced_params;
...@@ -1592,8 +1567,7 @@ build_function_call (function, params) ...@@ -1592,8 +1567,7 @@ build_function_call (function, params)
with the elements of the list in the TREE_VALUE slots of those nodes. */ with the elements of the list in the TREE_VALUE slots of those nodes. */
static tree static tree
convert_arguments (typelist, values, name, fundecl) convert_arguments (tree typelist, tree values, tree name, tree fundecl)
tree typelist, values, name, fundecl;
{ {
tree typetail, valtail; tree typetail, valtail;
tree result = NULL; tree result = NULL;
...@@ -1724,10 +1698,10 @@ convert_arguments (typelist, values, name, fundecl) ...@@ -1724,10 +1698,10 @@ convert_arguments (typelist, values, name, fundecl)
} }
} }
parmval = convert_for_assignment (type, val, parmval = convert_for_assignment (type, val,
(char *) 0, /* arg passing */ (char *) 0, /* arg passing */
fundecl, name, parmnum + 1); fundecl, name, parmnum + 1);
if (PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
&& INTEGRAL_TYPE_P (type) && INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))) && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
...@@ -1767,9 +1741,7 @@ convert_arguments (typelist, values, name, fundecl) ...@@ -1767,9 +1741,7 @@ convert_arguments (typelist, values, name, fundecl)
in a way that is likely to confuse the user. */ in a way that is likely to confuse the user. */
tree tree
parser_build_binary_op (code, arg1, arg2) parser_build_binary_op (enum tree_code code, tree arg1, tree arg2)
enum tree_code code;
tree arg1, arg2;
{ {
tree result = build_binary_op (code, arg1, arg2, 1); tree result = build_binary_op (code, arg1, arg2, 1);
...@@ -1887,10 +1859,7 @@ parser_build_binary_op (code, arg1, arg2) ...@@ -1887,10 +1859,7 @@ parser_build_binary_op (code, arg1, arg2)
the arithmetic is to be done. */ the arithmetic is to be done. */
tree tree
build_binary_op (code, orig_op0, orig_op1, convert_p) build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, int convert_p)
enum tree_code code;
tree orig_op0, orig_op1;
int convert_p;
{ {
tree type0, type1; tree type0, type1;
enum tree_code code0, code1; enum tree_code code0, code1;
...@@ -2223,7 +2192,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2223,7 +2192,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
if (comp_target_types (type0, type1, 1)) if (comp_target_types (type0, type1, 1))
{ {
result_type = common_type (type0, type1); result_type = common_type (type0, type1);
if (pedantic if (pedantic
&& TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
pedwarn ("ISO C forbids ordered comparisons of pointers to functions"); pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
} }
...@@ -2251,7 +2220,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2251,7 +2220,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
if (!COMPLETE_TYPE_P (TREE_TYPE (type0)) if (!COMPLETE_TYPE_P (TREE_TYPE (type0))
!= !COMPLETE_TYPE_P (TREE_TYPE (type1))) != !COMPLETE_TYPE_P (TREE_TYPE (type1)))
pedwarn ("comparison of complete and incomplete pointers"); pedwarn ("comparison of complete and incomplete pointers");
else if (pedantic else if (pedantic
&& TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
pedwarn ("ISO C forbids ordered comparisons of pointers to functions"); pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
} }
...@@ -2436,7 +2405,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2436,7 +2405,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
pass the copies by reference, then copy them back afterward. */ pass the copies by reference, then copy them back afterward. */
tree xop0 = op0, xop1 = op1, xresult_type = result_type; tree xop0 = op0, xop1 = op1, xresult_type = result_type;
enum tree_code xresultcode = resultcode; enum tree_code xresultcode = resultcode;
tree val tree val
= shorten_compare (&xop0, &xop1, &xresult_type, &xresultcode); = shorten_compare (&xop0, &xop1, &xresult_type, &xresultcode);
if (val != 0) if (val != 0)
...@@ -2460,7 +2429,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2460,7 +2429,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
STRIP_TYPE_NOPS (xop1); STRIP_TYPE_NOPS (xop1);
/* Give warnings for comparisons between signed and unsigned /* Give warnings for comparisons between signed and unsigned
quantities that may fail. quantities that may fail.
Do the checking based on the original operand trees, so that Do the checking based on the original operand trees, so that
casts will be considered, but default promotions won't be. casts will be considered, but default promotions won't be.
...@@ -2527,7 +2496,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2527,7 +2496,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
else else
primop1 = get_narrower (TREE_OPERAND (primop1, 0), primop1 = get_narrower (TREE_OPERAND (primop1, 0),
&unsignedp1); &unsignedp1);
if (host_integerp (primop0, 0) || host_integerp (primop1, 0)) if (host_integerp (primop0, 0) || host_integerp (primop1, 0))
{ {
tree primop; tree primop;
...@@ -2582,9 +2551,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2582,9 +2551,9 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
if (! converted) if (! converted)
{ {
if (TREE_TYPE (op0) != result_type) if (TREE_TYPE (op0) != result_type)
op0 = convert (result_type, op0); op0 = convert (result_type, op0);
if (TREE_TYPE (op1) != result_type) if (TREE_TYPE (op1) != result_type)
op1 = convert (result_type, op1); op1 = convert (result_type, op1);
} }
if (build_type == NULL_TREE) if (build_type == NULL_TREE)
...@@ -2607,8 +2576,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -2607,8 +2576,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
/* Return true if `t' is known to be non-negative. */ /* Return true if `t' is known to be non-negative. */
int int
c_tree_expr_nonnegative_p (t) c_tree_expr_nonnegative_p (tree t)
tree t;
{ {
if (TREE_CODE (t) == STMT_EXPR) if (TREE_CODE (t) == STMT_EXPR)
{ {
...@@ -2616,7 +2584,7 @@ c_tree_expr_nonnegative_p (t) ...@@ -2616,7 +2584,7 @@ c_tree_expr_nonnegative_p (t)
/* Find the last statement in the chain, ignoring the final /* Find the last statement in the chain, ignoring the final
* scope statement */ * scope statement */
while (TREE_CHAIN (t) != NULL_TREE while (TREE_CHAIN (t) != NULL_TREE
&& TREE_CODE (TREE_CHAIN (t)) != SCOPE_STMT) && TREE_CODE (TREE_CHAIN (t)) != SCOPE_STMT)
t = TREE_CHAIN (t); t = TREE_CHAIN (t);
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0)); return tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
...@@ -2628,8 +2596,7 @@ c_tree_expr_nonnegative_p (t) ...@@ -2628,8 +2596,7 @@ c_tree_expr_nonnegative_p (t)
The resulting tree has type int. */ The resulting tree has type int. */
static tree static tree
pointer_diff (op0, op1) pointer_diff (tree op0, tree op1)
tree op0, op1;
{ {
tree result, folded; tree result, folded;
tree restype = ptrdiff_type_node; tree restype = ptrdiff_type_node;
...@@ -2714,10 +2681,7 @@ pointer_diff (op0, op1) ...@@ -2714,10 +2681,7 @@ pointer_diff (op0, op1)
arrays to pointers in C99. */ arrays to pointers in C99. */
tree tree
build_unary_op (code, xarg, flag) build_unary_op (enum tree_code code, tree xarg, int flag)
enum tree_code code;
tree xarg;
int flag;
{ {
/* No default_conversion here. It causes trouble for ADDR_EXPR. */ /* No default_conversion here. It causes trouble for ADDR_EXPR. */
tree arg = xarg; tree arg = xarg;
...@@ -2835,7 +2799,7 @@ build_unary_op (code, xarg, flag) ...@@ -2835,7 +2799,7 @@ build_unary_op (code, xarg, flag)
return fold (build1 (IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg)); return fold (build1 (IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (arg)), arg));
else else
return convert (TREE_TYPE (arg), integer_zero_node); return convert (TREE_TYPE (arg), integer_zero_node);
case PREINCREMENT_EXPR: case PREINCREMENT_EXPR:
case POSTINCREMENT_EXPR: case POSTINCREMENT_EXPR:
case PREDECREMENT_EXPR: case PREDECREMENT_EXPR:
...@@ -2973,7 +2937,7 @@ build_unary_op (code, xarg, flag) ...@@ -2973,7 +2937,7 @@ build_unary_op (code, xarg, flag)
/* Report a read-only lvalue. */ /* Report a read-only lvalue. */
if (TREE_READONLY (arg)) if (TREE_READONLY (arg))
readonly_warning (arg, readonly_warning (arg,
((code == PREINCREMENT_EXPR ((code == PREINCREMENT_EXPR
|| code == POSTINCREMENT_EXPR) || code == POSTINCREMENT_EXPR)
? "increment" : "decrement")); ? "increment" : "decrement"));
...@@ -3086,8 +3050,7 @@ build_unary_op (code, xarg, flag) ...@@ -3086,8 +3050,7 @@ build_unary_op (code, xarg, flag)
Lvalues can have their address taken, unless they have DECL_REGISTER. */ Lvalues can have their address taken, unless they have DECL_REGISTER. */
int int
lvalue_p (ref) lvalue_p (tree ref)
tree ref;
{ {
enum tree_code code = TREE_CODE (ref); enum tree_code code = TREE_CODE (ref);
...@@ -3124,9 +3087,7 @@ lvalue_p (ref) ...@@ -3124,9 +3087,7 @@ lvalue_p (ref)
otherwise, print an error message and return zero. */ otherwise, print an error message and return zero. */
int int
lvalue_or_else (ref, msgid) lvalue_or_else (tree ref, const char *msgid)
tree ref;
const char *msgid;
{ {
int win = lvalue_p (ref); int win = lvalue_p (ref);
...@@ -3143,12 +3104,9 @@ lvalue_or_else (ref, msgid) ...@@ -3143,12 +3104,9 @@ lvalue_or_else (ref, msgid)
a pointer in C99. a pointer in C99.
If ARG is not a kind of expression we can handle, return zero. */ If ARG is not a kind of expression we can handle, return zero. */
static tree static tree
unary_complex_lvalue (code, arg, flag) unary_complex_lvalue (enum tree_code code, tree arg, int flag)
enum tree_code code;
tree arg;
int flag;
{ {
/* Handle (a, b) used as an "lvalue". */ /* Handle (a, b) used as an "lvalue". */
if (TREE_CODE (arg) == COMPOUND_EXPR) if (TREE_CODE (arg) == COMPOUND_EXPR)
...@@ -3185,8 +3143,7 @@ unary_complex_lvalue (code, arg, flag) ...@@ -3185,8 +3143,7 @@ unary_complex_lvalue (code, arg, flag)
COMPOUND_EXPR, or CONVERT_EXPR (for casts). */ COMPOUND_EXPR, or CONVERT_EXPR (for casts). */
static void static void
pedantic_lvalue_warning (code) pedantic_lvalue_warning (enum tree_code code)
enum tree_code code;
{ {
if (pedantic) if (pedantic)
switch (code) switch (code)
...@@ -3206,9 +3163,7 @@ pedantic_lvalue_warning (code) ...@@ -3206,9 +3163,7 @@ pedantic_lvalue_warning (code)
/* Warn about storing in something that is `const'. */ /* Warn about storing in something that is `const'. */
void void
readonly_warning (arg, msgid) readonly_warning (tree arg, const char *msgid)
tree arg;
const char *msgid;
{ {
if (TREE_CODE (arg) == COMPONENT_REF) if (TREE_CODE (arg) == COMPONENT_REF)
{ {
...@@ -3230,8 +3185,7 @@ readonly_warning (arg, msgid) ...@@ -3230,8 +3185,7 @@ readonly_warning (arg, msgid)
Returns true if successful. */ Returns true if successful. */
bool bool
c_mark_addressable (exp) c_mark_addressable (tree exp)
tree exp;
{ {
tree x = exp; tree x = exp;
...@@ -3312,8 +3266,7 @@ c_mark_addressable (exp) ...@@ -3312,8 +3266,7 @@ c_mark_addressable (exp)
/* Build and return a conditional expression IFEXP ? OP1 : OP2. */ /* Build and return a conditional expression IFEXP ? OP1 : OP2. */
tree tree
build_conditional_expr (ifexp, op1, op2) build_conditional_expr (tree ifexp, tree op1, tree op2)
tree ifexp, op1, op2;
{ {
tree type1; tree type1;
tree type2; tree type2;
...@@ -3340,7 +3293,7 @@ build_conditional_expr (ifexp, op1, op2) ...@@ -3340,7 +3293,7 @@ build_conditional_expr (ifexp, op1, op2)
code1 = TREE_CODE (type1); code1 = TREE_CODE (type1);
type2 = TREE_TYPE (op2); type2 = TREE_TYPE (op2);
code2 = TREE_CODE (type2); code2 = TREE_CODE (type2);
/* Quickly detect the usual case where op1 and op2 have the same type /* Quickly detect the usual case where op1 and op2 have the same type
after promotion. */ after promotion. */
if (TYPE_MAIN_VARIANT (type1) == TYPE_MAIN_VARIANT (type2)) if (TYPE_MAIN_VARIANT (type1) == TYPE_MAIN_VARIANT (type2))
...@@ -3463,7 +3416,7 @@ build_conditional_expr (ifexp, op1, op2) ...@@ -3463,7 +3416,7 @@ build_conditional_expr (ifexp, op1, op2)
op1 = convert_and_check (result_type, op1); op1 = convert_and_check (result_type, op1);
if (result_type != TREE_TYPE (op2)) if (result_type != TREE_TYPE (op2))
op2 = convert_and_check (result_type, op2); op2 = convert_and_check (result_type, op2);
if (TREE_CODE (ifexp) == INTEGER_CST) if (TREE_CODE (ifexp) == INTEGER_CST)
return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1); return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
...@@ -3474,16 +3427,13 @@ build_conditional_expr (ifexp, op1, op2) ...@@ -3474,16 +3427,13 @@ build_conditional_expr (ifexp, op1, op2)
that performs them all and returns the value of the last of them. */ that performs them all and returns the value of the last of them. */
tree tree
build_compound_expr (list) build_compound_expr (tree list)
tree list;
{ {
return internal_build_compound_expr (list, TRUE); return internal_build_compound_expr (list, TRUE);
} }
static tree static tree
internal_build_compound_expr (list, first_p) internal_build_compound_expr (tree list, int first_p)
tree list;
int first_p;
{ {
tree rest; tree rest;
...@@ -3532,12 +3482,10 @@ internal_build_compound_expr (list, first_p) ...@@ -3532,12 +3482,10 @@ internal_build_compound_expr (list, first_p)
/* Build an expression representing a cast to type TYPE of expression EXPR. */ /* Build an expression representing a cast to type TYPE of expression EXPR. */
tree tree
build_c_cast (type, expr) build_c_cast (tree type, tree expr)
tree type;
tree expr;
{ {
tree value = expr; tree value = 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;
...@@ -3689,7 +3637,7 @@ build_c_cast (type, expr) ...@@ -3689,7 +3637,7 @@ build_c_cast (type, expr)
&& flag_strict_aliasing && warn_strict_aliasing && flag_strict_aliasing && warn_strict_aliasing
&& !VOID_TYPE_P (TREE_TYPE (type))) && !VOID_TYPE_P (TREE_TYPE (type)))
{ {
/* Casting the address of a decl to non void pointer. Warn /* Casting the address of a decl to non void pointer. Warn
if the cast breaks type based aliasing. */ if the cast breaks type based aliasing. */
if (!COMPLETE_TYPE_P (TREE_TYPE (type))) if (!COMPLETE_TYPE_P (TREE_TYPE (type)))
warning ("type-punning to incomplete type might break strict-aliasing rules"); warning ("type-punning to incomplete type might break strict-aliasing rules");
...@@ -3728,8 +3676,7 @@ build_c_cast (type, expr) ...@@ -3728,8 +3676,7 @@ build_c_cast (type, expr)
/* Interpret a cast of expression EXPR to type TYPE. */ /* Interpret a cast of expression EXPR to type TYPE. */
tree tree
c_cast_expr (type, expr) c_cast_expr (tree type, tree expr)
tree type, expr;
{ {
int saved_wsp = warn_strict_prototypes; int saved_wsp = warn_strict_prototypes;
...@@ -3750,9 +3697,7 @@ c_cast_expr (type, expr) ...@@ -3750,9 +3697,7 @@ c_cast_expr (type, expr)
Or else MODIFYCODE is NOP_EXPR meaning do a simple assignment. */ Or else MODIFYCODE is NOP_EXPR meaning do a simple assignment. */
tree tree
build_modify_expr (lhs, modifycode, rhs) build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
tree lhs, rhs;
enum tree_code modifycode;
{ {
tree result; tree result;
tree newrhs; tree newrhs;
...@@ -3786,7 +3731,7 @@ build_modify_expr (lhs, modifycode, rhs) ...@@ -3786,7 +3731,7 @@ build_modify_expr (lhs, modifycode, rhs)
return error_mark_node; return error_mark_node;
return build (COMPOUND_EXPR, lhstype, return build (COMPOUND_EXPR, lhstype,
TREE_OPERAND (lhs, 0), newrhs); TREE_OPERAND (lhs, 0), newrhs);
/* Handle (a ? b : c) used as an "lvalue". */ /* Handle (a ? b : c) used as an "lvalue". */
case COND_EXPR: case COND_EXPR:
pedantic_lvalue_warning (COND_EXPR); pedantic_lvalue_warning (COND_EXPR);
...@@ -3850,7 +3795,7 @@ build_modify_expr (lhs, modifycode, rhs) ...@@ -3850,7 +3795,7 @@ build_modify_expr (lhs, modifycode, rhs)
pedantic_lvalue_warning (CONVERT_EXPR); pedantic_lvalue_warning (CONVERT_EXPR);
return convert (TREE_TYPE (lhs), result); return convert (TREE_TYPE (lhs), result);
} }
default: default:
break; break;
} }
...@@ -3927,11 +3872,7 @@ build_modify_expr (lhs, modifycode, rhs) ...@@ -3927,11 +3872,7 @@ build_modify_expr (lhs, modifycode, rhs)
PARMNUM is the number of the argument, for printing in error messages. */ PARMNUM is the number of the argument, for printing in error messages. */
static tree static tree
convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) convert_for_assignment (tree type, tree rhs, const char *errtype, tree fundecl, tree funname, int parmnum)
tree type, rhs;
const char *errtype;
tree fundecl, funname;
int parmnum;
{ {
enum tree_code codel = TREE_CODE (type); enum tree_code codel = TREE_CODE (type);
tree rhstype; tree rhstype;
...@@ -3971,7 +3912,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) ...@@ -3971,7 +3912,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
error ("void value not ignored as it ought to be"); error ("void value not ignored as it ought to be");
return error_mark_node; return error_mark_node;
} }
/* A type converts to a reference to it. /* A type converts to a reference to it.
This code doesn't fully support references, it's just for the This code doesn't fully support references, it's just for the
special case of va_start and va_copy. */ special case of va_start and va_copy. */
if (codel == REFERENCE_TYPE if (codel == REFERENCE_TYPE
...@@ -4003,7 +3944,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) ...@@ -4003,7 +3944,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
|| (*targetm.vector_opaque_p) (rhstype))) || (*targetm.vector_opaque_p) (rhstype)))
return convert (type, rhs); return convert (type, rhs);
/* Arithmetic types all interconvert, and enum is treated like int. */ /* Arithmetic types all interconvert, and enum is treated like int. */
else if ((codel == INTEGER_TYPE || codel == REAL_TYPE else if ((codel == INTEGER_TYPE || codel == REAL_TYPE
|| codel == ENUMERAL_TYPE || codel == COMPLEX_TYPE || codel == ENUMERAL_TYPE || codel == COMPLEX_TYPE
|| codel == BOOLEAN_TYPE) || codel == BOOLEAN_TYPE)
&& (coder == INTEGER_TYPE || coder == REAL_TYPE && (coder == INTEGER_TYPE || coder == REAL_TYPE
...@@ -4096,7 +4037,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) ...@@ -4096,7 +4037,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
errtype, funname, errtype, funname,
parmnum); parmnum);
} }
if (pedantic && ! DECL_IN_SYSTEM_HEADER (fundecl)) if (pedantic && ! DECL_IN_SYSTEM_HEADER (fundecl))
pedwarn ("ISO C prohibits argument conversion to union type"); pedwarn ("ISO C prohibits argument conversion to union type");
...@@ -4202,13 +4143,13 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) ...@@ -4202,13 +4143,13 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
if (!errtype) if (!errtype)
{ {
if (funname) if (funname)
{ {
tree selector = objc_message_selector (); tree selector = objc_message_selector ();
if (selector && parmnum > 2) if (selector && parmnum > 2)
error ("incompatible type for argument %d of `%s'", error ("incompatible type for argument %d of `%s'",
parmnum - 2, IDENTIFIER_POINTER (selector)); parmnum - 2, IDENTIFIER_POINTER (selector));
else else
error ("incompatible type for argument %d of `%s'", error ("incompatible type for argument %d of `%s'",
parmnum, IDENTIFIER_POINTER (funname)); parmnum, IDENTIFIER_POINTER (funname));
} }
...@@ -4225,8 +4166,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) ...@@ -4225,8 +4166,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
/* Convert VALUE for assignment into inlined parameter PARM. */ /* Convert VALUE for assignment into inlined parameter PARM. */
tree tree
c_convert_parm_for_inlining (parm, value, fn) c_convert_parm_for_inlining (tree parm, tree value, tree fn)
tree parm, value, fn;
{ {
tree ret, type; tree ret, type;
...@@ -4236,7 +4176,7 @@ c_convert_parm_for_inlining (parm, value, fn) ...@@ -4236,7 +4176,7 @@ c_convert_parm_for_inlining (parm, value, fn)
return value; return value;
type = TREE_TYPE (parm); type = TREE_TYPE (parm);
ret = convert_for_assignment (type, value, ret = convert_for_assignment (type, value,
(char *) 0 /* arg passing */, fn, (char *) 0 /* arg passing */, fn,
DECL_NAME (fn), 0); DECL_NAME (fn), 0);
if (PROMOTE_PROTOTYPES if (PROMOTE_PROTOTYPES
...@@ -4254,17 +4194,13 @@ c_convert_parm_for_inlining (parm, value, fn) ...@@ -4254,17 +4194,13 @@ c_convert_parm_for_inlining (parm, value, fn)
Objective-C selector. */ Objective-C selector. */
static void static void
warn_for_assignment (msgid, opname, function, argnum) warn_for_assignment (const char *msgid, const char *opname, tree function, int argnum)
const char *msgid;
const char *opname;
tree function;
int argnum;
{ {
if (opname == 0) if (opname == 0)
{ {
tree selector = objc_message_selector (); tree selector = objc_message_selector ();
char * new_opname; char * new_opname;
if (selector && argnum > 2) if (selector && argnum > 2)
{ {
function = selector; function = selector;
...@@ -4273,7 +4209,7 @@ warn_for_assignment (msgid, opname, function, argnum) ...@@ -4273,7 +4209,7 @@ warn_for_assignment (msgid, opname, function, argnum)
if (argnum == 0) if (argnum == 0)
{ {
if (function) if (function)
{ {
/* Function name is known; supply it. */ /* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'"); const char *const argstring = _("passing arg of `%s'");
new_opname = (char *) alloca (IDENTIFIER_LENGTH (function) new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
...@@ -4319,9 +4255,7 @@ warn_for_assignment (msgid, opname, function, argnum) ...@@ -4319,9 +4255,7 @@ warn_for_assignment (msgid, opname, function, argnum)
which is allowed with a warning when -pedantic is specified. */ which is allowed with a warning when -pedantic is specified. */
static tree static tree
valid_compound_expr_initializer (value, endtype) valid_compound_expr_initializer (tree value, tree endtype)
tree value;
tree endtype;
{ {
if (TREE_CODE (value) == COMPOUND_EXPR) if (TREE_CODE (value) == COMPOUND_EXPR)
{ {
...@@ -4344,8 +4278,7 @@ valid_compound_expr_initializer (value, endtype) ...@@ -4344,8 +4278,7 @@ valid_compound_expr_initializer (value, endtype)
If the init is invalid, store an ERROR_MARK. */ If the init is invalid, store an ERROR_MARK. */
void void
store_init_value (decl, init) store_init_value (tree decl, tree init)
tree decl, init;
{ {
tree value, type; tree value, type;
...@@ -4456,8 +4389,7 @@ static int spelling_size; /* Size of the spelling stack. */ ...@@ -4456,8 +4389,7 @@ static int spelling_size; /* Size of the spelling stack. */
/* Push STRING on the stack. Printed literally. */ /* Push STRING on the stack. Printed literally. */
static void static void
push_string (string) push_string (const char *string)
const char *string;
{ {
PUSH_SPELLING (SPELLING_STRING, string, u.s); PUSH_SPELLING (SPELLING_STRING, string, u.s);
} }
...@@ -4465,9 +4397,7 @@ push_string (string) ...@@ -4465,9 +4397,7 @@ push_string (string)
/* Push a member name on the stack. Printed as '.' STRING. */ /* Push a member name on the stack. Printed as '.' STRING. */
static void static void
push_member_name (decl) push_member_name (tree decl)
tree decl;
{ {
const char *const string const char *const string
= DECL_NAME (decl) ? IDENTIFIER_POINTER (DECL_NAME (decl)) : "<anonymous>"; = DECL_NAME (decl) ? IDENTIFIER_POINTER (DECL_NAME (decl)) : "<anonymous>";
...@@ -4477,8 +4407,7 @@ push_member_name (decl) ...@@ -4477,8 +4407,7 @@ push_member_name (decl)
/* Push an array bounds on the stack. Printed as [BOUNDS]. */ /* Push an array bounds on the stack. Printed as [BOUNDS]. */
static void static void
push_array_bounds (bounds) push_array_bounds (int bounds)
int bounds;
{ {
PUSH_SPELLING (SPELLING_BOUNDS, bounds, u.i); PUSH_SPELLING (SPELLING_BOUNDS, bounds, u.i);
} }
...@@ -4486,7 +4415,7 @@ push_array_bounds (bounds) ...@@ -4486,7 +4415,7 @@ push_array_bounds (bounds)
/* Compute the maximum size in bytes of the printed spelling. */ /* Compute the maximum size in bytes of the printed spelling. */
static int static int
spelling_length () spelling_length (void)
{ {
int size = 0; int size = 0;
struct spelling *p; struct spelling *p;
...@@ -4505,8 +4434,7 @@ spelling_length () ...@@ -4505,8 +4434,7 @@ spelling_length ()
/* Print the spelling to BUFFER and return it. */ /* Print the spelling to BUFFER and return it. */
static char * static char *
print_spelling (buffer) print_spelling (char *buffer)
char *buffer;
{ {
char *d = buffer; char *d = buffer;
struct spelling *p; struct spelling *p;
...@@ -4534,8 +4462,7 @@ print_spelling (buffer) ...@@ -4534,8 +4462,7 @@ print_spelling (buffer)
The component name is taken from the spelling stack. */ The component name is taken from the spelling stack. */
void void
error_init (msgid) error_init (const char *msgid)
const char *msgid;
{ {
char *ofwhat; char *ofwhat;
...@@ -4550,8 +4477,7 @@ error_init (msgid) ...@@ -4550,8 +4477,7 @@ error_init (msgid)
The component name is taken from the spelling stack. */ The component name is taken from the spelling stack. */
void void
pedwarn_init (msgid) pedwarn_init (const char *msgid)
const char *msgid;
{ {
char *ofwhat; char *ofwhat;
...@@ -4566,8 +4492,7 @@ pedwarn_init (msgid) ...@@ -4566,8 +4492,7 @@ pedwarn_init (msgid)
The component name is taken from the spelling stack. */ The component name is taken from the spelling stack. */
static void static void
warning_init (msgid) warning_init (const char *msgid)
const char *msgid;
{ {
char *ofwhat; char *ofwhat;
...@@ -4584,9 +4509,7 @@ warning_init (msgid) ...@@ -4584,9 +4509,7 @@ warning_init (msgid)
elements are seen. */ elements are seen. */
static tree static tree
digest_init (type, init, require_constant) digest_init (tree type, tree init, int require_constant)
tree type, init;
int require_constant;
{ {
enum tree_code code = TREE_CODE (type); enum tree_code code = TREE_CODE (type);
tree inside_init = init; tree inside_init = init;
...@@ -4726,7 +4649,7 @@ digest_init (type, init, require_constant) ...@@ -4726,7 +4649,7 @@ digest_init (type, init, require_constant)
if (flag_pedantic_errors) if (flag_pedantic_errors)
inside_init = error_mark_node; inside_init = error_mark_node;
} }
else if (require_constant else if (require_constant
&& (!TREE_CONSTANT (inside_init) && (!TREE_CONSTANT (inside_init)
/* This test catches things like `7 / 0' which /* This test catches things like `7 / 0' which
result in an expression for which TREE_CONSTANT result in an expression for which TREE_CONSTANT
...@@ -4954,10 +4877,7 @@ struct initializer_stack *initializer_stack; ...@@ -4954,10 +4877,7 @@ struct initializer_stack *initializer_stack;
/* Prepare to parse and output the initializer for variable DECL. */ /* Prepare to parse and output the initializer for variable DECL. */
void void
start_init (decl, asmspec_tree, top_level) start_init (tree decl, tree asmspec_tree, int top_level)
tree decl;
tree asmspec_tree;
int top_level;
{ {
const char *locus; const char *locus;
struct initializer_stack *p struct initializer_stack *p
...@@ -5020,7 +4940,7 @@ start_init (decl, asmspec_tree, top_level) ...@@ -5020,7 +4940,7 @@ start_init (decl, asmspec_tree, top_level)
} }
void void
finish_init () finish_init (void)
{ {
struct initializer_stack *p = initializer_stack; struct initializer_stack *p = initializer_stack;
...@@ -5059,8 +4979,7 @@ finish_init () ...@@ -5059,8 +4979,7 @@ finish_init ()
For an initializer for a decl, TYPE is zero. */ For an initializer for a decl, TYPE is zero. */
void void
really_start_incremental_init (type) really_start_incremental_init (tree type)
tree type;
{ {
struct constructor_stack *p struct constructor_stack *p
= (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack)); = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
...@@ -5166,8 +5085,7 @@ really_start_incremental_init (type) ...@@ -5166,8 +5085,7 @@ really_start_incremental_init (type)
IMPLICIT is 1 (or 2 if the push is because of designator list). */ IMPLICIT is 1 (or 2 if the push is because of designator list). */
void void
push_init_level (implicit) push_init_level (int implicit)
int implicit;
{ {
struct constructor_stack *p; struct constructor_stack *p;
tree value = NULL_TREE; tree value = NULL_TREE;
...@@ -5181,7 +5099,7 @@ push_init_level (implicit) ...@@ -5181,7 +5099,7 @@ push_init_level (implicit)
&& constructor_fields == 0) && constructor_fields == 0)
process_init_element (pop_init_level (1)); process_init_element (pop_init_level (1));
else if (TREE_CODE (constructor_type) == ARRAY_TYPE else if (TREE_CODE (constructor_type) == ARRAY_TYPE
&& constructor_max_index && constructor_max_index
&& tree_int_cst_lt (constructor_max_index, constructor_index)) && tree_int_cst_lt (constructor_max_index, constructor_index))
process_init_element (pop_init_level (1)); process_init_element (pop_init_level (1));
else else
...@@ -5327,7 +5245,7 @@ push_init_level (implicit) ...@@ -5327,7 +5245,7 @@ push_init_level (implicit)
constructor_max_index = build_int_2 (-1, -1); constructor_max_index = build_int_2 (-1, -1);
constructor_index constructor_index
= convert (bitsizetype, = convert (bitsizetype,
TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type))); TYPE_MIN_VALUE (TYPE_DOMAIN (constructor_type)));
} }
else else
...@@ -5350,7 +5268,7 @@ push_init_level (implicit) ...@@ -5350,7 +5268,7 @@ push_init_level (implicit)
} }
} }
/* At the end of an implicit or explicit brace level, /* At the end of an implicit or explicit brace level,
finish up that level of constructor. finish up that level of constructor.
If we were outputting the elements as they are read, return 0 If we were outputting the elements as they are read, return 0
from inner levels (process_init_element ignores that), from inner levels (process_init_element ignores that),
...@@ -5359,8 +5277,7 @@ push_init_level (implicit) ...@@ -5359,8 +5277,7 @@ push_init_level (implicit)
Otherwise, return a CONSTRUCTOR expression. */ Otherwise, return a CONSTRUCTOR expression. */
tree tree
pop_init_level (implicit) pop_init_level (int implicit)
int implicit;
{ {
struct constructor_stack *p; struct constructor_stack *p;
tree constructor = 0; tree constructor = 0;
...@@ -5512,8 +5429,7 @@ pop_init_level (implicit) ...@@ -5512,8 +5429,7 @@ pop_init_level (implicit)
ARRAY argument is nonzero for array ranges. Returns zero for success. */ ARRAY argument is nonzero for array ranges. Returns zero for success. */
static int static int
set_designator (array) set_designator (int array)
int array;
{ {
tree subtype; tree subtype;
enum tree_code subcode; enum tree_code subcode;
...@@ -5582,8 +5498,7 @@ set_designator (array) ...@@ -5582,8 +5498,7 @@ set_designator (array)
NULL_TREE if there is no range designator at this level. */ NULL_TREE if there is no range designator at this level. */
static void static void
push_range_stack (range_end) push_range_stack (tree range_end)
tree range_end;
{ {
struct constructor_range_stack *p; struct constructor_range_stack *p;
...@@ -5606,8 +5521,7 @@ push_range_stack (range_end) ...@@ -5606,8 +5521,7 @@ push_range_stack (range_end)
of indices, running from FIRST through LAST. */ of indices, running from FIRST through LAST. */
void void
set_init_index (first, last) set_init_index (tree first, tree last)
tree first, last;
{ {
if (set_designator (1)) if (set_designator (1))
return; return;
...@@ -5673,8 +5587,7 @@ set_init_index (first, last) ...@@ -5673,8 +5587,7 @@ set_init_index (first, last)
/* Within a struct initializer, specify the next field to be initialized. */ /* Within a struct initializer, specify the next field to be initialized. */
void void
set_init_label (fieldname) set_init_label (tree fieldname)
tree fieldname;
{ {
tree tail; tree tail;
...@@ -5689,7 +5602,7 @@ set_init_label (fieldname) ...@@ -5689,7 +5602,7 @@ set_init_label (fieldname)
error_init ("field name not in record or union initializer"); error_init ("field name not in record or union initializer");
return; return;
} }
for (tail = TYPE_FIELDS (constructor_type); tail; for (tail = TYPE_FIELDS (constructor_type); tail;
tail = TREE_CHAIN (tail)) tail = TREE_CHAIN (tail))
{ {
...@@ -5711,12 +5624,11 @@ set_init_label (fieldname) ...@@ -5711,12 +5624,11 @@ set_init_label (fieldname)
} }
/* Add a new initializer to the tree of pending initializers. PURPOSE /* Add a new initializer to the tree of pending initializers. PURPOSE
identifies the initializer, either array index or field in a structure. identifies the initializer, either array index or field in a structure.
VALUE is the value of that index or field. */ VALUE is the value of that index or field. */
static void static void
add_pending_init (purpose, value) add_pending_init (tree purpose, tree value)
tree purpose, value;
{ {
struct init_node *p, **q, *r; struct init_node *p, **q, *r;
...@@ -5931,7 +5843,7 @@ add_pending_init (purpose, value) ...@@ -5931,7 +5843,7 @@ add_pending_init (purpose, value)
/* Build AVL tree from a sorted chain. */ /* Build AVL tree from a sorted chain. */
static void static void
set_nonincremental_init () set_nonincremental_init (void)
{ {
tree chain; tree chain;
...@@ -5950,7 +5862,7 @@ set_nonincremental_init () ...@@ -5950,7 +5862,7 @@ set_nonincremental_init ()
&& DECL_C_BIT_FIELD (constructor_unfilled_fields) && DECL_C_BIT_FIELD (constructor_unfilled_fields)
&& DECL_NAME (constructor_unfilled_fields) == 0) && DECL_NAME (constructor_unfilled_fields) == 0)
constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields); constructor_unfilled_fields = TREE_CHAIN (constructor_unfilled_fields);
} }
else if (TREE_CODE (constructor_type) == ARRAY_TYPE) else if (TREE_CODE (constructor_type) == ARRAY_TYPE)
{ {
...@@ -5967,8 +5879,7 @@ set_nonincremental_init () ...@@ -5967,8 +5879,7 @@ set_nonincremental_init ()
/* Build AVL tree from a string constant. */ /* Build AVL tree from a string constant. */
static void static void
set_nonincremental_init_from_string (str) set_nonincremental_init_from_string (tree str)
tree str;
{ {
tree value, purpose, type; tree value, purpose, type;
HOST_WIDE_INT val[2]; HOST_WIDE_INT val[2];
...@@ -6051,8 +5962,7 @@ set_nonincremental_init_from_string (str) ...@@ -6051,8 +5962,7 @@ set_nonincremental_init_from_string (str)
not initialized yet. */ not initialized yet. */
static tree static tree
find_init_member (field) find_init_member (tree field)
tree field;
{ {
struct init_node *p; struct init_node *p;
...@@ -6114,9 +6024,7 @@ find_init_member (field) ...@@ -6114,9 +6024,7 @@ find_init_member (field)
it is 0 while outputting pending elements, to avoid recursion.) */ it is 0 while outputting pending elements, to avoid recursion.) */
static void static void
output_init_element (value, type, field, pending) output_init_element (tree value, tree type, tree field, int pending)
tree value, type, field;
int pending;
{ {
if (type == error_mark_node) if (type == error_mark_node)
{ {
...@@ -6273,8 +6181,7 @@ output_init_element (value, type, field, pending) ...@@ -6273,8 +6181,7 @@ output_init_element (value, type, field, pending)
we can output all the pending elements. */ we can output all the pending elements. */
static void static void
output_pending_init_elements (all) output_pending_init_elements (int all)
int all;
{ {
struct init_node *elt = constructor_pending_elts; struct init_node *elt = constructor_pending_elts;
tree next; tree next;
...@@ -6285,7 +6192,7 @@ output_pending_init_elements (all) ...@@ -6285,7 +6192,7 @@ output_pending_init_elements (all)
If we find an element that should be output now, If we find an element that should be output now,
output it. Otherwise, set NEXT to the element output it. Otherwise, set NEXT to the element
that comes first among those still pending. */ that comes first among those still pending. */
next = 0; next = 0;
while (elt) while (elt)
{ {
...@@ -6414,8 +6321,7 @@ output_pending_init_elements (all) ...@@ -6414,8 +6321,7 @@ output_pending_init_elements (all)
it calls output_init_element. */ it calls output_init_element. */
void void
process_init_element (value) process_init_element (tree value)
tree value;
{ {
tree orig_value = value; tree orig_value = value;
int string_flag = value != 0 && TREE_CODE (value) == STRING_CST; int string_flag = value != 0 && TREE_CODE (value) == STRING_CST;
...@@ -6771,8 +6677,7 @@ process_init_element (value) ...@@ -6771,8 +6677,7 @@ process_init_element (value)
/* Build a simple asm-statement, from one string literal. */ /* Build a simple asm-statement, from one string literal. */
tree tree
simple_asm_stmt (expr) simple_asm_stmt (tree expr)
tree expr;
{ {
STRIP_NOPS (expr); STRIP_NOPS (expr);
...@@ -6798,12 +6703,7 @@ simple_asm_stmt (expr) ...@@ -6798,12 +6703,7 @@ simple_asm_stmt (expr)
STRING, some OUTPUTS, some INPUTS, and some CLOBBERS. */ STRING, some OUTPUTS, some INPUTS, and some CLOBBERS. */
tree tree
build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers) build_asm_stmt (tree cv_qualifier, tree string, tree outputs, tree inputs, tree clobbers)
tree cv_qualifier;
tree string;
tree outputs;
tree inputs;
tree clobbers;
{ {
tree tail; tree tail;
...@@ -6852,7 +6752,7 @@ build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers) ...@@ -6852,7 +6752,7 @@ build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers)
TREE_VALUE (tail) = output; TREE_VALUE (tail) = output;
} }
/* Perform default conversions on array and function inputs. /* Perform default conversions on array and function inputs.
Don't do this for other types as it would screw up operands Don't do this for other types as it would screw up operands
expected to be in memory. */ expected to be in memory. */
for (tail = inputs; tail; tail = TREE_CHAIN (tail)) for (tail = inputs; tail; tail = TREE_CHAIN (tail))
...@@ -6869,11 +6769,9 @@ build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers) ...@@ -6869,11 +6769,9 @@ build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers)
Arguments are same as for expand_asm_operands. */ Arguments are same as for expand_asm_operands. */
void void
c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) c_expand_asm_operands (tree string, tree outputs, tree inputs,
tree string, outputs, inputs, clobbers; tree clobbers, int vol, const char *filename,
int vol; int line)
const char *filename;
int line;
{ {
int noutputs = list_length (outputs); int noutputs = list_length (outputs);
int i; int i;
...@@ -6929,8 +6827,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -6929,8 +6827,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
or a null pointer for `return;' with no value. */ or a null pointer for `return;' with no value. */
tree tree
c_expand_return (retval) c_expand_return (tree retval)
tree retval;
{ {
tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl)); tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl));
...@@ -6993,7 +6890,7 @@ c_expand_return (retval) ...@@ -6993,7 +6890,7 @@ c_expand_return (retval)
inner = TREE_OPERAND (inner, 0); inner = TREE_OPERAND (inner, 0);
continue; continue;
} }
case ADDR_EXPR: case ADDR_EXPR:
inner = TREE_OPERAND (inner, 0); inner = TREE_OPERAND (inner, 0);
...@@ -7045,8 +6942,7 @@ static struct c_switch *switch_stack; ...@@ -7045,8 +6942,7 @@ static struct c_switch *switch_stack;
SWITCH_STMT. */ SWITCH_STMT. */
tree tree
c_start_case (exp) c_start_case (tree exp)
tree exp;
{ {
enum tree_code code; enum tree_code code;
tree type, orig_type = error_mark_node; tree type, orig_type = error_mark_node;
...@@ -7090,9 +6986,7 @@ c_start_case (exp) ...@@ -7090,9 +6986,7 @@ c_start_case (exp)
/* Process a case label. */ /* Process a case label. */
tree tree
do_case (low_value, high_value) do_case (tree low_value, tree high_value)
tree low_value;
tree high_value;
{ {
tree label = NULL_TREE; tree label = NULL_TREE;
...@@ -7100,8 +6994,8 @@ do_case (low_value, high_value) ...@@ -7100,8 +6994,8 @@ do_case (low_value, high_value)
{ {
bool switch_was_empty_p = (SWITCH_BODY (switch_stack->switch_stmt) == NULL_TREE); bool switch_was_empty_p = (SWITCH_BODY (switch_stack->switch_stmt) == NULL_TREE);
label = c_add_case_label (switch_stack->cases, label = c_add_case_label (switch_stack->cases,
SWITCH_COND (switch_stack->switch_stmt), SWITCH_COND (switch_stack->switch_stmt),
low_value, high_value); low_value, high_value);
if (label == error_mark_node) if (label == error_mark_node)
label = NULL_TREE; label = NULL_TREE;
...@@ -7123,7 +7017,7 @@ do_case (low_value, high_value) ...@@ -7123,7 +7017,7 @@ do_case (low_value, high_value)
/* Finish the switch statement. */ /* Finish the switch statement. */
void void
c_finish_case () c_finish_case (void)
{ {
struct c_switch *cs = switch_stack; struct c_switch *cs = switch_stack;
......
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