[v3,200/206] Inline expression constructor

Message ID 20210220201609.838264-201-tom@tromey.com
State New
Headers show
Series
  • Refactor expressions
Related show

Commit Message

Tom Tromey Feb. 20, 2021, 8:16 p.m.
The struct expression constructor no longer does any real work, so
this inlines it.  The default destructor can also be used now as well.

gdb/ChangeLog
2021-02-20  Tom Tromey  <tom@tromey.com>

	* parse.c (expression::expression, expression::~expression):
	Remove.
	* expression.h (struct expression): Inline constructor.  Remove
	destructor.
---
 gdb/ChangeLog    |  7 +++++++
 gdb/expression.h |  8 ++++++--
 gdb/parse.c      | 10 ----------
 3 files changed, 13 insertions(+), 12 deletions(-)

-- 
2.26.2

Patch

diff --git a/gdb/expression.h b/gdb/expression.h
index eae986af747..5c5371e9660 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -196,8 +196,12 @@  make_operation (Arg... args)
 
 struct expression
 {
-  expression (const struct language_defn *, struct gdbarch *);
-  ~expression ();
+  expression (const struct language_defn *lang, struct gdbarch *arch)
+    : language_defn (lang),
+      gdbarch (arch)
+  {
+  }
+
   DISABLE_COPY_AND_ASSIGN (expression);
 
   /* Return the opcode for the outermost sub-expression of this
diff --git a/gdb/parse.c b/gdb/parse.c
index 96dd5dbf7a0..d068c94dfcd 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -105,16 +105,6 @@  expr_builder::release ()
   return std::move (expout);
 }
 
-expression::expression (const struct language_defn *lang, struct gdbarch *arch)
-  : language_defn (lang),
-    gdbarch (arch)
-{
-}
-
-expression::~expression ()
-{
-}
-
 /* Return the type of MSYMBOL, a minimal symbol of OBJFILE.  If
    ADDRESS_P is not NULL, set it to the MSYMBOL's resolved
    address.  */