* gdbtypes.c (lookup_typename): Simplify.
authorDoug Evans <dje@google.com>
Wed, 23 May 2012 23:45:09 +0000 (23:45 +0000)
committerDoug Evans <dje@google.com>
Wed, 23 May 2012 23:45:09 +0000 (23:45 +0000)
gdb/ChangeLog
gdb/gdbtypes.c

index ac52d5d25437dcccaf8805d6296df8e174e1ff81..b9a82c3e3d2dc9fffabbf9774cc4a2beea812a90 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-23  Doug Evans  <dje@google.com>
+
+       * gdbtypes.c (lookup_typename): Simplify.
+
 2012-05-23  Pedro Alves  <palves@redhat.com>
 
        * arch-utils.h (default_target_signal_to_host): Delete.
index 60b08398b999b904f577222536c89a4436e16a25..e3db1ed5c5d3317ccc88a6e3527ff5db14a6910b 100644 (file)
@@ -1143,23 +1143,16 @@ lookup_typename (const struct language_defn *language,
   struct type *tmp;
 
   sym = lookup_symbol (name, block, VAR_DOMAIN, 0);
-  if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
-    {
-      tmp = language_lookup_primitive_type_by_name (language, gdbarch, name);
-      if (tmp)
-       {
-         return tmp;
-       }
-      else if (!tmp && noerr)
-       {
-         return NULL;
-       }
-      else
-       {
-         error (_("No type named %s."), name);
-       }
-    }
-  return (SYMBOL_TYPE (sym));
+  if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+    return SYMBOL_TYPE (sym);
+
+  tmp = language_lookup_primitive_type_by_name (language, gdbarch, name);
+  if (tmp)
+    return tmp;
+
+  if (noerr)
+    return NULL;
+  error (_("No type named %s."), name);
 }
 
 struct type *