* c-common.h (c_common_init, c_common_post_options): Update.
* c-objc-common.c (c_objc_common_init): Update for new prototype.
* c-opts.c (saved_lineno): New.
(c_common_post_options, c_common_init): Update prototypes,
move call to cpp_read_main_file from latter to former.
* c-tree.h (c_ojbc_common_init): Update.
* langhooks-def.h (lhd_post_options): New.
(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.c (lhd_post_options): New.
* langhooks.h (struct lang_hooks): Update post_options and init hooks.
* toplev.c (no_backend): New.
(process_options): Call post_options hook and set main_input_filename
and input_filename here.
(lang_dependent_init, do_compile): post_options hook moved to
process_options.
* objc/objc-act.c (objc_init): Update prototype.
* objc/objc-act.h (objc_init): Update prototype.
ada:
* misc.c (gnat_init): Update for new prototype.
cp:
* cp-tree.h (cxx_init): Update prototype.
* lex.c (cxx_init): Similarly.
f:
* com.c (ffe_init): Update prototype; move code to ffe_post_options.
(ffe_post_options): New.
java:
* lang.c (java_init): Update prototype, move code to java_post_options.
(java_post_options): Similarly.
treelang:
* tree1.c (in_fname): Fix type.
(treelang_init): Update prototype and use of in_fname.
* treelang.h (in_fname): Fix type.
* treetree.c (tree_code_if_start, tree_code_if_else,
tree_code_if_end, tree_code_create_function_prototype,
tree_code_create_function_initial, tree_code_create_funciton_wrapup,
tree_code_create_variable, tree_code_output_expression_statement)
: Fix prototypes and use of filenames.
* treetree.h: Similarly.
From-SVN: r64001
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * c-common.h (c_common_init, c_common_post_options): Update.
+ * c-objc-common.c (c_objc_common_init): Update for new prototype.
+ * c-opts.c (saved_lineno): New.
+ (c_common_post_options, c_common_init): Update prototypes,
+ move call to cpp_read_main_file from latter to former.
+ * c-tree.h (c_ojbc_common_init): Update.
+ * langhooks-def.h (lhd_post_options): New.
+ (LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
+ * langhooks.c (lhd_post_options): New.
+ * langhooks.h (struct lang_hooks): Update post_options and init hooks.
+ * toplev.c (no_backend): New.
+ (process_options): Call post_options hook and set main_input_filename
+ and input_filename here.
+ (lang_dependent_init, do_compile): post_options hook moved to
+ process_options.
+ * objc/objc-act.c (objc_init): Update prototype.
+ * objc/objc-act.h (objc_init): Update prototype.
+
2003-03-08 Roger Sayle <roger@eyesopen.com>
* emit-rtl.c (gen_lowpart): Don't attempt to load a part of
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * misc.c (gnat_init): Update for new prototype.
+
2003-03-05 Olivier Hainque <hainque@gnat.com>
ada/9961
extern int save_argc;
extern char **save_argv;
-static const char *gnat_init PARAMS ((const char *));
+static bool gnat_init PARAMS ((void));
static void gnat_init_options PARAMS ((void));
static int gnat_decode_option PARAMS ((int, char **));
static HOST_WIDE_INT gnat_get_alias_set PARAMS ((tree));
/* Perform all the initialization steps that are language-specific. */
-static const char *
-gnat_init (filename)
- const char *filename;
+static bool
+gnat_init ()
{
/* Performs whatever initialization steps needed by the language-dependent
lexical analyzer.
gnat_init_decl_processing ();
/* Add the input filename as the last argument. */
- gnat_argv[gnat_argc] = (char *) filename;
+ gnat_argv[gnat_argc] = (char *) main_input_filename;
gnat_argc++;
gnat_argv[gnat_argc] = 0;
set_lang_adjust_rli (gnat_adjust_rli);
- if (filename == 0)
- filename = "";
-
- return filename;
+ return true;
}
/* If we are using the GCC mechanism for to process exception handling, we
extern tree build_va_arg PARAMS ((tree, tree));
extern void c_common_init_options PARAMS ((enum c_language_kind));
-extern bool c_common_post_options PARAMS ((void));
-extern const char *c_common_init PARAMS ((const char *));
+extern bool c_common_post_options PARAMS ((const char **));
+extern bool c_common_init PARAMS ((void));
extern void c_common_finish PARAMS ((void));
extern void c_common_parse_file PARAMS ((int));
extern HOST_WIDE_INT c_common_get_alias_set PARAMS ((tree));
}
/* Initialization common to C and Objective-C front ends. */
-const char *
-c_objc_common_init (filename)
- const char *filename;
+bool
+c_objc_common_init ()
{
c_init_decl_processing ();
- filename = c_common_init (filename);
- if (filename == NULL)
- return NULL;
+ if (c_common_init () == false)
+ return false;
lang_expand_decl_stmt = c_expand_decl_stmt;
VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns");
- return filename;
+ return true;
}
/* Register a function tree, so that its optimization and conversion
# define TARGET_SYSTEM_ROOT NULL
#endif
+static int saved_lineno;
+
/* CPP's options. */
static cpp_options *cpp_opts;
/* Post-switch processing. */
bool
-c_common_post_options ()
+c_common_post_options (pfilename)
+ const char **pfilename;
{
/* Canonicalize the input and output filenames. */
if (in_fname == NULL || !strcmp (in_fname, "-"))
if (warn_missing_format_attribute && !warn_format)
warning ("-Wmissing-format-attribute ignored without -Wformat");
- /* If an error has occurred in cpplib, note it so we fail
- immediately. */
- errorcount += cpp_errors (parse_in);
-
- return flag_preprocess_only;
-}
-
-/* Front end initialization common to C, ObjC and C++. */
-const char *
-c_common_init (filename)
- const char *filename;
-{
- /* Set up preprocessor arithmetic. Must be done after call to
- c_common_nodes_and_builtins for type nodes to be good. */
- cpp_opts->precision = TYPE_PRECISION (intmax_type_node);
- cpp_opts->char_precision = TYPE_PRECISION (char_type_node);
- cpp_opts->int_precision = TYPE_PRECISION (integer_type_node);
- cpp_opts->wchar_precision = TYPE_PRECISION (wchar_type_node);
- cpp_opts->unsigned_wchar = TREE_UNSIGNED (wchar_type_node);
-
if (flag_preprocess_only)
{
/* Open the output now. We must do so even if flag_no_output is
}
/* NOTE: we use in_fname here, not the one supplied. */
- filename = cpp_read_main_file (parse_in, in_fname, ident_hash);
+ *pfilename = cpp_read_main_file (parse_in, in_fname, ident_hash);
+
+ saved_lineno = lineno;
+ lineno = 0;
+
+ /* If an error has occurred in cpplib, note it so we fail
+ immediately. */
+ errorcount += cpp_errors (parse_in);
+
+ return flag_preprocess_only;
+}
+
+/* Front end initialization common to C, ObjC and C++. */
+bool
+c_common_init ()
+{
+ lineno = saved_lineno;
+
+ /* Set up preprocessor arithmetic. Must be done after call to
+ c_common_nodes_and_builtins for type nodes to be good. */
+ cpp_opts->precision = TYPE_PRECISION (intmax_type_node);
+ cpp_opts->char_precision = TYPE_PRECISION (char_type_node);
+ cpp_opts->int_precision = TYPE_PRECISION (integer_type_node);
+ cpp_opts->wchar_precision = TYPE_PRECISION (wchar_type_node);
+ cpp_opts->unsigned_wchar = TREE_UNSIGNED (wchar_type_node);
if (flag_preprocess_only)
{
- if (filename)
+ if (main_input_filename)
preprocess_file (parse_in);
- return NULL;
+ return false;
}
/* Has to wait until now so that cpplib has its hash table. */
init_pragma ();
- return filename;
+ return true;
}
/* Common finish hook for the C, ObjC and C++ front ends. */
/* in c-objc-common.c */
extern int c_disregard_inline_limits PARAMS ((tree));
extern int c_cannot_inline_tree_fn PARAMS ((tree *));
-extern const char *c_objc_common_init PARAMS ((const char *));
+extern bool c_objc_common_init PARAMS ((void));
extern int c_missing_noreturn_ok_p PARAMS ((tree));
extern void c_objc_common_finish_file PARAMS ((void));
extern int defer_fn PARAMS ((tree));
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * cp-tree.h (cxx_init): Update prototype.
+ * lex.c (cxx_init): Similarly.
+
2003-03-08 Mark Mitchell <mark@codesourcery.com>
PR c++/9823
extern void yyerror (const char *);
extern void yyhook (int);
extern int cp_type_qual_from_rid (tree);
-extern const char *cxx_init (const char *);
+extern bool cxx_init (void);
extern void cxx_finish (void);
extern void cxx_init_options (void);
the exact order that things are done here. It would be nice if the
initialization done by this routine were moved to its subroutines,
and the ordering dependencies clarified and reduced. */
-const char *
-cxx_init (filename)
- const char *filename;
+bool
+cxx_init (void)
{
input_filename = "<internal>";
interface_unknown = 1;
- filename = c_common_init (filename);
- if (filename == NULL)
- return NULL;
+ if (c_common_init () == false)
+ return false;
init_cp_pragma ();
- init_repo (filename);
+ init_repo (main_input_filename);
- return filename;
+ return true;
}
\f
/* Helper function to load global variables with interface
+Sat Mar 8 21:11:40 2003 Neil Booth <neil@daikokuya.co.uk>
+
+ * com.c (ffe_init): Update prototype; move code to ffe_post_options.
+ (ffe_post_options): New.
+
2003-03-04 Tom Tromey <tromey@redhat.com>
* Make-lang.in (f77.tags): New target.
}
/* Each front end provides its own. */
-static const char *ffe_init PARAMS ((const char *));
+static bool ffe_init PARAMS ((void));
static void ffe_finish PARAMS ((void));
+static bool ffe_post_options PARAMS ((const char **));
static void ffe_init_options PARAMS ((void));
static void ffe_print_identifier PARAMS ((FILE *, tree, int));
#define LANG_HOOKS_INIT_OPTIONS ffe_init_options
#undef LANG_HOOKS_DECODE_OPTION
#define LANG_HOOKS_DECODE_OPTION ffe_decode_option
+#undef LANG_HOOKS_POST_OPTIONS
+#define LANG_HOOKS_POST_OPTIONS ffe_post_options
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE ffe_parse_file
#undef LANG_HOOKS_MARK_ADDRESSABLE
};
#undef DEFTREECODE
-static const char *
-ffe_init (const char *filename)
+static bool
+ffe_post_options (pfilename)
+ const char **pfilename;
{
+ const char *filename = *pfilename;
+
/* Open input file. */
if (filename == 0 || !strcmp (filename, "-"))
{
}
else
finput = fopen (filename, "r");
+
if (finput == 0)
fatal_io_error ("can't open %s", filename);
+ return false;
+}
+
+
+static bool
+ffe_init ()
+{
#ifdef IO_BUFFER_SIZE
setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
#endif
ffelex_hash_kludge (finput);
/* FIXME: The ffelex_hash_kludge code needs to be cleaned up to
- return the new file name. */
- if (main_input_filename)
- filename = main_input_filename;
-
- return filename;
+ set the new file name. Maybe in ffe_post_options. */
+ return true;
}
static void
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * lang.c (java_init): Update prototype, move code to java_post_options.
+ (java_post_options): Similarly.
+
2003-03-05 Ranjit Mathew <rmathew@hotmail.com>
* jcf.h (COMPARE_FILENAMES): New macro similar to "strcmp" to
const int on_value;
};
-static const char *java_init (const char *);
+static bool java_init (void);
static void java_finish (void);
static void java_init_options (void);
-static bool java_post_options (void);
+static bool java_post_options (const char **);
static int java_decode_option (int, char **);
static void put_decl_string (const char *, int);
/* Global open file. */
FILE *finput;
-static const char *
-java_init (const char *filename)
+static bool
+java_init (void)
{
#if 0
extern int flag_minimal_debug;
&& force_align_functions_log < 1)
force_align_functions_log = 1;
- /* Open input file. */
-
- if (filename == 0 || !strcmp (filename, "-"))
- {
- finput = stdin;
- filename = "stdin";
-
- if (dependency_tracking)
- error ("can't do dependency tracking with input from stdin");
- }
- else
- {
- if (dependency_tracking)
- {
- char *dot;
-
- /* If the target is set and the output filename is set, then
- there's no processing to do here. Otherwise we must
- compute one or the other. */
- if (! ((dependency_tracking & DEPEND_TARGET_SET)
- && (dependency_tracking & DEPEND_FILE_ALREADY_SET)))
- {
- dot = strrchr (filename, '.');
- if (dot == NULL)
- error ("couldn't determine target name for dependency tracking");
- else
- {
- char *buf = xmalloc (dot - filename +
- 3 + sizeof (TARGET_OBJECT_SUFFIX));
- strncpy (buf, filename, dot - filename);
-
- /* If emitting class files, we might have multiple
- targets. The class generation code takes care of
- registering them. Otherwise we compute the
- target name here. */
- if ((dependency_tracking & DEPEND_TARGET_SET))
- ; /* Nothing. */
- else if (flag_emit_class_files)
- jcf_dependency_set_target (NULL);
- else
- {
- strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
- jcf_dependency_set_target (buf);
- }
-
- if ((dependency_tracking & DEPEND_FILE_ALREADY_SET))
- ; /* Nothing. */
- else if ((dependency_tracking & DEPEND_SET_FILE))
- {
- strcpy (buf + (dot - filename), ".d");
- jcf_dependency_set_dep_file (buf);
- }
- else
- jcf_dependency_set_dep_file ("-");
-
- free (buf);
- }
- }
- }
- }
-
jcf_path_init ();
jcf_path_seal (version_flag);
using_eh_for_cleanups ();
- return filename;
+ return true;
}
static void
/* Post-switch processing. */
static bool
-java_post_options (void)
+java_post_options (const char **pfilename)
{
+ const char *filename = *pfilename;
+
/* Use tree inlining if possible. Function instrumentation is only
done in the RTL level, so we disable tree inlining. */
if (! flag_instrument_function_entry_exit)
}
}
+ /* Open input file. */
+
+ if (filename == 0 || !strcmp (filename, "-"))
+ {
+ finput = stdin;
+ filename = "stdin";
+
+ if (dependency_tracking)
+ error ("can't do dependency tracking with input from stdin");
+ }
+ else
+ {
+ if (dependency_tracking)
+ {
+ char *dot;
+
+ /* If the target is set and the output filename is set, then
+ there's no processing to do here. Otherwise we must
+ compute one or the other. */
+ if (! ((dependency_tracking & DEPEND_TARGET_SET)
+ && (dependency_tracking & DEPEND_FILE_ALREADY_SET)))
+ {
+ dot = strrchr (filename, '.');
+ if (dot == NULL)
+ error ("couldn't determine target name for dependency tracking");
+ else
+ {
+ char *buf = xmalloc (dot - filename +
+ 3 + sizeof (TARGET_OBJECT_SUFFIX));
+ strncpy (buf, filename, dot - filename);
+
+ /* If emitting class files, we might have multiple
+ targets. The class generation code takes care of
+ registering them. Otherwise we compute the
+ target name here. */
+ if ((dependency_tracking & DEPEND_TARGET_SET))
+ ; /* Nothing. */
+ else if (flag_emit_class_files)
+ jcf_dependency_set_target (NULL);
+ else
+ {
+ strcpy (buf + (dot - filename), TARGET_OBJECT_SUFFIX);
+ jcf_dependency_set_target (buf);
+ }
+
+ if ((dependency_tracking & DEPEND_FILE_ALREADY_SET))
+ ; /* Nothing. */
+ else if ((dependency_tracking & DEPEND_SET_FILE))
+ {
+ strcpy (buf + (dot - filename), ".d");
+ jcf_dependency_set_dep_file (buf);
+ }
+ else
+ jcf_dependency_set_dep_file ("-");
+
+ free (buf);
+ }
+ }
+ }
+ }
+
/* Initialize the compiler back end. */
return false;
}
extern void lhd_do_nothing_i PARAMS ((int));
extern void lhd_do_nothing_f PARAMS ((struct function *));
extern int lhd_decode_option PARAMS ((int, char **));
+extern bool lhd_post_options PARAMS ((const char **));
extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
extern tree lhd_return_tree PARAMS ((tree));
extern tree lhd_return_null_tree PARAMS ((tree));
#define LANG_HOOKS_NAME "GNU unknown"
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
-#define LANG_HOOKS_INIT lhd_do_nothing
+#define LANG_HOOKS_INIT hook_bool_void_false
#define LANG_HOOKS_FINISH lhd_do_nothing
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
#define LANG_HOOKS_INIT_OPTIONS lhd_do_nothing
#define LANG_HOOKS_DECODE_OPTION lhd_decode_option
-#define LANG_HOOKS_POST_OPTIONS hook_bool_void_false
+#define LANG_HOOKS_POST_OPTIONS lhd_post_options
#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
#define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree
#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
return 0;
}
+/* The default post options hook. */
+
+bool
+lhd_post_options (pfilename)
+ const char **pfilename ATTRIBUTE_UNUSED;
+{
+ return false;
+}
+
/* Called from by print-tree.c. */
void
done for this option. */
int (*decode_option) PARAMS ((int, char **));
- /* Called when all command line options have been parsed. Should do
- any required consistency checks, modifications etc. Complex
- initialization should be left to the "init" callback, since GC
- and the identifier hashes are set up between now and then.
+ /* Called when all command line options have been parsed to allow
+ further processing and initialization
- Should return zero unless the compiler back-end does not need to
- be initialized, such as with the -E option.
+ Should return true to indicate that a compiler back-end is
+ not required, such as with the -E option.
If errorcount is nonzero after this call the compiler exits
immediately and the finish hook is not called. */
- bool (*post_options) PARAMS ((void));
-
- /* Called after post_options, to initialize the front end. The main
- input filename is passed, which may be NULL; the front end should
- return the original filename (e.g. foo.i -> foo.c). Return NULL
- to indicate a serious error of some sort; in that case no
- compilation is performed, and the finish hook is called
- immediately. */
- const char * (*init) PARAMS ((const char *));
+ bool (*post_options) PARAMS ((const char **));
+
+ /* Called after post_options to initialize the front end. Return
+ false to indicate that no further compilation be performed, in
+ which case the finish hook is called immediately. */
+ bool (*init) PARAMS ((void));
/* Called at the end of compilation, as a finalizer. */
void (*finish) PARAMS ((void));
exit (0);
}
-const char *
-objc_init (filename)
- const char *filename;
+bool
+objc_init ()
{
- filename = c_objc_common_init (filename);
- if (filename == NULL)
- return filename;
+ if (c_objc_common_init () == false)
+ return false;
/* Force the line number back to 0; check_newline will have
raised it to 1, which will make the builtin functions appear
if (print_struct_values)
generate_struct_by_value_array ();
- return filename;
+ return true;
}
void
/*** Public Interface (procedures) ***/
-const char *objc_init PARAMS ((const char *));
+bool objc_init PARAMS ((void));
const char *objc_printable_name PARAMS ((tree, int));
/* used by yyparse */
static void general_init PARAMS ((char *));
static void parse_options_and_default_flags PARAMS ((int, char **));
-static void do_compile PARAMS ((int));
+static void do_compile PARAMS ((void));
static void process_options PARAMS ((void));
static void backend_init PARAMS ((void));
static int lang_dependent_init PARAMS ((const char *));
/* Nonzero to dump debug info whilst parsing (-dy option). */
static int set_yydebug;
+/* True if we don't need a backend (e.g. preprocessing only). */
+static bool no_backend;
+
/* Length of line when printing switch values. */
#define MAX_LINE 75
static void
process_options ()
{
+ /* Allow the front end to perform consistency checks and do further
+ initialization based on the command line options. This hook also
+ sets the original filename if appropriate (e.g. foo.i -> foo.c)
+ so we can correctly initialize debug output. */
+ no_backend = (*lang_hooks.post_options) (&filename);
+ main_input_filename = input_filename = filename;
+
#ifdef OVERRIDE_OPTIONS
/* Some machines may reject certain combinations of options. */
OVERRIDE_OPTIONS;
if (dump_base_name == 0)
dump_base_name = name ? name : "gccdump";
- /* Front-end initialization. This hook can assume that GC,
- identifier hashes etc. are set up, but debug initialization is
- not done yet. This routine must return the original filename
- (e.g. foo.i -> foo.c) so can correctly initialize debug output. */
- name = (*lang_hooks.init) (name);
- if (name == NULL)
+ /* Other front-end initialization. */
+ if ((*lang_hooks.init) () == 0)
return 0;
- main_input_filename = input_filename = name;
init_asm_output (name);
/* These create various _DECL nodes, so need to be called after the
\f
/* Initialize the compiler, and compile the input file. */
static void
-do_compile (no_backend)
- int no_backend;
+do_compile ()
{
/* We cannot start timing until after options are processed since that
says if we run timers or not. */
/* Exit early if we can (e.g. -help). */
if (!exit_after_options)
{
- /* All command line options have been parsed; allow the front
- end to perform consistency checks, etc. */
- bool no_backend = (*lang_hooks.post_options) ();
-
- /* The bulk of command line switch processing. */
process_options ();
/* Don't do any more if an error has already occurred. */
if (!errorcount)
- do_compile (no_backend);
+ do_compile ();
}
if (errorcount || sorrycount)
+2003-03-08 Neil Booth <neil@daikokuya.co.uk>
+
+ * tree1.c (in_fname): Fix type.
+ (treelang_init): Update prototype and use of in_fname.
+ * treelang.h (in_fname): Fix type.
+ * treetree.c (tree_code_if_start, tree_code_if_else,
+ tree_code_if_end, tree_code_create_function_prototype,
+ tree_code_create_function_initial, tree_code_create_funciton_wrapup,
+ tree_code_create_variable, tree_code_output_expression_statement)
+ : Fix prototypes and use of filenames.
+ * treetree.h: Similarly.
+
2003-03-05 Andreas Jaeger <aj@suse.de>
* treetree.c (init_c_lex): Follow change to c-common.h.
/* Local variables. */
-unsigned char *in_fname = NULL; /* Input file name. */
+const char *in_fname; /* Input file name. */
/* This is 1 if we have output the version string. */
/* Language dependent parser setup. */
-const char*
-treelang_init (const char* filename)
+bool
+treelang_init ()
{
- /* Set up the declarations needed for this front end. */
+ in_fname = main_input_filename;
- input_filename = "";
+ /* Set up the declarations needed for this front end. */
lineno = 0;
/* Init decls etc. */
/* This error will not happen from GCC as it will always create a
fake input file. */
- if (!filename || (filename[0] == ' ') || (!filename[0]))
+ if (!in_fname || in_fname[0] == ' ' || !in_fname[0])
{
if (!version_done)
{
exit (1);
}
- in_fname = NULL;
- return NULL;
+ return false;
}
- yyin = fopen (filename, "r");
+
+ yyin = fopen (in_fname, "r");
if (!yyin)
{
- fprintf (stderr, "Unable to open input file %s\n", filename);
+ fprintf (stderr, "Unable to open input file %s\n", in_fname);
exit (1);
}
- input_filename = filename;
- return (char*) (in_fname = (unsigned char*)filename);
+
+ return true;
}
/* Language dependent wrapup. */
};
/* Input file name and FILE. */
-extern unsigned char* in_fname;
+extern const char* in_fname;
extern FILE* yyin;
/* Forward references to satisfy mutually recursive definitions. */
LINENO in file FILENAME. */
void
-tree_code_if_start (tree exp, unsigned char* filename, int lineno)
+tree_code_if_start (tree exp, const char* filename, int lineno)
{
tree cond_exp;
cond_exp = build (NE_EXPR,
TREE_TYPE (exp),
exp,
build1 (CONVERT_EXPR, TREE_TYPE (exp), integer_zero_node));
- emit_line_note ((const char *)filename, lineno); /* Output the line number information. */
+ emit_line_note (filename, lineno); /* Output the line number information. */
expand_start_cond (cond_exp, /* Exit-able if nonzero. */ 0);
}
at line LINENO in file FILENAME. */
void
-tree_code_if_else (unsigned char* filename, int lineno)
+tree_code_if_else (const char* filename, int lineno)
{
- emit_line_note ((const char *)filename, lineno); /* Output the line number information. */
+ emit_line_note (filename, lineno); /* Output the line number information. */
expand_start_else ();
}
at line LINENO in file FILENAME. */
void
-tree_code_if_end (unsigned char* filename, int lineno)
+tree_code_if_end (const char* filename, int lineno)
{
- emit_line_note ((const char *)filename, lineno); /* Output the line number information. */
+ emit_line_note (filename, lineno); /* Output the line number information. */
expand_end_cond ();
}
unsigned int storage_class,
unsigned int ret_type,
struct prod_token_parm_item* parms,
- unsigned char* filename,
+ const char* filename,
int lineno)
{
fn_decl = build_decl (FUNCTION_DECL, id, fn_type);
DECL_CONTEXT (fn_decl) = NULL_TREE; /* Nested functions not supported here. */
- DECL_SOURCE_FILE (fn_decl) = (const char *)filename;
+ DECL_SOURCE_FILE (fn_decl) = filename;
/* if (lineno > 1000000)
; */ /* Probably the line # is rubbish because someone forgot to set
the line number - and unfortunately impossible line #s are used as
parameter details are in the lists PARMS. Returns nothing. */
void
tree_code_create_function_initial (tree prev_saved,
- unsigned char* filename,
+ const char* filename,
int lineno,
struct prod_token_parm_item* parms)
{
current_function_decl = fn_decl;
DECL_INITIAL (fn_decl) = error_mark_node;
- DECL_SOURCE_FILE (fn_decl) = (const char *)filename;
+ DECL_SOURCE_FILE (fn_decl) = filename;
DECL_SOURCE_LINE (fn_decl) = lineno;
/* Prepare creation of rtl for a new function. */
resultdecl = DECL_RESULT (fn_decl) = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (fn_decl)));
DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
- DECL_SOURCE_FILE (resultdecl) = (const char *)filename;
+ DECL_SOURCE_FILE (resultdecl) = filename;
DECL_SOURCE_LINE (resultdecl) = lineno;
/* Work out the size. ??? is this needed. */
layout_decl (DECL_RESULT (fn_decl), 0);
if (!fn_decl)
abort ();
DECL_CONTEXT (parm_decl) = fn_decl;
- DECL_SOURCE_FILE (parm_decl) = (const char *)filename;
+ DECL_SOURCE_FILE (parm_decl) = filename;
DECL_SOURCE_LINE (parm_decl) = lineno;
parm_list = chainon (parm_decl, parm_list);
}
make_decl_rtl (fn_decl, NULL);
/* Use filename/lineno from above. */
- init_function_start (fn_decl, (const char *)filename, lineno);
+ init_function_start (fn_decl, filename, lineno);
/* Create rtl for startup code of function, such as saving registers. */
expand_start_bindings (0);
- emit_line_note ((const char *)filename, lineno); /* Output the line number information. */
+ emit_line_note (filename, lineno); /* Output the line number information. */
}
/* Wrapup a function contained in file FILENAME, ending at line LINENO. */
void
-tree_code_create_function_wrapup (unsigned char* filename,
+tree_code_create_function_wrapup (const char* filename,
int lineno)
{
tree block;
fn_decl = current_function_decl;
- emit_line_note ((const char *)filename, lineno); /* Output the line number information. */
+ emit_line_note (filename, lineno); /* Output the line number information. */
/* Get completely built level from debugger symbol table. */
/* Emit rtl for end of function. */
- expand_function_end ((const char *)filename, lineno, 0);
+ expand_function_end (filename, lineno, 0);
/* Pop the level. */
unsigned int length,
unsigned int expression_type,
tree init,
- unsigned char* filename,
+ const char* filename,
int lineno)
{
tree var_type;
DECL_CONTEXT (var_decl) = current_function_decl;
- DECL_SOURCE_FILE (var_decl) = (const char *)filename;
+ DECL_SOURCE_FILE (var_decl) = filename;
DECL_SOURCE_LINE (var_decl) = lineno;
/* Set the storage mode and whether only visible in the same file. */
void
tree_code_output_expression_statement (tree code,
- unsigned char* filename, int lineno)
+ const char* filename, int lineno)
{
/* Output the line number information. */
- emit_line_note ((const char *)filename, lineno);
+ emit_line_note (filename, lineno);
TREE_USED (code) = 1;
TREE_SIDE_EFFECTS (code) = 1;
expand_expr_stmt (code);
tree tree_code_get_expression (unsigned int exp_type, tree type, tree op1, tree op2, tree op3);
tree tree_code_get_numeric_type (unsigned int size1, unsigned int sign1);
void tree_code_create_function_initial (tree prev_saved,
- unsigned char* filename, int lineno,
+ const char* filename, int lineno,
struct prod_token_parm_item* parms);
-void tree_code_create_function_wrapup (unsigned char* filename, int lineno);
+void tree_code_create_function_wrapup (const char* filename, int lineno);
tree tree_code_create_function_prototype (unsigned char* chars,
unsigned int storage_class,
unsigned int ret_type,
struct prod_token_parm_item* parms,
- unsigned char* filename,
+ const char* filename,
int lineno);
tree tree_code_create_variable (unsigned int storage_class,
unsigned char* chars,
unsigned int length,
unsigned int expression_type,
tree init,
- unsigned char* filename,
+ const char* filename,
int lineno);
-void tree_code_output_expression_statement (tree code, unsigned char* filename, int lineno);
+void tree_code_output_expression_statement (tree code, const char* filename, int lineno);
tree get_type_for_numeric_type (unsigned int numeric_type);
-void tree_code_if_start (tree exp, unsigned char* filename, int lineno);
-void tree_code_if_else (unsigned char* filename, int lineno);
-void tree_code_if_end (unsigned char* filename, int lineno);
+void tree_code_if_start (tree exp, const char* filename, int lineno);
+void tree_code_if_else (const char* filename, int lineno);
+void tree_code_if_end (const char* filename, int lineno);
tree tree_code_get_type (int type_num);
void treelang_init_decl_processing (void);
void treelang_finish (void);
-const char *treelang_init (const char* filename);
+bool treelang_init (void);
int treelang_decode_option (int, char **);
void treelang_parse_file (int debug_flag);
void push_var_level (void);