File remove-some-unnecessary-includes-from-exp.y.patch of Package gdb.33580

From b4fdd96b50a92866886618f58d7408b2d086eeb0 Mon Sep 17 00:00:00 2001
From: Tom Tromey <tom@tromey.com>
Date: Sat, 18 Mar 2023 08:27:17 -0600
Subject: [PATCH] Remove some unnecessary includes from *-exp.y

I noticed a weird comment in one of the .y files, and then ended up
removing some unnecessary #includes from these files.

Tested by rebuilding.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
---
 gdb/ada-exp.y |  3 ---
 gdb/c-exp.y   |  3 ---
 gdb/d-exp.y   |  3 ---
 gdb/f-exp.y   |  3 ---
 gdb/go-exp.y  |  3 ---
 gdb/m2-exp.y  | 13 +++++--------
 gdb/p-exp.y   |  4 ----
 7 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 2f466e4de0a..a7052776b3a 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -42,9 +42,6 @@
 #include "parser-defs.h"
 #include "language.h"
 #include "ada-lang.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 #include "frame.h"
 #include "block.h"
 #include "ada-exp.h"
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 00599b0da7f..9ee4115560a 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -43,9 +43,6 @@
 #include "language.h"
 #include "c-lang.h"
 #include "c-support.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 #include "charset.h"
 #include "block.h"
 #include "cp-support.h"
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index 1c299bf7ac6..3a4e7ee0434 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -46,9 +46,6 @@
 #include "language.h"
 #include "c-lang.h"
 #include "d-lang.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 #include "charset.h"
 #include "block.h"
 #include "type-stack.h"
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 30da537ea84..96d38af363c 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -48,9 +48,6 @@
 #include "parser-defs.h"
 #include "language.h"
 #include "f-lang.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 #include "block.h"
 #include <ctype.h>
 #include <algorithm>
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index 242e7103b94..cbaa79ee18c 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -59,9 +59,6 @@
 #include "language.h"
 #include "c-lang.h"
 #include "go-lang.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 #include "charset.h"
 #include "block.h"
 #include "expop.h"
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index 6629974a73e..3124aaad44b 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -43,9 +43,6 @@
 #include "value.h"
 #include "parser-defs.h"
 #include "m2-lang.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
 #include "block.h"
 #include "m2-exp.h"
 
@@ -140,7 +137,7 @@ using namespace expr;
 %left '+' '-'
 %left '*' '/' DIV MOD
 %right UNARY
-%right '^' DOT '[' '('
+%right '^' DOT_ID '[' '('
 %right NOT '~'
 %left COLONCOLON QID
 /* This is not an actual token ; it is used for precedence. 
@@ -262,7 +259,7 @@ exp	:	DEC '(' exp ',' exp ')'
 			}
 	;
 
-exp	:	exp DOT NAME
+exp	:	exp DOT_ID NAME
 			{
 			  pstate->push_new<structop_operation>
 			    (pstate->pop (), copy_name ($3));
@@ -297,7 +294,7 @@ exp     :       exp '['
 			   that follow in the list.  It is *not* specific to
 			   function types */
 			{ pstate->start_arglist(); }
-		non_empty_arglist ']'  %prec DOT
+		non_empty_arglist ']'  %prec DOT_ID
 			{
 			  gdb_assert (pstate->arglist_len > 0);
 			  std::vector<operation_up> args
@@ -311,7 +308,7 @@ exp	:	exp '('
 			/* This is to save the value of arglist_len
 			   being accumulated by an outer function call.  */
 			{ pstate->start_arglist (); }
-		arglist ')'	%prec DOT
+		arglist ')'	%prec DOT_ID
 			{
 			  std::vector<operation_up> args
 			    = pstate->pop_vector (pstate->end_arglist ());
@@ -793,7 +790,7 @@ yylex (void)
       else
       {
 	 pstate->lexptr++;
-	 return DOT;
+	 return DOT_ID;
       }
 
 /* These are character tokens that appear as-is in the YACC grammar */
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 6e03f1a5381..cf170408ac9 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -50,11 +50,7 @@
 #include "parser-defs.h"
 #include "language.h"
 #include "p-lang.h"
-#include "bfd.h" /* Required by objfiles.h.  */
-#include "symfile.h" /* Required by objfiles.h.  */
-#include "objfiles.h" /* For have_full_symbols and have_partial_symbols.  */
 #include "block.h"
-#include "completer.h"
 #include "expop.h"
 
 #define parse_type(ps) builtin_type (ps->gdbarch ())

base-commit: ea9f87de71b8d5cd0f9d62ebca57cef7ee879324
-- 
2.35.3

openSUSE Build Service is sponsored by