cris: Check UNDEFWEAK_NO_DYNAMIC_RELOC
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index f7f098ba525aea86947db5a7254709a951ac4038..7c050b4ce7eb172222f6f8e8addb3db897c46de7 100644 (file)
@@ -558,6 +558,11 @@ function_method:       exp '(' parameter_typelist ')' const_or_volatile
                          LONGEST len = VEC_length (type_ptr, type_list);
 
                          write_exp_elt_opcode (pstate, TYPE_INSTANCE);
+                         /* Save the const/volatile qualifiers as
+                            recorded by the const_or_volatile
+                            production's actions.  */
+                         write_exp_elt_longcst (pstate,
+                                                follow_type_instance_flags ());
                          write_exp_elt_longcst (pstate, len);
                          for (i = 0;
                               VEC_iterate (type_ptr, type_list, i, type_elt);
@@ -571,6 +576,9 @@ function_method:       exp '(' parameter_typelist ')' const_or_volatile
 
 function_method_void:      exp '(' ')' const_or_volatile
                       { write_exp_elt_opcode (pstate, TYPE_INSTANCE);
+                        /* See above.  */
+                        write_exp_elt_longcst (pstate,
+                                               follow_type_instance_flags ());
                         write_exp_elt_longcst (pstate, 0);
                         write_exp_elt_longcst (pstate, 0);
                         write_exp_elt_opcode (pstate, TYPE_INSTANCE);
@@ -1783,37 +1791,31 @@ parse_number (struct parser_state *par_state,
 
       if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'f')
        {
-         p[len - 2] = '\0';
          putithere->typed_val_decfloat.type
            = parse_type (par_state)->builtin_decfloat;
          decimal_from_string (putithere->typed_val_decfloat.val, 4,
                               gdbarch_byte_order (parse_gdbarch (par_state)),
-                              p);
-         p[len - 2] = 'd';
+                              std::string (p, len - 2));
          return DECFLOAT;
        }
 
       if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'd')
        {
-         p[len - 2] = '\0';
          putithere->typed_val_decfloat.type
            = parse_type (par_state)->builtin_decdouble;
          decimal_from_string (putithere->typed_val_decfloat.val, 8,
                               gdbarch_byte_order (parse_gdbarch (par_state)),
-                              p);
-         p[len - 2] = 'd';
+                              std::string (p, len - 2));
          return DECFLOAT;
        }
 
       if (len >= 2 && p[len - 2] == 'd' && p[len - 1] == 'l')
        {
-         p[len - 2] = '\0';
          putithere->typed_val_decfloat.type
            = parse_type (par_state)->builtin_declong;
          decimal_from_string (putithere->typed_val_decfloat.val, 16,
                               gdbarch_byte_order (parse_gdbarch (par_state)),
-                              p);
-         p[len - 2] = 'd';
+                              std::string (p, len - 2));
          return DECFLOAT;
        }
 
@@ -3224,6 +3226,7 @@ c_parse (struct parser_state *par_state)
   struct cleanup *back_to;
 
   /* Setting up the parser state.  */
+  scoped_restore pstate_restore = make_scoped_restore (&pstate);
   gdb_assert (par_state != NULL);
   pstate = par_state;
 
@@ -3231,7 +3234,6 @@ c_parse (struct parser_state *par_state)
      assuming they'll be run here (below).  */
 
   back_to = make_cleanup (free_current_contents, &expression_macro_scope);
-  make_cleanup_clear_parser_state (&pstate);
 
   /* Set up the scope for macro expansion.  */
   expression_macro_scope = NULL;
This page took 0.025156 seconds and 4 git commands to generate.