public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: tbsaunde+binutils@tbsaunde.org
To: binutils@sourceware.org
Cc: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Subject: [PATCH] make a few variables static
Date: Wed, 13 Apr 2016 08:13:00 -0000	[thread overview]
Message-ID: <1460535504-25795-1-git-send-email-tbsaunde+binutils@tbsaunde.org> (raw)

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

Hi,

They are only used in one file, so we might as well restrict there scope to
that file, and theoretically this might slightly improve compilers ability to
optimize usage of these variables.

built crosses to sparc-elf, ppc64-elf, and nios2-elf, ok?
Trev

gas/ChangeLog:

2016-04-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-nios2.c (nios2_as_options): Make file static.
	* config/tc-ppc.c (toc_reloc_ypes): Likewise.
	* config/tc-sparc.c (native_op_table): Likewise.
---
 gas/config/tc-nios2.c | 2 +-
 gas/config/tc-ppc.c   | 2 +-
 gas/config/tc-sparc.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index bf37ff7..d207758 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -98,7 +98,7 @@ typedef enum
 } relax_optionT;
 
 /* Struct contains all assembler options set with .set.  */
-struct
+static struct
 {
   /* .set noat -> noat = 1 allows assembly code to use at without warning
      and macro expansions generate a warning.
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 1d2c57f..8bfdfdc 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -207,7 +207,7 @@ ppc_cpu_t sticky = 0;
 unsigned int ppc_abiversion = 0;
 
 /* Flags set on encountering toc relocs.  */
-enum {
+static enum {
   has_large_toc_reloc = 1,
   has_small_toc_reloc = 2
 } toc_reloc_types;
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index a51ca1f..b956131 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -758,7 +758,7 @@ md_show_usage (FILE *stream)
 }
 \f
 /* Native operand size opcode translation.  */
-struct
+static struct
   {
     const char *name;
     const char *name32;
-- 
2.1.4

             reply	other threads:[~2016-04-13  8:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13  8:13 tbsaunde+binutils [this message]
2016-04-13 10:04 ` Nick Clifton

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=1460535504-25795-1-git-send-email-tbsaunde+binutils@tbsaunde.org \
    --to=tbsaunde+binutils@tbsaunde.org \
    --cc=binutils@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).