[PATCH] D91950: [clang-format] Add BreakBeforeInlineASMColon configuration

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 04:08:16 PST 2020


MyDeveloperDay added a comment.

My understanding is that the following current behavour

`
asm("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"

  : "DEF"
  : "GHI");

asm volatile(

  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
  : "DEF"
  : "GHI");

asm("AAAAAAAAAAAAAAAAAAA" : "DEF" : "GHI");

asm volatile("AAAAAAAAAAAAA" : "DEF" : "GHI");

asm volatile("AAAAAAAAAAAAA" : "DEF"(dst) : "GHI"(src));
asm volatile("AAAAAAAAAAAAA" : "DEF"(dst));

asm volatile("AAAAAAAAAAAAA" : [Foo] "DEF"(dst) : [Foo] "GHI"(src));
asm volatile("AAAAAAAAAAAAA" : % [Foo] "DEF"(dst) : % [Foo] "GHI"(src));
`
should generate  as the following (with the option set to true) correct?

`
asm("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"

  : "DEF"
  : "GHI");

asm volatile(

  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
  : "DEF"
  : "GHI");

asm("AAAAAAAAAAAAAAAAAAA"

  : "DEF"
  : "GHI");

asm volatile("AAAAAAAAAAAAA"

  : "DEF"
  : "GHI");

asm volatile("AAAAAAAAAAAAA"

  : "DEF"(dst)
  : "GHI"(src));

asm volatile("AAAAAAAAAAAAA"

  : "DEF"(dst));

asm volatile("AAAAAAAAAAAAA"

  : [Foo] "DEF"(dst) : [Foo] "GHI"(src));

asm volatile("AAAAAAAAAAAAA"

  : %[Foo] "DEF"(dst)
  : %[Foo] "GHI"(src));

`

is that correct? I highly recommend adding a few more examples in the test to show this behavior isn't just for "loooong" strings

NOTE: there is a bug in the way '%[Foo]' would get formatted to be '% [Foo]'


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91950/new/

https://reviews.llvm.org/D91950



More information about the cfe-commits mailing list