diff options
-rw-r--r-- | gcc/cp/ChangeLog | 29 | ||||
-rw-r--r-- | gcc/cp/class.c | 12 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 12 | ||||
-rw-r--r-- | gcc/cp/g++spec.c | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 2 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 5 | ||||
-rw-r--r-- | gcc/cp/parser.c | 23 | ||||
-rw-r--r-- | gcc/cp/pt.c | 7 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 3 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 6 |
11 files changed, 42 insertions, 68 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3a08602..7b2afd3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,32 @@ +2009-12-02 Jakub Jelinek <jakub@redhat.com> + + * g++spec.c (lang_specific_driver): Remove unused saw_verbose_flag + variable. + * pt.c (tsubst_pack_expansion): Remove unused first_arg_pack variable. + * init.c (build_vec_init): Remove unused size variable. + * typeck2.c (check_narrowing): Remove unused was_decl variable. + * decl.c (poplevel): Remove unused tmp and real_functionbody + variables. + (decls_match): Remove unused tree_name variable. + (start_decl): Remove unused type variable. + * parser.c (cp_parser_type_parameter): Remove unused parameter_list + variable. + (cp_parser_template_id, cp_parser_explicit_instantiation, + cp_parser_declarator): Remove unused token variable. + (cp_parser_simple_type_specifier): Remove unused id variable. + (cp_parser_parameter_declaration): Remove unused + greater_than_is_operator_p variable. + (cp_parser_check_declarator_template_parameters): Remove unused + member variable. + (c_parse_file): Remove unused error_occurred variable. + * cp-gimplify.c (cp_gimplify_init_expr): Remove unused slot variable. + * typeck.c (cp_build_function_call_vec): Remove unused name variable. + * class.c (resolve_address_of_overloaded_function): Remove unused + is_reference variable. + (build_rtti_vtbl_entries): Remove unused basetype variable. + * mangle.c (write_template_param): Remove unused parm_level and + parm_type variables. + 2009-12-01 Taras Glek <taras@mozilla.com> * parser.c (cp_parser_class_specifier): Set class location to that diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 38eb73f..1dcc238 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6059,7 +6059,6 @@ resolve_address_of_overloaded_function (tree target_type, selected function. */ int is_ptrmem = 0; - int is_reference = 0; /* We store the matches in a TREE_LIST rooted here. The functions are the TREE_PURPOSE, not the TREE_VALUE, in this list, for easy interoperability with most_specialized_instantiation. */ @@ -6082,12 +6081,9 @@ resolve_address_of_overloaded_function (tree target_type, /* This is OK, too. */ is_ptrmem = 1; else if (TREE_CODE (target_type) == FUNCTION_TYPE) - { - /* This is OK, too. This comes from a conversion to reference - type. */ - target_type = build_reference_type (target_type); - is_reference = 1; - } + /* This is OK, too. This comes from a conversion to reference + type. */ + target_type = build_reference_type (target_type); else { if (flags & tf_error) @@ -8043,12 +8039,10 @@ build_rtti_vtbl_entries (tree binfo, vtbl_init_data* vid) { tree b; tree t; - tree basetype; tree offset; tree decl; tree init; - basetype = BINFO_TYPE (binfo); t = BINFO_TYPE (vid->rtti_binfo); /* To find the complete object, we will first convert to our most diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 017c8a9..e0047cf 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -429,17 +429,13 @@ cp_gimplify_init_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) tree from = TREE_OPERAND (*expr_p, 1); tree to = TREE_OPERAND (*expr_p, 0); tree t; - tree slot = NULL_TREE; /* What about code that pulls out the temp and uses it elsewhere? I think that such code never uses the TARGET_EXPR as an initializer. If I'm wrong, we'll abort because the temp won't have any RTL. In that case, I guess we'll need to replace references somehow. */ if (TREE_CODE (from) == TARGET_EXPR) - { - slot = TARGET_EXPR_SLOT (from); - from = TARGET_EXPR_INITIAL (from); - } + from = TARGET_EXPR_INITIAL (from); /* Look through any COMPOUND_EXPRs, since build_compound_expr pushes them inside the TARGET_EXPR. */ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 95ec8d2..8f6d33c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -520,8 +520,6 @@ poplevel (int keep, int reverse, int functionbody) /* The chain of decls was accumulated in reverse order. Put it into forward order, just for cleanliness. */ tree decls; - int tmp = functionbody; - int real_functionbody; tree subblocks; tree block; tree decl; @@ -535,8 +533,8 @@ poplevel (int keep, int reverse, int functionbody) gcc_assert (current_binding_level->kind != sk_class); - real_functionbody = (current_binding_level->kind == sk_cleanup - ? ((functionbody = 0), tmp) : functionbody); + if (current_binding_level->kind == sk_cleanup) + functionbody = 0; subblocks = functionbody >= 0 ? current_binding_level->blocks : 0; gcc_assert (!VEC_length(cp_class_binding, @@ -1035,8 +1033,6 @@ decls_match (tree newdecl, tree olddecl) void warn_extern_redeclared_static (tree newdecl, tree olddecl) { - tree name; - if (TREE_CODE (newdecl) == TYPE_DECL || TREE_CODE (newdecl) == TEMPLATE_DECL || TREE_CODE (newdecl) == CONST_DECL @@ -1059,7 +1055,6 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl) && DECL_ARTIFICIAL (olddecl)) return; - name = DECL_ASSEMBLER_NAME (newdecl); permerror (input_location, "%qD was declared %<extern%> and later %<static%>", newdecl); permerror (input_location, "previous declaration of %q+D", olddecl); } @@ -4071,7 +4066,6 @@ start_decl (const cp_declarator *declarator, tree *pushed_scope_p) { tree decl; - tree type; tree context; bool was_public; int flags; @@ -4094,8 +4088,6 @@ start_decl (const cp_declarator *declarator, || decl == error_mark_node) return error_mark_node; - type = TREE_TYPE (decl); - context = DECL_CONTEXT (decl); if (context) diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 7ad268f..2853088 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -59,9 +59,6 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, /* If nonzero, the user gave us the `-p' or `-pg' flag. */ int saw_profile_flag = 0; - /* If nonzero, the user gave us the `-v' flag. */ - int saw_verbose_flag = 0; - /* What do with libstdc++: -1 means we should not link in libstdc++ 0 means we should link in libstdc++ if it is needed @@ -153,8 +150,6 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, args[i] |= WITHLIBC; else if (strcmp (argv[i], "-pg") == 0 || strcmp (argv[i], "-p") == 0) saw_profile_flag++; - else if (strcmp (argv[i], "-v") == 0) - saw_verbose_flag = 1; else if (strncmp (argv[i], "-x", 2) == 0) { const char * arg; diff --git a/gcc/cp/init.c b/gcc/cp/init.c index db29204..e639744 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2666,7 +2666,6 @@ build_vec_init (tree base, tree maxindex, tree init, { tree rval; tree base2 = NULL_TREE; - tree size; tree itype = NULL_TREE; tree iterator; /* The type of BASE. */ @@ -2724,7 +2723,6 @@ build_vec_init (tree base, tree maxindex, tree init, } maxindex = cp_convert (ptrdiff_type_node, maxindex); - size = size_in_bytes (type); if (TREE_CODE (atype) == ARRAY_TYPE) { ptype = build_pointer_type (type); diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 7489665..cd2b7d7 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -2809,8 +2809,6 @@ static void write_template_param (const tree parm) { int parm_index; - int parm_level; - tree parm_type = NULL_TREE; MANGLE_TRACE_TREE ("template-parm", parm); @@ -2820,13 +2818,10 @@ write_template_param (const tree parm) case TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM: parm_index = TEMPLATE_TYPE_IDX (parm); - parm_level = TEMPLATE_TYPE_LEVEL (parm); break; case TEMPLATE_PARM_INDEX: parm_index = TEMPLATE_PARM_IDX (parm); - parm_level = TEMPLATE_PARM_LEVEL (parm); - parm_type = TREE_TYPE (TEMPLATE_PARM_DECL (parm)); break; default: diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f50d1c0..b74f4f2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10649,14 +10649,13 @@ cp_parser_type_parameter (cp_parser* parser, bool *is_parameter_pack) case RID_TEMPLATE: { - tree parameter_list; tree identifier; tree default_argument; /* Look for the `<'. */ cp_parser_require (parser, CPP_LESS, "%<<%>"); /* Parse the template-parameter-list. */ - parameter_list = cp_parser_template_parameter_list (parser); + cp_parser_template_parameter_list (parser); /* Look for the `>'. */ cp_parser_require (parser, CPP_GREATER, "%<>%>"); /* Look for the `class' keyword. */ @@ -10790,7 +10789,7 @@ cp_parser_template_id (cp_parser *parser, cp_token_position start_of_id = 0; deferred_access_check *chk; VEC (deferred_access_check,gc) *access_check; - cp_token *next_token = NULL, *next_token_2 = NULL, *token = NULL; + cp_token *next_token = NULL, *next_token_2 = NULL; bool is_identifier; /* If the next token corresponds to a template-id, there is no need @@ -10838,7 +10837,6 @@ cp_parser_template_id (cp_parser *parser, /* Parse the template-name. */ is_identifier = false; - token = cp_lexer_peek_token (parser->lexer); templ = cp_parser_template_name (parser, template_keyword_p, check_dependency_p, is_declaration, @@ -11515,7 +11513,6 @@ cp_parser_explicit_instantiation (cp_parser* parser) int declares_class_or_enum; cp_decl_specifier_seq decl_specifiers; tree extension_specifier = NULL_TREE; - cp_token *token; /* Look for an (optional) storage-class-specifier or function-specifier. */ @@ -11538,7 +11535,6 @@ cp_parser_explicit_instantiation (cp_parser* parser) control while processing explicit instantiation directives. */ push_deferring_access_checks (dk_no_check); /* Parse a decl-specifier-seq. */ - token = cp_lexer_peek_token (parser->lexer); cp_parser_decl_specifier_seq (parser, CP_PARSER_FLAGS_OPTIONAL, &decl_specifiers, @@ -11995,8 +11991,6 @@ cp_parser_simple_type_specifier (cp_parser* parser, /* If the type-specifier was for a built-in type, we're done. */ if (type) { - tree id; - /* Record the type. */ if (decl_specs && (token->keyword != RID_SIGNED @@ -12011,7 +12005,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, decl_specs->any_specifiers_p = true; /* Consume the token. */ - id = cp_lexer_consume_token (parser->lexer)->u.value; + cp_lexer_consume_token (parser->lexer); /* There is no valid C++ program where a non-template type is followed by a "<". That usually indicates that the user thought @@ -13799,7 +13793,6 @@ cp_parser_declarator (cp_parser* parser, bool* parenthesized_p, bool member_p) { - cp_token *token; cp_declarator *declarator; enum tree_code code; cp_cv_quals cv_quals; @@ -13814,9 +13807,6 @@ cp_parser_declarator (cp_parser* parser, if (cp_parser_allow_gnu_extensions_p (parser)) attributes = cp_parser_attributes_opt (parser); - /* Peek at the next token. */ - token = cp_lexer_peek_token (parser->lexer); - /* Check for the ptr-operator production. */ cp_parser_parse_tentatively (parser); /* Parse the ptr-operator. */ @@ -15011,7 +15001,6 @@ cp_parser_parameter_declaration (cp_parser *parser, bool *parenthesized_p) { int declares_class_or_enum; - bool greater_than_is_operator_p; cp_decl_specifier_seq decl_specifiers; cp_declarator *declarator; tree default_argument; @@ -15026,7 +15015,6 @@ cp_parser_parameter_declaration (cp_parser *parser, template-parameter, the first non-nested `>' is taken as the end of the template parameter-list rather than a greater-than operator. */ - greater_than_is_operator_p = !template_parm_p; /* Type definitions may not appear in parameter types. */ saved_message = parser->type_definition_forbidden_message; @@ -18216,10 +18204,8 @@ cp_parser_check_declarator_template_parameters (cp_parser* parser, if (declarator->u.id.qualifying_scope) { tree scope; - tree member; scope = declarator->u.id.qualifying_scope; - member = declarator->u.id.unqualified_name; while (scope && CLASS_TYPE_P (scope)) { @@ -23118,7 +23104,6 @@ pragma_lex (tree *value) void c_parse_file (void) { - bool error_occurred; static bool already_called = false; if (already_called) @@ -23131,7 +23116,7 @@ c_parse_file (void) the_parser = cp_parser_new (); push_deferring_access_checks (flag_access_control ? dk_no_deferred : dk_no_check); - error_occurred = cp_parser_translation_unit (the_parser); + cp_parser_translation_unit (the_parser); the_parser = NULL; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 9fd06b3..b843400 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8007,7 +8007,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, { tree pattern; tree pack, packs = NULL_TREE, unsubstituted_packs = NULL_TREE; - tree first_arg_pack; int i, len = -1; + int i, len = -1; tree result; int incomplete = 0; bool very_local_specializations = false; @@ -8091,10 +8091,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, incomplete = 1; if (len < 0) - { - len = my_len; - first_arg_pack = arg_pack; - } + len = my_len; else if (len != my_len) { if (incomplete) diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 307825f..2530695 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3021,7 +3021,6 @@ cp_build_function_call_vec (tree function, VEC(tree,gc) **params, tsubst_flags_t complain) { tree fntype, fndecl; - tree name = NULL_TREE; int is_method; tree original = function; int nargs; @@ -3044,8 +3043,6 @@ cp_build_function_call_vec (tree function, VEC(tree,gc) **params, if (TREE_CODE (function) == FUNCTION_DECL) { - name = DECL_NAME (function); - mark_used (function); fndecl = function; diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index a296caa..07c2ffc 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -655,13 +655,9 @@ check_narrowing (tree type, tree init) tree ftype = unlowered_expr_type (init); bool ok = true; REAL_VALUE_TYPE d; - bool was_decl = false; if (DECL_P (init)) - { - was_decl = true; - init = decl_constant_value (init); - } + init = decl_constant_value (init); if (TREE_CODE (type) == INTEGER_TYPE && TREE_CODE (ftype) == REAL_TYPE) |