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, generic] Support printing of escaped curly braces and vertical bar in assembler output


There are four in-tree target architectures that already use %|. I think
it would be better if you made these new escapes target-specific.

Escaped curly braces cannot be target-specific since do_assembler_dialects() in final.c ignores any % and considers '{' and '}' to be alternative delimeters.

There are two parts to it: the actual print_operand thing, that I say
should be target-specific, since some targets already use those characters
to mean different things; and of course the assembler dialects code needs
to be fixed to not choke on escaped versions of the characters it is
looking for. I say you can do this second thing without special-casing
{ | }, making it more generic and cleaner and simpler.


For the logic to find the end of an alternative, you can simply always
skip over the next char after any percent sign (well, check for end of
string, of course); there is no need to count percent signs.

That would not be a general approach. %% stands for printing percent sign, so in assembler string "{%%}" closing curly brace should be handled as the end of an alternative, though it follows a percent sign.

The second % is skipped over.



Segher



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