aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog22
-rw-r--r--gcc/cp/cp-tree.h10
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/input.c9
-rw-r--r--gcc/cp/lex.c24
-rw-r--r--gcc/cp/pt.c13
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/cp/typeck.c2
10 files changed, 53 insertions, 37 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index fa1c7f1..bd7f0ea 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,25 @@
+2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
+
+ * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file,
+ and pending_inline.filename. Update prototypes.
+ * decl.c (define_label): Constify filename parameter.
+ * decl2.c (warn_if_unknown_interface): Constify local char *.
+ * input.c Constify input_source.filename. Don't declare
+ input_filename or lineno. Constify filename parameter to feed_input.
+ * lex.c (init_parse): Constify parameter and return value.
+ (cp_pragma_interface, cp_pragma_implementation): Constify
+ filename argument.
+ (reinit_parse_for_method, reinit_parse_for_block,
+ reinit_parse_for_expr, feed_defarg, handle_cp_pragma):
+ Constify local char *.
+ * pt.c: Don't declare lineno or input_filename.
+ (print_template_context, tsubst_friend_function, tsubst_decl,
+ tsubst, instantiate_decl): Constify local char *.
+ * semantics.c (expand_body): Constify local char *.
+ * tree.c (build_srcloc): Constify filename parameter.
+ * typeck.c (c_expand_asm_operands): Constify filename
+ parameter.
+
2000-05-08 Nathan Sidwell <nathan@codesourcery.com>
* tinfo.cc (__dynamic_cast): Use a reinterpret_cast. Fix
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index cb46967..c7c0933 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -399,7 +399,7 @@ struct tree_wrapper
struct tree_srcloc
{
char common[sizeof (struct tree_common)];
- char *filename;
+ const char *filename;
int linenum;
};
@@ -3338,7 +3338,7 @@ struct tinst_level
{
tree decl;
int line;
- char *file;
+ const char *file;
struct tinst_level *next;
};
@@ -3533,7 +3533,7 @@ struct pending_inline
{
struct pending_inline *next; /* pointer to next in chain */
int lineno; /* line number we got the text from */
- char *filename; /* name of file we were processing */
+ const char *filename; /* name of file we were processing */
tree fndecl; /* FUNCTION_DECL that brought us here */
int token; /* token we were scanning */
int token_value; /* value of token we were scanning (YYSTYPE) */
@@ -3910,7 +3910,7 @@ extern void push_class_level_binding PARAMS ((tree, tree));
extern tree implicitly_declare PARAMS ((tree));
extern tree lookup_label PARAMS ((tree));
extern tree declare_local_label PARAMS ((tree));
-extern tree define_label PARAMS ((char *, int, tree));
+extern tree define_label PARAMS ((const char *, int, tree));
extern void push_switch PARAMS ((void));
extern void pop_switch PARAMS ((void));
extern void define_case_label PARAMS ((void));
@@ -4593,7 +4593,7 @@ extern tree build_x_modify_expr PARAMS ((tree, enum tree_code, tree));
extern tree build_modify_expr PARAMS ((tree, enum tree_code, tree));
extern tree dubious_conversion_warnings PARAMS ((tree, tree, const char *, tree, int));
extern tree convert_for_initialization PARAMS ((tree, tree, tree, int, const char *, tree, int));
-extern void c_expand_asm_operands PARAMS ((tree, tree, tree, tree, int, char *, int));
+extern void c_expand_asm_operands PARAMS ((tree, tree, tree, tree, int, const char *, int));
extern void c_expand_return PARAMS ((tree));
extern tree c_expand_start_case PARAMS ((tree));
extern int comp_ptr_ttypes PARAMS ((tree, tree));
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 81203b4..b951773 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4794,7 +4794,7 @@ declare_local_label (id)
tree
define_label (filename, line, name)
- char *filename;
+ const char *filename;
int line;
tree name;
{
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 85bc908..ca660e0 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -867,7 +867,7 @@ warn_if_unknown_interface (decl)
{
struct tinst_level *til = tinst_for_decl ();
int sl = lineno;
- char *sf = input_filename;
+ const char *sf = input_filename;
if (til)
{
diff --git a/gcc/cp/input.c b/gcc/cp/input.c
index 3236158..8c96c37 100644
--- a/gcc/cp/input.c
+++ b/gcc/cp/input.c
@@ -54,7 +54,7 @@ struct input_source {
/* values to restore after reading all of current string */
struct pending_input *input;
#if !USE_CPPLIB
- char *filename;
+ const char *filename;
int lineno;
struct putback_buffer putback;
#endif
@@ -62,15 +62,12 @@ struct input_source {
static struct input_source *input, *free_inputs;
-extern char *input_filename;
-extern int lineno;
-
#if USE_CPPLIB
extern unsigned char *yy_cur, *yy_lim;
extern int yy_get_token ();
#endif
-extern void feed_input PARAMS ((char *, int, char *, int));
+extern void feed_input PARAMS ((char *, int, const char *, int));
extern void put_input PARAMS ((int));
extern void put_back PARAMS ((int));
extern int getch PARAMS ((void));
@@ -114,7 +111,7 @@ void
feed_input (str, len, file, line)
char *str;
int len;
- char *file;
+ const char *file;
int line;
{
struct input_source *inp = allocate_input ();
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index ba32971..34fea7e 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -65,8 +65,8 @@ static void feed_defarg PARAMS ((tree, tree));
static void store_pending_inline PARAMS ((tree, struct pending_inline *));
static void reinit_parse_for_expr PARAMS ((struct obstack *));
static int *init_cpp_parse PARAMS ((void));
-static void cp_pragma_interface PARAMS ((char *));
-static void cp_pragma_implementation PARAMS ((char *));
+static void cp_pragma_interface PARAMS ((const char *));
+static void cp_pragma_implementation PARAMS ((const char *));
static int handle_cp_pragma PARAMS ((const char *));
#ifdef HANDLE_GENERIC_PRAGMAS
static int handle_generic_pragma PARAMS ((int));
@@ -510,9 +510,9 @@ init_cpp_parse ()
return token_count;
}
-char *
+const char *
init_parse (filename)
- char *filename;
+ const char *filename;
{
extern int flag_no_gnu_keywords;
extern int flag_operator_names;
@@ -1188,7 +1188,7 @@ interface_strcmp (s)
static void
cp_pragma_interface (main_filename)
- char *main_filename;
+ const char *main_filename;
{
tree fileinfo
= TIME_IDENTIFIER_FILEINFO (get_time_identifier (input_filename));
@@ -1235,7 +1235,7 @@ cp_pragma_interface (main_filename)
static void
cp_pragma_implementation (main_filename)
- char *main_filename;
+ const char *main_filename;
{
struct impl_files *ifiles = impl_file_chain;
for (; ifiles; ifiles = ifiles->next)
@@ -1514,7 +1514,7 @@ reinit_parse_for_method (yychar, decl)
{
int len;
int starting_lineno = lineno;
- char *starting_filename = input_filename;
+ const char *starting_filename = input_filename;
reinit_parse_for_block (yychar, &inline_text_obstack);
@@ -1562,7 +1562,7 @@ reinit_parse_for_block (pyychar, obstackp)
register int c;
int blev = 1;
int starting_lineno = lineno;
- char *starting_filename = input_filename;
+ const char *starting_filename = input_filename;
int len;
int look_for_semicolon = 0;
int look_for_lbrac = 0;
@@ -1728,7 +1728,7 @@ reinit_parse_for_expr (obstackp)
{
register int c;
int starting_lineno = lineno;
- char *starting_filename = input_filename;
+ const char *starting_filename = input_filename;
int len;
int plev = 0;
@@ -1868,7 +1868,7 @@ feed_defarg (f, p)
tree f, p;
{
tree d = TREE_PURPOSE (p);
- char *file;
+ const char *file;
int line;
if (TREE_CODE (f) == FUNCTION_DECL)
{
@@ -2589,7 +2589,7 @@ handle_cp_pragma (pname)
}
else if (! strcmp (pname, "interface"))
{
- char *main_filename = input_filename;
+ const char *main_filename = input_filename;
main_filename = file_name_nondirectory (main_filename);
@@ -2616,7 +2616,7 @@ handle_cp_pragma (pname)
}
else if (! strcmp (pname, "implementation"))
{
- char *main_filename = main_input_filename ? main_input_filename : input_filename;
+ const char *main_filename = main_input_filename ? main_input_filename : input_filename;
main_filename = file_name_nondirectory (main_filename);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2e077c9..3b3f786 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -51,9 +51,6 @@ typedef int (*tree_fn_t) PARAMS ((tree, void*));
extern struct obstack permanent_obstack;
-extern int lineno;
-extern char *input_filename;
-
/* The PENDING_TEMPLATES is a TREE_LIST of templates whose
instantiations have been deferred, either because their definitions
were not yet available, or because we were putting off doing the
@@ -4240,7 +4237,7 @@ print_template_context (err)
{
struct tinst_level *p = current_tinst_level;
int line = lineno;
- char *file = input_filename;
+ const char *file = input_filename;
if (err && p)
{
@@ -4375,7 +4372,7 @@ tsubst_friend_function (decl, args)
{
tree new_friend;
int line = lineno;
- char *file = input_filename;
+ const char *file = input_filename;
lineno = DECL_SOURCE_LINE (decl);
input_filename = DECL_SOURCE_FILE (decl);
@@ -5389,7 +5386,7 @@ tsubst_decl (t, args, type, in_decl)
tree in_decl;
{
int saved_lineno;
- char* saved_filename;
+ const char *saved_filename;
tree r = NULL_TREE;
/* Set the filename and linenumber to improve error-reporting. */
@@ -6454,7 +6451,7 @@ tsubst (t, args, complain, in_decl)
|| (code == REFERENCE_TYPE && TREE_CODE (type) == VOID_TYPE))
{
static int last_line = 0;
- static char* last_file = 0;
+ static const char* last_file = 0;
/* We keep track of the last time we issued this error
message to avoid spewing a ton of messages during a
@@ -9434,7 +9431,7 @@ instantiate_decl (d, defer_ok)
tree gen_tmpl;
int pattern_defined;
int line = lineno;
- char *file = input_filename;
+ const char *file = input_filename;
/* This function should only be used to instantiate templates for
functions and static member variables. */
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index d6d493f..afa9ff2 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2694,7 +2694,7 @@ expand_body (fn)
tree fn;
{
int saved_lineno;
- char *saved_input_filename;
+ const char *saved_input_filename;
/* When the parser calls us after finishing the body of a template
function, we don't really want to expand the body. When we're
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 712e40d..078558e 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -40,7 +40,7 @@ static int list_hash PARAMS ((tree, tree, tree));
static tree list_hash_lookup PARAMS ((int, tree, tree, tree));
static cp_lvalue_kind lvalue_p_1 PARAMS ((tree, int));
static tree no_linkage_helper PARAMS ((tree *, int *, void *));
-static tree build_srcloc PARAMS ((char *, int));
+static tree build_srcloc PARAMS ((const char *, int));
static void mark_list_hash PARAMS ((void *));
static int statement_code_p PARAMS ((enum tree_code));
static tree mark_local_for_remap_r PARAMS ((tree *, int *, void *));
@@ -1989,7 +1989,7 @@ build_int_wrapper (i)
static tree
build_srcloc (file, line)
- char *file;
+ const char *file;
int line;
{
tree t;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 7d75d6f..671a666 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -6638,7 +6638,7 @@ void
c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
tree string, outputs, inputs, clobbers;
int vol;
- char *filename;
+ const char *filename;
int line;
{
int noutputs = list_length (outputs);