This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Additional TC_EQUAL_IN_INSN check




:-----Original Message-----
:From: Nick Clifton [mailto:nickc@redhat.com]
:
:> This patch adds an argument to TC_EQUAL_IN_INSN so that the current
string
:> can be checked.
:
:Why is this needed ?  Do you have a port where the current semantics for
:TC_EQUAL_IN_INSN are insufficient ?  [The string 's' can be deduced from
:  input_line_pointer, so why pass it as an extra argument ?] 

:
:> It also adds an additional check for TC_EQUAL_IN_INSN in
:> read_a_source_file.
:
:Again - why is is this necessary ?  Couldn't the if-statement be
:rearranged so that there was only one invocation of TC_EQUAL_IN_INSN ?
:

I don't think passing an extra argument is a big deal.  If s is available,
why not use it instead of deducing it??  It turns out that the only port
(other than the one I'm working on) which uses this macro is the hppa and
the hppa port doesn't look at the string.  I've reworked the patch to pass s
and not input_line_pointer to the TC_EQUAL_IN_INSN macro and also to use
only one invocation of the macro as you suggested.  Okay to install, now?

Catherine

* read.c (read_a_source_file):  Check TC_EQUAL_IN_INSN if c is '='. 
* doc/internals.texi (TC_EQUAL_IN_INSN):  Pass current string instead of
input_line_pointer.

Index: read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.89
diff -p -r1.89 read.c
*** read.c	17 Feb 2005 13:46:00 -0000	1.89
--- read.c	17 Feb 2005 18:23:14 -0000
*************** read_a_source_file (char *name)
*** 708,720 ****
  		  /* Input_line_pointer->after ':'.  */
  		  SKIP_WHITESPACE ();
  		}
! 	      else if (c == '='
! 		       || ((c == ' ' || c == '\t')
! 			   && input_line_pointer[1] == '='
  #ifdef TC_EQUAL_IN_INSN
! 			   && !TC_EQUAL_IN_INSN (c, input_line_pointer)
  #endif
! 			   ))
  		{
  		  equals (s, 1);
  		  demand_empty_rest_of_line ();
--- 708,720 ----
  		  /* Input_line_pointer->after ':'.  */
  		  SKIP_WHITESPACE ();
  		}
!               else if ((c == '='
!                        || ((c == ' ' || c == '\t')
!                             && input_line_pointer[1] == '='))
  #ifdef TC_EQUAL_IN_INSN
!                            && !TC_EQUAL_IN_INSN (c, s)
  #endif
!                            )
  		{
  		  equals (s, 1);
  		  demand_empty_rest_of_line ();
Index: doc/internals.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/internals.texi,v
retrieving revision 1.40
diff -p -r1.40 internals.texi
*** doc/internals.texi	17 Aug 2004 12:19:58 -0000	1.40
--- doc/internals.texi	17 Feb 2005 18:23:15 -0000
*************** If you define this macro, GAS will not r
*** 1029,1035 ****
  If you define this macro, it should return nonzero if the instruction is
  permitted to contain an @kbd{=} character.  GAS will call it with two
  arguments, the character before the @kbd{=} character, and the value of
! @code{input_line_pointer} at that point.  GAS uses this macro to decide if
a
  @kbd{=} is an assignment or an instruction.
  
  @item TC_EOL_IN_INSN
--- 1029,1035 ----
  If you define this macro, it should return nonzero if the instruction is
  permitted to contain an @kbd{=} character.  GAS will call it with two
  arguments, the character before the @kbd{=} character, and the value of
! @code{s} at that point.  GAS uses this macro to decide if a
  @kbd{=} is an assignment or an instruction.
  
  @item TC_EOL_IN_INSN






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]