Inline expr_builder methods
authorTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:27:57 +0000 (07:27 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:28:43 +0000 (07:28 -0700)
This inlines the expr_builder constructor and release method.  These
are straightforward, so this seemed simpler.

gdb/ChangeLog
2021-03-08  Tom Tromey  <tom@tromey.com>

* parser-defs.h (struct expr_builder) <expr_builder>: Inline.
<release>: Inline.
* parse.c (expr_builder::expr_builder, expr_builder::release):
Remove.

gdb/ChangeLog
gdb/parse.c
gdb/parser-defs.h

index e2f6368af4dc0c94e139bdc9f017a15680a0a7a6..212f61da4852be1f45c869bea86eb946043bf784 100644 (file)
@@ -1,3 +1,10 @@
+2021-03-08  Tom Tromey  <tom@tromey.com>
+
+       * parser-defs.h (struct expr_builder) <expr_builder>: Inline.
+       <release>: Inline.
+       * parse.c (expr_builder::expr_builder, expr_builder::release):
+       Remove.
+
 2021-03-08  Tom Tromey  <tom@tromey.com>
 
        * parse.c (expression::expression, expression::~expression):
index d068c94dfcd50be44cd9e7af3985def6f82f9707..056dee18d078f839d1240533150b3d3e76325e56 100644 (file)
@@ -91,20 +91,6 @@ innermost_block_tracker::update (const struct block *b,
 
 \f
 
-/* See definition in parser-defs.h.  */
-
-expr_builder::expr_builder (const struct language_defn *lang,
-                           struct gdbarch *gdbarch)
-  : expout (new expression (lang, gdbarch))
-{
-}
-
-expression_up
-expr_builder::release ()
-{
-  return std::move (expout);
-}
-
 /* Return the type of MSYMBOL, a minimal symbol of OBJFILE.  If
    ADDRESS_P is not NULL, set it to the MSYMBOL's resolved
    address.  */
index 3e81e0b8b3cdb2ee794b061dd95457b056d7f8c2..22768215a244c1598be1cd3fd777077816631cec 100644 (file)
@@ -42,13 +42,19 @@ struct expr_builder
      And GDBARCH is the gdbarch to use during parsing.  */
 
   expr_builder (const struct language_defn *lang,
-               struct gdbarch *gdbarch);
+               struct gdbarch *gdbarch)
+    : expout (new expression (lang, gdbarch))
+  {
+  }
 
   DISABLE_COPY_AND_ASSIGN (expr_builder);
 
   /* Resize the allocated expression to the correct size, and return
      it as an expression_up -- passing ownership to the caller.  */
-  ATTRIBUTE_UNUSED_RESULT expression_up release ();
+  ATTRIBUTE_UNUSED_RESULT expression_up release ()
+  {
+    return std::move (expout);
+  }
 
   /* Return the gdbarch that was passed to the constructor.  */
 
This page took 0.026975 seconds and 4 git commands to generate.