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: S/390: Some cleanup


Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:

> Zack Weinberg wrote:
>
>> You can remove the extra backslash in "\\t", too, e.g.
>> 
>> > !       case 0: return "tmhh\\t%0,%x2";
>> 
>> can be written "tmhh\t%0,%x2"
>
> Hmm, I left those in because I have the double-backslash
> also in all 'normal' output strings ...
>
> From checking other backends I now gather that this would
> be superfluous as well, right?  What exactly are the
> quoting rules in output strings?

Strings in .md files obey the same syntax rules as C strings, except
they're allowed to extend over multiple lines.  "tmhh\t%0,%x2" --
either on its own, or as part of a brace block -- will be passed
through verbatim to insn-output.c and interpreted by the C compiler.
"tmhh\\t%0,%x2" also translates to "tmhh\t%0,%x2" in insn-output.c,
because read-rtl.c will eat the first backslash.  (I think this means
if you want a literal backslash or quotation mark in your assembly
output template, you're hosed, but fortunately no one cares to do
that.)

"* return \"tmhh\\t%0,%x2\";" is equivalent to
{ return "tmhh\t%0,%x2"; } -- in the first case, however, the extra
backslashes *are* necessary, to prevent the reader from ending the
string too soon.  I invented the brace block notation precisely so
that people could stop using \\ and \" all over the place in their
output logic.

zw


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