aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-11-25 10:19:40 -0700
committerTom Tromey <tom@tromey.com>2020-11-25 10:19:40 -0700
commitcbfa382abb360307c0c6b750e4c550a0d2b702d6 (patch)
tree86e4abe21ae6b7aa3a7916d9f96714bc68e1e5a1 /gdb
parentaf30c400ea2ae16742ce194f0490fec4170320d5 (diff)
downloadgdb-cbfa382abb360307c0c6b750e4c550a0d2b702d6.zip
gdb-cbfa382abb360307c0c6b750e4c550a0d2b702d6.tar.gz
gdb-cbfa382abb360307c0c6b750e4c550a0d2b702d6.tar.bz2
Remove two unnecessary variables from evaluate_subexp_standard
I noticed a couple of spots in evaluate_subexp_standard that looked like: value *result; result = something; return result; This patch simplifies these spots to a simple "return". gdb/ChangeLog 2020-11-25 Tom Tromey <tom@tromey.com> * eval.c (evaluate_subexp_standard): Remove unnecessary variables.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/eval.c12
2 files changed, 8 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 77aeb77e..0379a4c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-11-25 Tom Tromey <tom@tromey.com>
+ * eval.c (evaluate_subexp_standard): Remove unnecessary
+ variables.
+
+2020-11-25 Tom Tromey <tom@tromey.com>
+
* d-lang.c: Include parser-defs.h.
* rust-lang.c: Include parser-defs.h.
* c-lang.h: Do not include parser-defs.h.
diff --git a/gdb/eval.c b/gdb/eval.c
index 2626ee6..407d4b4 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2142,12 +2142,11 @@ evaluate_subexp_standard (struct type *expect_type,
|| op == BINOP_MOD)
&& value_logical_not (arg2))
{
- struct value *v_one, *retval;
+ struct value *v_one;
v_one = value_one (value_type (arg2));
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &v_one);
- retval = value_binop (arg1, v_one, op);
- return retval;
+ return value_binop (arg1, v_one, op);
}
else
{
@@ -2532,12 +2531,7 @@ evaluate_subexp_standard (struct type *expect_type,
return eval_skip_value (exp);
}
else
- {
- struct value *retvalp = evaluate_subexp_for_address (exp, pos,
- noside);
-
- return retvalp;
- }
+ return evaluate_subexp_for_address (exp, pos, noside);
case UNOP_SIZEOF:
if (noside == EVAL_SKIP)