gdb: remove TYPE_VECTOR
[deliverable/binutils-gdb.git] / gdb / valops.c
index cfa0f5415d2e6c6f4c8d998bbda74c42d9c734d0..da2881a3469234b505857bc7c349ba02a318fbb0 100644 (file)
@@ -388,8 +388,7 @@ value_cast (struct type *type, struct value *arg2)
       struct type *element_type = TYPE_TARGET_TYPE (type);
       unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
 
-      if (element_length > 0
-         && type->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED)
+      if (element_length > 0 && type->bounds ()->high.kind () == PROP_UNDEFINED)
        {
          struct type *range_type = type->index_type ();
          int val_length = TYPE_LENGTH (type2);
@@ -417,7 +416,7 @@ value_cast (struct type *type, struct value *arg2)
 
   if (current_language->c_style_arrays
       && type2->code () == TYPE_CODE_ARRAY
-      && !TYPE_VECTOR (type2))
+      && !type2->is_vector ())
     arg2 = value_coerce_array (arg2);
 
   if (type2->code () == TYPE_CODE_FUNC)
@@ -463,7 +462,7 @@ value_cast (struct type *type, struct value *arg2)
        }
 
       /* The only option left is an integral type.  */
-      if (TYPE_UNSIGNED (type2))
+      if (type2->is_unsigned ())
        return value_from_ulongest (to_type, value_as_long (arg2));
       else
        return value_from_longest (to_type, value_as_long (arg2));
@@ -530,11 +529,11 @@ value_cast (struct type *type, struct value *arg2)
         minus one, instead of biasing the normal case.  */
       return value_from_longest (to_type, -1);
     }
-  else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
-          && code2 == TYPE_CODE_ARRAY && TYPE_VECTOR (type2)
+  else if (code1 == TYPE_CODE_ARRAY && type->is_vector ()
+          && code2 == TYPE_CODE_ARRAY && type2->is_vector ()
           && TYPE_LENGTH (type) != TYPE_LENGTH (type2))
     error (_("Cannot convert between vector values of different sizes"));
-  else if (code1 == TYPE_CODE_ARRAY && TYPE_VECTOR (type) && scalar
+  else if (code1 == TYPE_CODE_ARRAY && type->is_vector () && scalar
           && TYPE_LENGTH (type) != TYPE_LENGTH (type2))
     error (_("can only cast scalar to vector of same size"));
   else if (code1 == TYPE_CODE_VOID)
@@ -855,7 +854,7 @@ value_one (struct type *type)
     {
       val = value_from_longest (type, (LONGEST) 1);
     }
-  else if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1))
+  else if (type1->code () == TYPE_CODE_ARRAY && type1->is_vector ())
     {
       struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type1));
       int i;
@@ -1231,7 +1230,7 @@ value_assign (struct value *toval, struct value *fromval)
       LONGEST valmask = (((ULONGEST) 1) << value_bitsize (toval)) - 1;
 
       fieldval &= valmask;
-      if (!TYPE_UNSIGNED (type
+      if (!type->is_unsigned (
          && (fieldval & (valmask ^ (valmask >> 1))))
        fieldval |= ~valmask;
 
@@ -1362,7 +1361,7 @@ value_must_coerce_to_target (struct value *val)
   switch (valtype->code ())
     {
     case TYPE_CODE_ARRAY:
-      return TYPE_VECTOR (valtype) ? 0 : 1;
+      return valtype->is_vector () ? 0 : 1;
     case TYPE_CODE_STRING:
       return true;
     default:
@@ -1560,20 +1559,24 @@ value_ind (struct value *arg1)
       enc_type = check_typedef (value_enclosing_type (arg1));
       enc_type = TYPE_TARGET_TYPE (enc_type);
 
+      CORE_ADDR base_addr;
       if (check_typedef (enc_type)->code () == TYPE_CODE_FUNC
          || check_typedef (enc_type)->code () == TYPE_CODE_METHOD)
-       /* For functions, go through find_function_addr, which knows
-          how to handle function descriptors.  */
-       arg2 = value_at_lazy (enc_type, 
-                             find_function_addr (arg1, NULL));
+       {
+         /* For functions, go through find_function_addr, which knows
+            how to handle function descriptors.  */
+         base_addr = find_function_addr (arg1, NULL);
+       }
       else
-       /* Retrieve the enclosing object pointed to.  */
-       arg2 = value_at_lazy (enc_type, 
-                             (value_as_address (arg1)
-                              - value_pointed_to_offset (arg1)));
-
+       {
+         /* Retrieve the enclosing object pointed to.  */
+         base_addr = (value_as_address (arg1)
+                      - value_pointed_to_offset (arg1));
+       }
+      arg2 = value_at_lazy (enc_type, base_addr);
       enc_type = value_type (arg2);
-      return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
+      return readjust_indirect_value_type (arg2, enc_type, base_type,
+                                          arg1, base_addr);
     }
 
   error (_("Attempt to take contents of a non-pointer value."));
@@ -2007,7 +2010,7 @@ search_struct_method (const char *name, struct value **arg1p,
            while (j >= 0)
              {
                if (!typecmp (TYPE_FN_FIELD_STATIC_P (f, j),
-                             TYPE_VARARGS (TYPE_FN_FIELD_TYPE (f, j)),
+                             TYPE_FN_FIELD_TYPE (f, j)->has_varargs (),
                              TYPE_FN_FIELD_TYPE (f, j)->num_fields (),
                              TYPE_FN_FIELD_ARGS (f, j), args))
                  {
This page took 0.031632 seconds and 4 git commands to generate.