public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/fortran: Remove some dead code from the parser
@ 2019-08-22 11:36 Andrew Burgess
0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2019-08-22 11:36 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=43771869e5021b6bdc02b6eaae103a33c05a821c
commit 43771869e5021b6bdc02b6eaae103a33c05a821c
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date: Thu Aug 22 10:07:00 2019 +0100
gdb/fortran: Remove some dead code from the parser
The Fortran parser contains some code that looks like it was probably
inherited from the C/C++ parser as it checks to see if the current
language is C++, which should never be true when we're in the Fortran
parser.
gdb/ChangeLog:
* f-exp.y (yylex): Remove is_a_field_of_this local variable, and
all uses as this was never set to anything but a zero value.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/f-exp.y | 14 +++-----------
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 966bfb7..b6d200d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-22 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * f-exp.y (yylex): Remove is_a_field_of_this local variable, and
+ all uses as this was never set to anything but a zero value.
+
2019-08-21 Bogdan Harjoc <harjoc@gmail.com>
* cli/cli-cmds.c (with_command_1): Error out if no arguments.
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 14ea386..9784ad5 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -1275,7 +1275,6 @@ yylex (void)
{
std::string tmp = copy_name (yylval.sval);
struct block_symbol result;
- struct field_of_this_result is_a_field_of_this;
enum domain_enum_tag lookup_domains[] =
{
STRUCT_DOMAIN,
@@ -1286,15 +1285,8 @@ yylex (void)
for (int i = 0; i < ARRAY_SIZE (lookup_domains); ++i)
{
- /* Initialize this in case we *don't* use it in this call; that
- way we can refer to it unconditionally below. */
- memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this));
-
result = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
- lookup_domains[i],
- pstate->language ()->la_language
- == language_cplus
- ? &is_a_field_of_this : NULL);
+ lookup_domains[i], NULL);
if (result.symbol && SYMBOL_CLASS (result.symbol) == LOC_TYPEDEF)
{
yylval.tsym.type = SYMBOL_TYPE (result.symbol);
@@ -1323,14 +1315,14 @@ yylex (void)
if (hextype == INT)
{
yylval.ssym.sym = result;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
+ yylval.ssym.is_a_field_of_this = false;
return NAME_OR_INT;
}
}
/* Any other kind of symbol */
yylval.ssym.sym = result;
- yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL;
+ yylval.ssym.is_a_field_of_this = false;
return NAME;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-22 11:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22 11:36 [binutils-gdb] gdb/fortran: Remove some dead code from the parser Andrew Burgess
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).