aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-09-03 17:09:20 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-09-03 17:09:20 +0000
commitb1d5455a5efad3f380671cf818515a1a6ec94546 (patch)
treec67ebc05c0f9f25bf5e2c4cfeb978cad7945373c /gcc/cp
parentd74b97cc7e574d56c7542f40a76b151e7088829b (diff)
downloadgcc-b1d5455a5efad3f380671cf818515a1a6ec94546.zip
gcc-b1d5455a5efad3f380671cf818515a1a6ec94546.tar.gz
gcc-b1d5455a5efad3f380671cf818515a1a6ec94546.tar.bz2
system.h (CONST_CAST2, [...]): New macros for type-specific casts.
* system.h (CONST_CAST2, CONST_CAST_TREE, CONST_CAST_RTX, CONST_CAST_BB): New macros for type-specific casts. (CONST_CAST): Add a TYPE parameter and define it in terms of CONST_CAST2. * c-decl.c (c_make_fname_decl): Supply a TYPE for CONST_CAST. * c-lex.c (cb_ident, lex_string): Likewise, * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise, * config/i386/i386.c (ix86_function_regparm, ix86_function_sseregparm): Use CONST_CAST_TREE. * config/mmix/mmix.c (mmix_encode_section_info): Supply a TYPE for CONST_CAST. * gcc.c (set_spec, read_specs, for_each_path, execute, do_spec_1, give_switch, set_multilib_dir): Likewise, * gengtype-parse.c (string_seq, typedef_name): Likewise, * gimple-low.c (block_may_fallthru): Use CONST_CAST_TREE. * jump.c (reversed_comparison_code_parts): Use CONST_CAST_RTX. * passes.c (execute_one_pass): Supply a TYPE for CONST_CAST. * prefix.c (update_path): Likewise, * pretty-print.c (pp_base_destroy_prefix): Likewise, * rtlanal.c (keep_with_call_p): Use CONST_CAST_RTX. * tree-cfg.c (tree_can_merge_blocks_p, tree_block_ends_with_condjump_p): Use CONST_CAST_BB. * tree-eh.c (lookup_stmt_eh_region_fn): USe CONST_CAST_TREE. * tree.c (build_string): Supply a TYPE for CONST_CAST. (attribute_list_contained): Use CONST_CAST_TREE. cp: * call.c (name_as_c_string): Supply a TYPE for CONST_CAST. * decl.c (cp_make_fname_decl): Likewise, * parser.c (cp_parser_string_literal): Likewise, * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE. * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p): Likewise, fortran: * gfortranspec.c (lang_specific_driver): Use CONST_CAST2. * options.c (gfc_post_options): Supply a TYPE for CONST_CAST. * parse.c (parse_omp_structured_block): Likewise, * st.c (gfc_free_statement): Likewise, java: * jcf-parse.c (read_class, java_parse_file): Supply a TYPE for CONST_CAST. * jcf.h (JCF_FINISH): Likewise. From-SVN: r128051
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/cp/typeck.c6
6 files changed, 18 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4cb5476..f52770d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
+ * decl.c (cp_make_fname_decl): Likewise,
+ * parser.c (cp_parser_string_literal): Likewise,
+ * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
+ * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
+ Likewise,
+
2007-09-02 Paolo Carlini <pcarlini@suse.de>
PR c++/33208
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 4dae84a..8fb818b 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -5388,7 +5388,7 @@ name_as_c_string (tree name, tree type, bool *free_p)
if (IDENTIFIER_CTOR_OR_DTOR_P (name))
{
pretty_name
- = (char *) CONST_CAST (IDENTIFIER_POINTER (constructor_name (type)));
+ = CONST_CAST (char *, IDENTIFIER_POINTER (constructor_name (type)));
/* For a destructor, add the '~'. */
if (name == complete_dtor_identifier
|| name == base_dtor_identifier
@@ -5409,7 +5409,7 @@ name_as_c_string (tree name, tree type, bool *free_p)
*free_p = true;
}
else
- pretty_name = (char *) CONST_CAST (IDENTIFIER_POINTER (name));
+ pretty_name = CONST_CAST (char *, IDENTIFIER_POINTER (name));
return pretty_name;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d48d0fa..fba084d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3461,7 +3461,7 @@ cp_make_fname_decl (tree id, int type_dep)
tree decl = build_decl (VAR_DECL, id, type);
if (name)
- free (CONST_CAST (name));
+ free (CONST_CAST (char *, name));
/* As we're using pushdecl_with_scope, we must set the context. */
DECL_CONTEXT (decl) = current_function_decl;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 92f4430..d39721e 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2923,7 +2923,7 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
(parse_in, strs, count, &istr, wide))
{
value = build_string (istr.len, (const char *)istr.text);
- free (CONST_CAST (istr.text));
+ free (CONST_CAST (unsigned char *, istr.text));
TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node;
value = fix_string_type (value);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 3424f7a..9a1ad13 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2054,7 +2054,7 @@ pod_type_p (const_tree t)
{
/* This CONST_CAST is okay because strip_array_types returns it's
argument unmodified and we assign it to a const_tree. */
- t = strip_array_types ((tree)CONST_CAST(t));
+ t = strip_array_types (CONST_CAST_TREE(t));
if (t == error_mark_node)
return 1;
@@ -2093,7 +2093,7 @@ zero_init_p (const_tree t)
{
/* This CONST_CAST is okay because strip_array_types returns it's
argument unmodified and we assign it to a const_tree. */
- t = strip_array_types ((tree)CONST_CAST(t));
+ t = strip_array_types (CONST_CAST_TREE(t));
if (t == error_mark_node)
return 1;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ae39b59..45988db 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -6946,7 +6946,7 @@ cp_type_quals (const_tree type)
{
/* This CONST_CAST is okay because strip_array_types returns it's
argument unmodified and we assign it to a const_tree. */
- type = strip_array_types ((tree)CONST_CAST(type));
+ type = strip_array_types (CONST_CAST_TREE(type));
if (type == error_mark_node)
return TYPE_UNQUALIFIED;
return TYPE_QUALS (type);
@@ -6960,7 +6960,7 @@ cp_type_readonly (const_tree type)
{
/* This CONST_CAST is okay because strip_array_types returns it's
argument unmodified and we assign it to a const_tree. */
- type = strip_array_types ((tree)CONST_CAST(type));
+ type = strip_array_types (CONST_CAST_TREE(type));
return TYPE_READONLY (type);
}
@@ -6971,7 +6971,7 @@ cp_has_mutable_p (const_tree type)
{
/* This CONST_CAST is okay because strip_array_types returns it's
argument unmodified and we assign it to a const_tree. */
- type = strip_array_types ((tree)CONST_CAST(type));
+ type = strip_array_types (CONST_CAST_TREE(type));
return CLASS_TYPE_P (type) && CLASSTYPE_HAS_MUTABLE (type);
}