]> gcc.gnu.org Git - gcc.git/commitdiff
g++spec.c (lang_specific_driver): Remove unused saw_verbose_flag variable.
authorJakub Jelinek <jakub@redhat.com>
Wed, 2 Dec 2009 08:39:10 +0000 (09:39 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 2 Dec 2009 08:39:10 +0000 (09:39 +0100)
* 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.

From-SVN: r154899

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-gimplify.c
gcc/cp/decl.c
gcc/cp/g++spec.c
gcc/cp/init.c
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/typeck.c
gcc/cp/typeck2.c

index 3a086021776830a9f2cf1da6433afda452eb4c8b..7b2afd3a92d0201e45e9d5f5a5bb203268e5df2f 100644 (file)
@@ -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
index 38eb73f400445cb3e0bffa81083c8b5b3bdd271f..1dcc2383794e871be2d55e730fb13ad932325adf 100644 (file)
@@ -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
index 017c8a98e454372fd8bfe79097bbc5fe61639425..e0047cf116908a222c6af16ee9d93802282bcacc 100644 (file)
@@ -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.  */
index 95ec8d22296f30382a86c066dff59df5a65aa22d..8f6d33ceee7d0bab20986d35d545f5af3b204fde 100644 (file)
@@ -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)
index 7ad268fabf98fc2f65994b10e0cfc8785b7e189c..28530880eb682f06b6ed6d598d4cacde13841cf7 100644 (file)
@@ -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;
index db2920450ebc168fafb2bddf2b9b8fa31c6224e7..e6397446b0239ba9f21498054c9dcdaef85374c7 100644 (file)
@@ -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);
index 7489665bfa8d0aab059b7b474ac1cc112f2bc3b8..cd2b7d7dc1ff9200d3b04b3852a347330eae3675 100644 (file)
@@ -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:
index f50d1c0bb8dcb79e71207804295b6bd2fbcc57dd..b74f4f23c673d32edd3e6c6a5ed4b03725a572d8 100644 (file)
@@ -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;
 }
 
index 9fd06b3433fed4a9247ced36a4fe7d21fd5f86ec..b843400bf384b3fcc08182b5df4d48460ea1ed03 100644 (file)
@@ -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)
index 307825f65160126da0b91aac657fe453682a9121..25306952f982890628ebf51a9aaf3fcd77bc7301 100644 (file)
@@ -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;
 
index a296caae26e4a48cbe7a91780c8e8af0ec16443b..07c2ffca4751d992c0cb512869024a458d7a4464 100644 (file)
@@ -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)
This page took 0.125992 seconds and 5 git commands to generate.