* gdbtypes.h (make_function_type): Remove OBJFILE parameter.
authorUlrich Weigand <uweigand@de.ibm.com>
Mon, 29 Jun 2009 13:19:19 +0000 (13:19 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Mon, 29 Jun 2009 13:19:19 +0000 (13:19 +0000)
* gdbtypes.c (make_function_type): Remove OBJFILE parameter.
(lookup_function_type): Update call.
* stabsread.c (read_type): Likewise.
* dwarf2read.c (read_subroutine_type): Use lookup_function_type
instead of make_function_type.
* jv-lang.c (type_from_class): Likewise.  Do not allocate types
on the fake "dynamics" obstack.

gdb/ChangeLog
gdb/dwarf2read.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/jv-lang.c
gdb/stabsread.c

index 4d0b20186f51d0fa0f297c8af4b84f5fbde0ad72..ed12e87742945ee28262fa00bfe64a7886e77361 100644 (file)
@@ -1,3 +1,14 @@
+2009-06-29  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * gdbtypes.h (make_function_type): Remove OBJFILE parameter.
+       * gdbtypes.c (make_function_type): Remove OBJFILE parameter.
+       (lookup_function_type): Update call.
+       * stabsread.c (read_type): Likewise.
+       * dwarf2read.c (read_subroutine_type): Use lookup_function_type
+       instead of make_function_type.
+       * jv-lang.c (type_from_class): Likewise.  Do not allocate types
+       on the fake "dynamics" obstack.
+
 2009-06-29  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
index 4b52b6a805759ef2983ed68bda36ee3997369084..cd928437a648b95f5f4fd42b88497eb6808c49f8 100644 (file)
@@ -5297,7 +5297,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
   struct attribute *attr;
 
   type = die_type (die, cu);
-  ftype = make_function_type (type, (struct type **) 0, cu->objfile);
+  ftype = lookup_function_type (type);
 
   /* All functions in C++, Pascal and Java have prototypes.  */
   attr = dwarf2_attr (die, DW_AT_prototyped, cu);
index 07e92cb49c7ebab30c7f15c1815991881ca61bbe..3d5ad3b09975d706e9b53b0e5c7f036eafb7f2f0 100644 (file)
@@ -378,24 +378,24 @@ lookup_reference_type (struct type *type)
 /* Lookup a function type that returns type TYPE.  TYPEPTR, if
    nonzero, points to a pointer to memory where the function type
    should be stored.  If *TYPEPTR is zero, update it to point to the
-   function type we return.  We allocate new memory from OBJFILE if needed; use
-   NULL for permanent types.  */
+   function type we return.  We allocate new memory if needed.  */
 
 struct type *
-make_function_type (struct type *type, struct type **typeptr,
-                   struct objfile *objfile)
+make_function_type (struct type *type, struct type **typeptr)
 {
   struct type *ntype;  /* New type */
+  struct objfile *objfile;
 
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
     {
-      ntype = alloc_type (objfile);
+      ntype = alloc_type (TYPE_OBJFILE (type));
       if (typeptr)
        *typeptr = ntype;
     }
   else                 /* We have storage, but need to reset it.  */
     {
       ntype = *typeptr;
+      objfile = TYPE_OBJFILE (ntype);
       smash_type (ntype);
       TYPE_OBJFILE (ntype) = objfile;
     }
@@ -415,7 +415,7 @@ make_function_type (struct type *type, struct type **typeptr,
 struct type *
 lookup_function_type (struct type *type)
 {
-  return make_function_type (type, (struct type **) 0, TYPE_OBJFILE (type));
+  return make_function_type (type, (struct type **) 0);
 }
 
 /* Identify address space identifier by name --
index 7ef8ca2ab84fd92f7cb5562c4c78a5a28f30b0ab..97f018e2ec0571d5e229356d00fe47c014460a01 100644 (file)
@@ -1186,8 +1186,7 @@ extern struct type *make_pointer_type (struct type *, struct type **);
 
 extern struct type *lookup_pointer_type (struct type *);
 
-extern struct type *make_function_type (struct type *, struct type **,
-                                       struct objfile *);
+extern struct type *make_function_type (struct type *, struct type **);
 
 extern struct type *lookup_function_type (struct type *);
 
index 0003e0d399bf84d42881be5493fa5606317e1edd..f53c656f68373246085232c902727b8dd0e25d7a 100644 (file)
@@ -302,7 +302,10 @@ type_from_class (struct value *clas)
   if (type != NULL)
     return type;
 
-  type = alloc_type (objfile);
+  /* Do not use the "fake" dynamics objfile to own dynamically generated
+     types, as it does not provide an architecture, and it would not help
+     manage the lifetime of these types anyway.  */
+  type = alloc_type (NULL);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (type);
 
@@ -560,7 +563,7 @@ java_link_class_type (struct type *type, struct value *clas)
       fn_fields[k].physname = "";
       fn_fields[k].is_stub = 1;
       /* FIXME */
-      fn_fields[k].type = make_function_type (java_void_type, NULL, objfile);
+      fn_fields[k].type = lookup_function_type (java_void_type);
       TYPE_CODE (fn_fields[k].type) = TYPE_CODE_METHOD;
     }
 
index 624a4c0f30b6d73544d3cca58221b304ff08e651..e62bb15ad3bb691ffe407ee29738a7d2546a08e1 100644 (file)
@@ -1682,8 +1682,7 @@ again:
 
     case 'f':                  /* Function returning another type */
       type1 = read_type (pp, objfile);
-      type = make_function_type (type1, dbx_lookup_type (typenums, objfile),
-                                objfile);
+      type = make_function_type (type1, dbx_lookup_type (typenums, objfile));
       break;
 
     case 'g':                   /* Prototyped function.  (Sun)  */
@@ -1707,7 +1706,7 @@ again:
         struct type *return_type = read_type (pp, objfile);
         struct type *func_type
           = make_function_type (return_type,
-                               dbx_lookup_type (typenums, objfile), objfile);
+                               dbx_lookup_type (typenums, objfile));
         struct type_list {
           struct type *type;
           struct type_list *next;
This page took 0.040342 seconds and 4 git commands to generate.