Page MenuHomePhabricator

[clang-format] Do not treat asm clobber [ as ObjCExpr, refined
ClosedPublic

Authored by krasimir on Nov 21 2018, 6:14 AM.

Details

Summary

r346756 refined clang-format to not treat the [ in asm (...: [] ..) as an
ObjCExpr. However that's not enough, as we might have a comma-separated list of
such clobbers as in the newly added test.
This updates the detection to instead look at the Line's first token being asm
and not mark [-s as ObjCExprs in this case.

Diff Detail

Repository
rC Clang

Event Timeline

krasimir created this revision.Nov 21 2018, 6:14 AM
krasimir added a subscriber: benhamilton.

Does this also work for _asm and __asm?

benhamilton accepted this revision.Nov 21 2018, 8:39 AM
This revision is now accepted and ready to land.Nov 21 2018, 8:39 AM
krasimir updated this revision to Diff 175038.Nov 22 2018, 4:52 AM
  • Add tests for _asm etc

Does this also work for _asm and __asm?

Thanks! Turns out, yes. I added tests for those.

djasper accepted this revision.Nov 22 2018, 6:28 AM
This revision was automatically updated to reflect the committed changes.