public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@tootie.to.cygnus.com>
To: rth@cygnus.com
Cc: binutils@sourceware.cygnus.com
Subject: Patch for gas (mri mode).
Date: Mon, 20 Sep 1999 10:43:00 -0000	[thread overview]
Message-ID: <199909201741.NAA26512@tootie.to.cygnus.com> (raw)

Hi, Richard

The following patch is relative to net binutils repository.  Please,
approve it or not.  Without the patch, the assembler code likes the
following results in assembler crash because in MRI mode the assembler
does not define NARG, but in non-MRI mode the assembler expects that
NARG is defined.

.mri 0
.macro listing_off
.nolist
.endm
.macro listing_on
list
.endm
listing_off
.mri 1
listing_on


Vlad


1999-09-20  Vladimir Makarov  <vmakarov@tootie.to.cygnus.com>

	* macro.c (macro_entry): Add new member macro_mri.
        (define_macro): Assign value to macro->macro_mri.
        (do_formals): Use macro->macro_mri instead of macro_mri to decide
        define formal NARG or not.
        (macro_expand): Use m->macro_mri instead of macro_mri to decide
        make expansion of NARG or not.

Index: macro.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/macro.c,v
retrieving revision 1.2
diff -p -c -r1.2 macro.c
*** macro.c	1999/06/03 00:23:27	1.2
--- macro.c	1999/09/20 17:09:25
*************** formal_entry;
*** 100,105 ****
--- 100,111 ----
  typedef struct macro_struct
    {
      sb sub;			/* substitution text. */
+     /* The following member value is MACRO_MRI when macro definition
+        is started.  It is needed for complex cases when macro is
+        defined in mri mode and used in non-mri mode or vise versa.
+        For example, if a macro is defined in non-mri mode and expanded
+        in mri mode, we should not expand NARG formal. */
+     int macro_mri;
      int formal_count;		/* number of formal args. */
      formal_entry *formals;	/* pointer to list of formal_structs */
      struct hash_control *formal_hash; /* hash table of formals. */
*************** do_formals (macro, idx, in)
*** 502,508 ****
        *p = NULL;
      }
  
!   if (macro_mri)
      {
        formal_entry *formal;
        const char *name;
--- 508,514 ----
        *p = NULL;
      }
  
!   if (macro->macro_mri)
      {
        formal_entry *formal;
        const char *name;
*************** define_macro (idx, in, label, get_line, 
*** 556,561 ****
--- 562,568 ----
    sb_new (&name);
  
    macro->formal_count = 0;
+   macro->macro_mri = macro_mri;
    macro->formals = 0;
  
    idx = sb_skip_white (idx, in);
*************** macro_expand (idx, in, m, out, comment_c
*** 1056,1062 ****
  	}
      }
  
!   if (macro_mri)
      {
        char buffer[20];
  
--- 1063,1069 ----
  	}
      }
  
!   if (m->macro_mri)
      {
        char buffer[20];
  

             reply	other threads:[~1999-09-20 10:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-20 10:43 Vladimir Makarov [this message]
1999-09-20 10:59 ` Richard Henderson
1999-09-20 11:03   ` Vladimir Makarov
1999-09-20 11:06 ` Ian Lance Taylor
1999-09-20 13:05   ` Vladimir Makarov
1999-09-20 13:51     ` Ian Lance Taylor

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=199909201741.NAA26512@tootie.to.cygnus.com \
    --to=vmakarov@tootie.to.cygnus.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=rth@cygnus.com \
    /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).