aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-04-24 15:31:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-04-24 15:31:38 +0000
commit32e8bb8ebfa8711799ed8f90326e9857e894ad8b (patch)
treecb72f4fe59cfd12ca2739fb042e2be3d62f721b6 /gcc/cp
parentac4fc08a0a80b216618a84b9452b38d5a22e82de (diff)
downloadgcc-32e8bb8ebfa8711799ed8f90326e9857e894ad8b.zip
gcc-32e8bb8ebfa8711799ed8f90326e9857e894ad8b.tar.gz
gcc-32e8bb8ebfa8711799ed8f90326e9857e894ad8b.tar.bz2
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/call.c2
-rw-r--r--gcc/cp/cp-gimplify.c2
-rw-r--r--gcc/cp/cp-tree.h8
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/parser.c13
-rw-r--r--gcc/cp/semantics.c3
-rw-r--r--gcc/cp/typeck.c3
8 files changed, 37 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9f0db7b..e15834d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,18 @@
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * call.c (build_temp): Change 0 to enum constant.
+ * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
+ type.
+ * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
+ * decl2.c (constrain_visibility): Likewise.
+ * parser.c (cp_lexer_get_preprocessor_token): Likewise.
+ (cp_parser_flags): Typedef to int rather than enum type.
+ (cp_parser_expression_stack_entry): Change prec field to enum
+ cp_parser_prec.
+
+ * typeck.c (build_modify_expr): Add lhs_origtype parameter.
+ Change all callers.
+
2009-04-22 Dodji Seketeli <dodji@redhat.com>
PR c++/39639
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 4eae733..ca45bee 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4484,7 +4484,7 @@ build_temp (tree expr, tree type, int flags,
else if (errorcount > savee)
*diagnostic_kind = DK_ERROR;
else
- *diagnostic_kind = 0;
+ *diagnostic_kind = DK_UNSPECIFIED;
return expr;
}
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index bb12988..4664157 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -653,7 +653,7 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
break;
default:
- ret = c_gimplify_expr (expr_p, pre_p, post_p);
+ ret = (enum gimplify_status) c_gimplify_expr (expr_p, pre_p, post_p);
break;
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index a4fc7c0..1f3d0c1 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3466,13 +3466,17 @@ enum tag_types {
};
/* The various kinds of lvalues we distinguish. */
-typedef enum cp_lvalue_kind {
+enum cp_lvalue_kind {
clk_none = 0, /* Things that are not an lvalue. */
clk_ordinary = 1, /* An ordinary lvalue. */
clk_class = 2, /* An rvalue of class-type. */
clk_bitfield = 4, /* An lvalue for a bit-field. */
clk_packed = 8 /* An lvalue for a packed field. */
-} cp_lvalue_kind;
+};
+
+/* This type is used for parameters and variables which hold
+ combinations of the flags in enum cp_lvalue_kind. */
+typedef int cp_lvalue_kind;
/* Various kinds of template specialization, instantiation, etc. */
typedef enum tmpl_spec_kind {
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 12876ad..8196b54 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1848,7 +1848,7 @@ constrain_visibility (tree decl, int visibility)
else if (visibility > DECL_VISIBILITY (decl)
&& !DECL_VISIBILITY_SPECIFIED (decl))
{
- DECL_VISIBILITY (decl) = visibility;
+ DECL_VISIBILITY (decl) = (enum symbol_visibility) visibility;
return true;
}
return false;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d98cfdd..9829275 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -465,7 +465,8 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
else if (token->type == CPP_PRAGMA)
{
/* We smuggled the cpp_token->u.pragma value in an INTEGER_CST. */
- token->pragma_kind = TREE_INT_CST_LOW (token->u.value);
+ token->pragma_kind = ((enum pragma_kind)
+ TREE_INT_CST_LOW (token->u.value));
token->u.value = NULL_TREE;
}
}
@@ -1187,7 +1188,7 @@ function_declarator_p (const cp_declarator *declarator)
/* Flags that are passed to some parsing functions. These values can
be bitwise-ored together. */
-typedef enum cp_parser_flags
+enum cp_parser_flags
{
/* No flags. */
CP_PARSER_FLAGS_NONE = 0x0,
@@ -1196,7 +1197,11 @@ typedef enum cp_parser_flags
CP_PARSER_FLAGS_OPTIONAL = 0x1,
/* When parsing a type-specifier, do not allow user-defined types. */
CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES = 0x2
-} cp_parser_flags;
+};
+
+/* This type is used for parameters and variables which hold
+ combinations of the flags in enum cp_parser_flags. */
+typedef int cp_parser_flags;
/* The different kinds of declarators we want to parse. */
@@ -1268,7 +1273,7 @@ typedef struct cp_parser_expression_stack_entry
/* Tree code for the binary operation we are parsing. */
enum tree_code tree_type;
/* Precedence of the binary operation we are parsing. */
- int prec;
+ enum cp_parser_prec prec;
} cp_parser_expression_stack_entry;
/* The stack for storing partial expressions. We only need NUM_PREC_VALUES
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 47d9a24..50e036d 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4128,7 +4128,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
cond = cp_build_binary_op (elocus,
TREE_CODE (cond), decl, diff,
tf_warning_or_error);
- incr = build_modify_expr (elocus, decl, PLUS_EXPR, incr, NULL_TREE);
+ incr = build_modify_expr (elocus, decl, NULL_TREE, PLUS_EXPR,
+ incr, NULL_TREE);
orig_body = *body;
*body = push_stmt_list ();
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index d9222dc..69d5529 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5870,7 +5870,8 @@ cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain)
/* For use from the C common bits. */
tree
build_modify_expr (location_t location ATTRIBUTE_UNUSED,
- tree lhs, enum tree_code modifycode, tree rhs,
+ tree lhs, tree lhs_origtype ATTRIBUTE_UNUSED,
+ enum tree_code modifycode, tree rhs,
tree rhs_origtype ATTRIBUTE_UNUSED)
{
return cp_build_modify_expr (lhs, modifycode, rhs, tf_warning_or_error);