Fix TYPE_DECLARED_CLASS thinko
[deliverable/binutils-gdb.git] / gdb / compile / compile-cplus-types.c
index f92091a82529987c9e039e57549f729a4cc8fdd4..ef5fbcf133a107c5b9c83c7080f98fe0e50f94fc 100644 (file)
@@ -1,6 +1,6 @@
 /* Convert types from GDB to GCC
 
-   Copyright (C) 2014-2020 Free Software Foundation, Inc.
+   Copyright (C) 2014-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -383,7 +383,7 @@ compile_cplus_instance::new_scope (const char *type_name, struct type *type)
        {
          scope_component comp
            = {
-               decl_name (type->name ()).get (),
+               decl_name (type->name ()).get (),
                lookup_symbol (type->name (), block (), VAR_DOMAIN, nullptr)
              };
          scope.push_back (comp);
@@ -491,7 +491,7 @@ compile_cplus_convert_array (compile_cplus_instance *instance,
     {
       LONGEST low_bound, high_bound, count;
 
-      if (get_array_bounds (type, &low_bound, &high_bound) == 0)
+      if (!get_array_bounds (type, &low_bound, &high_bound))
        count = -1;
       else
        {
@@ -828,7 +828,7 @@ compile_cplus_convert_struct_or_union (compile_cplus_instance *instance,
   gcc_decl resuld;
   if (type->code () == TYPE_CODE_STRUCT)
     {
-      const char *what = TYPE_DECLARED_CLASS (type) ? "struct" : "class";
+      const char *what = TYPE_DECLARED_CLASS (type) ? "class" : "struct";
 
       resuld = instance->plugin ().build_decl
        (what, name.get (), (GCC_CP_SYMBOL_CLASS | nested_access
@@ -970,10 +970,10 @@ compile_cplus_convert_func (compile_cplus_instance *instance,
      GDB's parser used to do.  */
   if (target_type == nullptr)
     {
-      if (TYPE_OBJFILE_OWNED (type))
-       target_type = objfile_type (TYPE_OWNER (type).objfile)->builtin_int;
+      if (type->is_objfile_owned ())
+       target_type = objfile_type (type->objfile_owner ())->builtin_int;
       else
-       target_type = builtin_type (TYPE_OWNER (type).gdbarch)->builtin_int;
+       target_type = builtin_type (type->arch_owner ())->builtin_int;
       warning (_("function has unknown return type; assuming int"));
     }
 
This page took 0.023651 seconds and 4 git commands to generate.