HomePhabricator

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

Description

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

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.

Reviewers: djasper, benhamilton

Reviewed By: djasper, benhamilton

Subscribers: benhamilton, cfe-commits

Differential Revision: https://reviews.llvm.org/D54795

Details

Auditors
danilaml
Committed
krasimirNov 22 2018, 6:49 AM
Reviewer
djasper
Differential Revision
D54795: [clang-format] Do not treat asm clobber [ as ObjCExpr, refined
Branches
Unknown
Tags
Unknown

Event Timeline

danilaml added inline comments.
/cfe/trunk/unittests/Format/FormatTest.cpp
12783

Why is this test duplicated?

krasimir marked an inline comment as done.Nov 22 2018, 8:07 AM
krasimir added inline comments.
/cfe/trunk/unittests/Format/FormatTest.cpp
12783

IMO its not; note that this one has a trailing colon after (d), while the others don't.

krasimir marked an inline comment as done.Nov 22 2018, 8:08 AM
krasimir added inline comments.
/cfe/trunk/unittests/Format/FormatTest.cpp
12783

s/colon/comma

danilaml accepted this commit.Nov 22 2018, 9:50 AM
danilaml added inline comments.
/cfe/trunk/unittests/Format/FormatTest.cpp
12783

Indeed, sorry! My diff tool didn't properly highlight such a small diff.

All concerns with this commit have now been addressed.Nov 22 2018, 9:50 AM