* gengtype.c (output_mangled_typename, write_types, write_local):
Likewise.
* gengtype.h (const_type_p): New.
* see.c (eq_descriptor_extension, hash_descriptor_extension):
Constify.
* tlink.c (scan_linker_output): De-constify.
* tree-ssa-loop-im.c (memref_eq): Constify.
* tree-ssa-structalias.c (const_shared_bitmap_info_t): New.
(shared_bitmap_hash, shared_bitmap_eq): Constify.
cp:
* parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
Constify.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126926
138bc75d-0d04-0410-961f-
82ee72b054a4
2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * cselib.c (entry_and_rtx_equal_p): Constify.
+ * gengtype.c (output_mangled_typename, write_types, write_local):
+ Likewise.
+ * gengtype.h (const_type_p): New.
+ * see.c (eq_descriptor_extension, hash_descriptor_extension):
+ Constify.
+ * tlink.c (scan_linker_output): De-constify.
+ * tree-ssa-loop-im.c (memref_eq): Constify.
+ * tree-ssa-structalias.c (const_shared_bitmap_info_t): New.
+ (shared_bitmap_hash, shared_bitmap_eq): Constify.
+
+2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
* c-common.c (fname_as_string, c_type_hash): Constify.
* c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise.
* cgraph.c (edge_hash, edge_eq): Likewise.
2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
+ Constify.
+
+2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
* decl.c (typename_hash, typename_compare): Constify.
* mangle.c (hash_type, compare_type): Likewise.
* pt.c (eq_local_specializations, hash_local_specialization):
{
cp_lexer_consume_token (parser->lexer);
count++;
- str.text = (unsigned char *)TREE_STRING_POINTER (tok->u.value);
+ str.text = (const unsigned char *)TREE_STRING_POINTER (tok->u.value);
str.len = TREE_STRING_LENGTH (tok->u.value);
if (tok->type == CPP_WSTRING)
wide = true;
static const char *format;
tree expr = NULL_TREE;
const char *saved_message;
+ char *tmp;
bool saved_integral_constant_expression_p;
bool saved_non_integral_constant_expression_p;
bool pack_expansion_p = false;
old message. */
saved_message = parser->type_definition_forbidden_message;
/* And create the new one. */
- parser->type_definition_forbidden_message
- = XNEWVEC (const char, strlen (format)
+ parser->type_definition_forbidden_message = tmp
+ = XNEWVEC (char, strlen (format)
+ strlen (IDENTIFIER_POINTER (ridpointers[keyword]))
+ 1 /* `\0' */);
- sprintf ((char *) parser->type_definition_forbidden_message,
- format, IDENTIFIER_POINTER (ridpointers[keyword]));
+ sprintf (tmp, format, IDENTIFIER_POINTER (ridpointers[keyword]));
/* The restrictions on constant-expressions do not apply inside
sizeof expressions. */
--skip_evaluation;
/* Free the message we created. */
- free ((char *) parser->type_definition_forbidden_message);
+ free (tmp);
/* And restore the old one. */
parser->type_definition_forbidden_message = saved_message;
parser->integral_constant_expression_p
entry_and_rtx_equal_p (const void *entry, const void *x_arg)
{
struct elt_loc_list *l;
- const cselib_val *v = (const cselib_val *) entry;
+ const cselib_val *const v = (const cselib_val *) entry;
rtx x = (rtx) x_arg;
enum machine_mode mode = GET_MODE (x);
static void output_escaped_param (struct walk_type_data *d,
const char *, const char *);
-static void output_mangled_typename (outf_p, type_p);
+static void output_mangled_typename (outf_p, const_type_p);
static void walk_type (type_p t, struct walk_type_data *d);
static void write_func_for_structure
(type_p orig_s, type_p s, type_p * param,
/* Print a mangled name representing T to OF. */
static void
-output_mangled_typename (outf_p of, type_p t)
+output_mangled_typename (outf_p of, const_type_p t)
{
if (t == NULL)
oprintf (of, "Z");
for (opt = s->u.s.opt; opt; opt = opt->next)
if (strcmp (opt->name, "ptr_alias") == 0)
{
- type_p t = (type_p) opt->info;
+ const_type_p const t = (const_type_p) opt->info;
if (t->kind == TYPE_STRUCT
|| t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT)
for (opt = s->u.s.opt; opt; opt = opt->next)
if (strcmp (opt->name, "ptr_alias") == 0)
{
- type_p t = (type_p) opt->info;
+ const_type_p const t = (const_type_p) opt->info;
if (t->kind == TYPE_STRUCT
|| t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT)
/* Data types handed around within, but opaque to, the lexer and parser. */
typedef struct pair *pair_p;
typedef struct type *type_p;
+typedef const struct type *const_type_p;
typedef struct options *options_p;
/* Variables used to communicate between the lexer and the parser. */
static int
eq_descriptor_extension (const void *p1, const void *p2)
{
- const rtx insn = (rtx) p1;
- const rtx element = (rtx) p2;
+ const_rtx const insn = (const_rtx) p1;
+ const_rtx const element = (const_rtx) p2;
rtx set1 = single_set (insn);
rtx dest_reg1;
rtx set2 = NULL;
- rtx dest_reg2 = NULL;
+ const_rtx dest_reg2 = NULL;
gcc_assert (set1 && element && (REG_P (element) || INSN_P (element)));
static hashval_t
hash_descriptor_extension (const void *p)
{
- const rtx r = (rtx) p;
+ const_rtx const r = (const_rtx) p;
rtx set, lhs;
if (r && REG_P (r))
if (! sym && ! end)
/* Try a mangled name in quotes. */
{
- const char *oldq = q + 1;
+ char *oldq = q + 1;
demangled *dem = 0;
q = 0;
static int
memref_eq (const void *obj1, const void *obj2)
{
- const struct mem_ref *mem1 = (const struct mem_ref *) obj1;
+ const struct mem_ref *const mem1 = (const struct mem_ref *) obj1;
return operand_equal_p (mem1->mem, (tree) obj2, 0);
}
bitmap pt_vars;
hashval_t hashcode;
} *shared_bitmap_info_t;
+typedef const struct shared_bitmap_info *const_shared_bitmap_info_t;
static htab_t shared_bitmap_table;
static hashval_t
shared_bitmap_hash (const void *p)
{
- const shared_bitmap_info_t bi = (shared_bitmap_info_t) p;
+ const_shared_bitmap_info_t const bi = (const_shared_bitmap_info_t) p;
return bi->hashcode;
}
static int
shared_bitmap_eq (const void *p1, const void *p2)
{
- const shared_bitmap_info_t sbi1 = (shared_bitmap_info_t) p1;
- const shared_bitmap_info_t sbi2 = (shared_bitmap_info_t) p2;
+ const_shared_bitmap_info_t const sbi1 = (const_shared_bitmap_info_t) p1;
+ const_shared_bitmap_info_t const sbi2 = (const_shared_bitmap_info_t) p2;
return bitmap_equal_p (sbi1->pt_vars, sbi2->pt_vars);
}