From: Doug Evans <xdje42@gmail.com>
To: gdb-patches@sourceware.org
Subject: [COMMITTED PATCH] Rename language_lookup_primitive_type_by_name
Date: Thu, 18 Dec 2014 09:16:00 -0000 [thread overview]
Message-ID: <m34mstcoa1.fsf@sspiff.org> (raw)
Hi.
This patch is just a preparatory patch to this one:
https://sourceware.org/ml/gdb-patches/2014-12/msg00169.html
[look up primitive types as symbols]
The name of this function is a bit long, and there are no other
related language lookup functions that make the "by_name" suffix useful.
Plus, I'd like to add a new function
language_lookup_primitive_type_as_symbol,
and language_lookup_primitive_type_by_name_as_symbol
is excessively long.
2014-12-18 Doug Evans <xdje42@gmail.com>
* language.c (language_lookup_primitive_type): Renamed from
language_lookup_primitive_type_by_name. All callers updated.
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 0a49952..c02f6a1 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1086,9 +1086,9 @@ static struct type*
find_primitive_type (struct parser_state *par_state, char *name)
{
struct type *type;
- type = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- name);
+ type = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ name);
if (type == NULL && strcmp ("system__address", name) == 0)
type = type_system_address (par_state);
@@ -1525,9 +1525,9 @@ static struct type *
type_system_address (struct parser_state *par_state)
{
struct type *type
- = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- "system__address");
+ = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ "system__address");
return type != NULL ? type : parse_type (par_state)->builtin_data_ptr;
}
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 9d1c4c7..707e504 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -2942,9 +2942,9 @@ classify_name (struct parser_state *par_state, const struct block *block,
}
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- copy);
+ = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ copy);
if (yylval.tsym.type != NULL)
return TYPENAME;
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index 5e4c10d..00d3a26 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -1577,8 +1577,8 @@ yylex (void)
return DOLLAR_VARIABLE;
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (pstate),
- parse_gdbarch (pstate), copy);
+ = language_lookup_primitive_type (parse_language (pstate),
+ parse_gdbarch (pstate), copy);
if (yylval.tsym.type != NULL)
return TYPENAME;
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index f229afa..ab3801a 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1230,8 +1230,8 @@ yylex (void)
}
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (pstate),
- parse_gdbarch (pstate), tmp);
+ = language_lookup_primitive_type (parse_language (pstate),
+ parse_gdbarch (pstate), tmp);
if (yylval.tsym.type != NULL)
return TYPENAME;
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index c5a390a..0048f6a 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1310,7 +1310,7 @@ lookup_typename (const struct language_defn *language,
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
return SYMBOL_TYPE (sym);
- type = language_lookup_primitive_type_by_name (language, gdbarch, name);
+ type = language_lookup_primitive_type (language, gdbarch, name);
if (type)
return type;
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index f9ffbf9..5178178 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -1455,9 +1455,9 @@ classify_name (struct parser_state *par_state, const struct block *block)
copy = copy_name (yylval.sval);
/* Try primitive types first so they win over bad/weird debug info. */
- type = language_lookup_primitive_type_by_name (parse_language (par_state),
- parse_gdbarch (par_state),
- copy);
+ type = language_lookup_primitive_type (parse_language (par_state),
+ parse_gdbarch (par_state),
+ copy);
if (type != NULL)
{
/* NOTE: We take advantage of the fact that yylval coming in was a
diff --git a/gdb/language.c b/gdb/language.c
index 8d476d3..df45ddd 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -988,9 +988,9 @@ language_bool_type (const struct language_defn *la,
}
struct type *
-language_lookup_primitive_type_by_name (const struct language_defn *la,
- struct gdbarch *gdbarch,
- const char *name)
+language_lookup_primitive_type (const struct language_defn *la,
+ struct gdbarch *gdbarch,
+ const char *name)
{
struct language_gdbarch *ld = gdbarch_data (gdbarch,
language_gdbarch_data);
@@ -999,8 +999,7 @@ language_lookup_primitive_type_by_name (const struct language_defn *la,
if (symbol_lookup_debug)
{
fprintf_unfiltered (gdb_stdlog,
- "language_lookup_primitive_type_by_name"
- " (%s, %s, %s)",
+ "language_lookup_primitive_type (%s, %s, %s)",
la->la_name, host_address_to_string (gdbarch), name);
}
diff --git a/gdb/language.h b/gdb/language.h
index 9ed7e22..aa07d8d 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -435,9 +435,9 @@ struct type *language_bool_type (const struct language_defn *l,
struct type *language_string_char_type (const struct language_defn *l,
struct gdbarch *gdbarch);
-struct type *language_lookup_primitive_type_by_name (const struct language_defn *l,
- struct gdbarch *gdbarch,
- const char *name);
+struct type *language_lookup_primitive_type (const struct language_defn *l,
+ struct gdbarch *gdbarch,
+ const char *name);
\f
/* These macros define the behaviour of the expression
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 1c966cc..675514c 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1710,8 +1710,8 @@ yylex (void)
return TYPENAME;
}
yylval.tsym.type
- = language_lookup_primitive_type_by_name (parse_language (pstate),
- parse_gdbarch (pstate), tmp);
+ = language_lookup_primitive_type (parse_language (pstate),
+ parse_gdbarch (pstate), tmp);
if (yylval.tsym.type != NULL)
{
free (uptokstart);
reply other threads:[~2014-12-18 9:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m34mstcoa1.fsf@sspiff.org \
--to=xdje42@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).