This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: add DOLLARS_IN_ASM_IDENTIFIERS


Sandra Loosemore <sandra@codesourcery.com> writes:

> MIPS assembly language uses identifiers like "$17" as the names of registers.
> This patch makes cpp do the right thing with concatenation, etc, by adding a new
> target macro.  The existing DOLLARS_IN_IDENTIFIERS applies only to C-like
> languages, and conventions for assembly language files may well be different.  OK?

I think you should simply use the existing DOLLARS_IN_IDENTIFIERS.
None of our ports actually translate the '$' into anything else when
writing to the asm file.  Therefore if C/C++ code supports '$' in an
identifier, it follows that the assembler must support '$'.

OK, as I wrote that I thought of an exception: for ports which use a
leading underscore on symbol names, it would be possible that the
assembler would permit '$' in an identifier any place other than the
start.  But I think that is a combination of unlikely cases that we
needn't worry about.  Especially since the bad effects of getting this
wrong are minimal.

Also I can't recall ever encountering an assembler which did not
accept '$' in identifiers.

Ian


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