aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2012-05-23 23:45:09 +0000
committerDoug Evans <dje@google.com>2012-05-23 23:45:09 +0000
commitc51fe63159bd32dbdfa604f3b479c026236849f0 (patch)
treefd76ee866c8de5c953abee0917a112ac87928288 /gdb
parent9b689de01538993d04f35e9d147aacd7ded04ba0 (diff)
downloadgdb-c51fe63159bd32dbdfa604f3b479c026236849f0.zip
gdb-c51fe63159bd32dbdfa604f3b479c026236849f0.tar.gz
gdb-c51fe63159bd32dbdfa604f3b479c026236849f0.tar.bz2
* gdbtypes.c (lookup_typename): Simplify.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/gdbtypes.c27
2 files changed, 14 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ac52d5d..b9a82c3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 60b0839..e3db1ed 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -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 *