FreeBSD/contrib/binutils/gas/config/tc-arm.c
/* Look for the .req directive.	 This is of the form:

	new_register_name .req existing_register_name

   If we find one, or if it looks sufficiently like one that we want to
   handle any error here, return non-zero.  Otherwise return zero.  */
Look for the .req directive.    This is of the form:
new_register_name .req existing_register_name

If we find one, or if it looks sufficiently like one that we want to
handle any error here, return non-zero.  Otherwise return zero.
Look for the . req directive . This is of the form : new_register_name . req existing_register_name If we find one or if it looks sufficiently like one that we want to handle any error here return non - zero . Otherwise return zero .
static int
create_register_alias (char * newname, char *p)
{
  struct reg_entry *old;
  char *oldname, *nbuf;
  size_t nlen;
  oldname = p;
  if (strncmp (oldname, " .req ", 6) != 0)
    return 0;
  oldname += 6;
  if (*oldname == '\0')
    return 0;
  old = hash_find (arm_reg_hsh, oldname);
  if (!old)
    {
      as_warn (_("unknown register '%s' -- .req ignored"), oldname);
      return 1;
    }
#ifdef TC_CASE_SENSITIVE
  nlen = p - newname;
#else
  newname = original_case_string;
  nlen = strlen (newname);
#endif
  nbuf = alloca (nlen + 1);
  memcpy (nbuf, newname, nlen);
  nbuf[nlen] = '\0';
  insert_reg_alias (nbuf, old->number, old->type);
  for (p = nbuf; *p; p++)
    *p = TOUPPER (*p);
  if (strncmp (nbuf, newname, nlen))
    insert_reg_alias (nbuf, old->number, old->type);
  for (p = nbuf; *p; p++)
    *p = TOLOWER (*p);
  if (strncmp (nbuf, newname, nlen))
    insert_reg_alias (nbuf, old->number, old->type);
  return 1;
}
static int create_register_alias ( char * newname , char * p ) { struct reg_entry * old ; char * oldname , * nbuf ; size_t nlen ; oldname = p ; if ( strncmp ( oldname , " " , 6 ) != 0 ) return 0 ; oldname += 6 ; if ( * oldname == ' \0 ' ) return 0 ; old = hash_find ( arm_reg_hsh , oldname ) ; if ( ! old ) { as_warn ( _ ( " " ) , oldname ) ; return 1 ; } #ifdef TC_CASE_SENSITIVE nlen = p - newname ; #else newname = original_case_string ; nlen = strlen ( newname ) ; #endif nbuf = alloca ( nlen + 1 ) ; memcpy ( nbuf , newname , nlen ) ; nbuf [ nlen ] = ' \0 ' ; insert_reg_alias ( nbuf , old -> number , old -> type ) ; for ( p = nbuf ; * p ; p ++ ) * p = TOUPPER ( * p ) ; if ( strncmp ( nbuf , newname , nlen ) ) insert_reg_alias ( nbuf , old -> number , old -> type ) ; for ( p = nbuf ; * p ; p ++ ) * p = TOLOWER ( * p ) ; if ( strncmp ( nbuf , newname , nlen ) ) insert_reg_alias ( nbuf , old -> number , old -> type ) ; return 1 ; }
Look for the .req directive.
Look for the . req directive .
/* The input scrubber ensures that whitespace after the mnemonic is
     collapsed to single spaces.  */ /* If TC_CASE_SENSITIVE is defined, then newname already points to
     the desired alias name, and p points to its end.  If not, then
     the desired alias name is in the global original_case_string.  */ /* Create aliases under the new name as stated; an all-lowercase
     version of the new name; and an all-uppercase version of the new
     name.  */