public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 1/2] Don't include block.h from expop.h
Date: Sat, 21 Jan 2023 14:09:53 -0700	[thread overview]
Message-ID: <20230121210954.3284323-2-tom@tromey.com> (raw)
In-Reply-To: <20230121210954.3284323-1-tom@tromey.com>

expop.h needs block.h for a single inline function.  However, I don't
think most of the check_objfile functions need to be defined in the
header (just the templates).  This patch moves the one offending
function and removes the include.
---
 gdb/expop.h    | 8 ++------
 gdb/expprint.c | 6 ++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/gdb/expop.h b/gdb/expop.h
index 9e6ab0dd244..bfe55e4f2fd 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -20,7 +20,6 @@
 #ifndef EXPOP_H
 #define EXPOP_H
 
-#include "block.h"
 #include "c-lang.h"
 #include "cp-abi.h"
 #include "expression.h"
@@ -229,11 +228,8 @@ check_objfile (struct symbol *sym, struct objfile *objfile)
   return check_objfile (sym->objfile (), objfile);
 }
 
-static inline bool
-check_objfile (const struct block *block, struct objfile *objfile)
-{
-  return check_objfile (block_objfile (block), objfile);
-}
+extern bool check_objfile (const struct block *block,
+			   struct objfile *objfile);
 
 static inline bool
 check_objfile (const block_symbol &sym, struct objfile *objfile)
diff --git a/gdb/expprint.c b/gdb/expprint.c
index b70645fac92..63004f7f106 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -75,6 +75,12 @@ debug_exp (struct expression *exp)
 namespace expr
 {
 
+bool
+check_objfile (const struct block *block, struct objfile *objfile)
+{
+  return check_objfile (block_objfile (block), objfile);
+}
+
 void
 dump_for_expression (struct ui_file *stream, int depth, enum exp_opcode op)
 {
-- 
2.39.0


  reply	other threads:[~2023-01-21 21:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-21 21:09 [PATCH 0/2] Reduce includes of block.h Tom Tromey
2023-01-21 21:09 ` Tom Tromey [this message]
2023-01-21 21:09 ` [PATCH 2/2] Remove block.h includes from some tdep files Tom Tromey
2023-02-08 18:27 ` [PATCH 0/2] Reduce includes of block.h Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230121210954.3284323-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).