[PATCH v2 201/206] Inline expr_builder methods

Tom Tromey tom@tromey.com
Sat Feb 13 20:02:51 GMT 2021


This inlines the expr_builder constructor and release method.  These
are straightforward, so this seemed simpler.

2021-02-13  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     |  7 +++++++
 gdb/parse.c       | 14 --------------
 gdb/parser-defs.h | 10 ++++++++--
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/gdb/parse.c b/gdb/parse.c
index 17c0b2937b2..618819a8a85 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -91,20 +91,6 @@ innermost_block_tracker::update (const struct block *b,
 
 
 
-/* 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.  */
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 3e81e0b8b3c..22768215a24 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -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.  */
 
-- 
2.26.2



More information about the Gdb-patches mailing list