Make dwarf2_per_objfile::all_comp_units an std::vector
[deliverable/binutils-gdb.git] / gdb / dwarf2loc.c
index cfbea3c9da2ea97f4130db3cc79a5a128d497181..6c84e4ad7e84897873db7707e98ef49b39b15a36 100644 (file)
@@ -1,6 +1,6 @@
 /* DWARF 2 location expression support for GDB.
 
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2018 Free Software Foundation, Inc.
 
    Contributed by Daniel Jacobowitz, MontaVista Software, Inc.
 
@@ -1376,7 +1376,7 @@ entry_data_value_free_closure (struct value *v)
 {
   struct value *target_val = (struct value *) value_computed_closure (v);
 
-  value_free (target_val);
+  value_decref (target_val);
 }
 
 /* Vector for methods for an entry value reference where the referenced value
@@ -1434,7 +1434,7 @@ value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
                                               target_type, caller_frame,
                                               caller_per_cu);
 
-  release_value (target_val);
+  release_value (target_val).release ();
   val = allocate_computed_value (type, &entry_data_value_funcs,
                                 target_val /* closure */);
 
@@ -1501,7 +1501,6 @@ allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
                        struct frame_info *frame)
 {
   struct piece_closure *c = new piece_closure;
-  int i;
 
   c->refc = 1;
   c->per_cu = per_cu;
@@ -2179,7 +2178,6 @@ indirect_pieced_value (struct value *value)
     = (struct piece_closure *) value_computed_closure (value);
   struct type *type;
   struct frame_info *frame;
-  struct dwarf2_locexpr_baton baton;
   int i, bit_length;
   LONGEST bit_offset;
   struct dwarf_expr_piece *piece = NULL;
@@ -2301,7 +2299,7 @@ free_pieced_value_closure (struct value *v)
     {
       for (dwarf_expr_piece &p : c->pieces)
        if (p.location == DWARF_VALUE_STACK)
-         value_free (p.v.value);
+         value_decref (p.v.value);
 
       delete c;
     }
@@ -2387,7 +2385,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
     {
       struct piece_closure *c;
       ULONGEST bit_size = 0;
-      int i;
 
       for (dwarf_expr_piece &piece : ctx.pieces)
        bit_size += piece.size;
@@ -2441,7 +2438,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
          {
            struct type *ptr_type;
            CORE_ADDR address = ctx.fetch_address (0);
-           int in_stack_memory = ctx.fetch_in_stack_memory (0);
+           bool in_stack_memory = ctx.fetch_in_stack_memory (0);
 
            /* DW_OP_deref_size (and possibly other operations too) may
               create a pointer instead of an address.  Ideally, the
@@ -2478,7 +2475,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
            size_t len = TYPE_LENGTH (subobj_type);
            size_t max = TYPE_LENGTH (type);
            struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
-           struct cleanup *cleanup;
 
            if (subobj_byte_offset + len > max)
              invalid_synthetic_pointer ();
@@ -2486,9 +2482,8 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
            /* Preserve VALUE because we are going to free values back
               to the mark, but we still need the value contents
               below.  */
-           value_incref (value);
+           value_ref_ptr value_holder (value_incref (value));
            free_values.free_to_mark ();
-           cleanup = make_cleanup_value_free (value);
 
            retval = allocate_value (subobj_type);
 
@@ -2498,8 +2493,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
 
            memcpy (value_contents_raw (retval),
                    value_contents_all (value) + subobj_byte_offset, len);
-
-           do_cleanups (cleanup);
          }
          break;
 
@@ -4671,6 +4664,6 @@ _initialize_dwarf2loc (void)
                             &setdebuglist, &showdebuglist);
 
 #if GDB_SELF_TEST
-  selftests::register_test (selftests::copy_bitwise_tests);
+  selftests::register_test ("copy_bitwise", selftests::copy_bitwise_tests);
 #endif
 }
This page took 0.025393 seconds and 4 git commands to generate.