clang-format: Allow unbroken ::: in inline assembly

Eugene Toder eltoder at gmail.com
Mon Sep 15 14:14:11 PDT 2014


Hello,

When inline assembly has only clobber constraints it's common to write all
three colons without spaces, for example:

asm volatile("nop" ::: "memory");

Currently clang-format splits ::: into coloncolon and colon, and inserts a
space before the colon, which looks strange:

asm volatile("nop" :: : "memory");

I suggest to allow having ::: without spaces in this case. Attached is a
simple patch to that effect.

Thanks,
Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140915/2f0350a1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asm-triple-colon.patch
Type: text/x-patch
Size: 788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140915/2f0350a1/attachment.bin>


More information about the cfe-commits mailing list