This is an archive of the discontinued LLVM Phabricator instance.

Format code around VCS conflict markers.
ClosedPublic

Authored by klimek on Apr 11 2014, 5:50 AM.

Details

Reviewers
djasper

Diff Detail

Event Timeline

djasper accepted this revision.Apr 11 2014, 6:40 AM

Looks good.

lib/Format/Format.cpp
1268

s/offset/Offset/

Also, offset of what? Consider adding a comment or using a more specific name.

1272

"LineOffset" carries very little meaning, or at least I can't understand what it means without carefully looking at the code. Maybe add a comment.

1285

..Size is not a good name for a bool. Here and below. Just remove "Size"?

1307–1309

I think a comment here would help what an expected conflict line together with the generated tokens would look like. Possibly here or at the start of the function.

1392

I liked this empty line.

1473

Just to make this even clearer:

// Index (in 'Tokens') of the last token that starts a new line.
lib/Format/FormatToken.h
70

While this order makes sense, I think we should keep this alphabetical.

lib/Format/UnwrappedLineParser.cpp
475

I think "Unreachable" needs some explanation...

1418–1431

This would be just 6 lines with if () ..

unittests/Format/FormatTest.cpp
15

Remove?

klimek updated this revision to Unknown Object (????).Apr 11 2014, 7:15 AM

Applied review comments.

Still looks good.

lib/Format/UnwrappedLineParser.h
111–114

According to this comment, 'unreachable' does not seem like quite the right word. May "Active" or "ProcessBranch"?

(sending comments I had forgotten to send earlier...)

lib/Format/Format.cpp
1268

Done.

1272

Done.

1285

Changed to parse out the start of the line until the first whitespace and use that.

1307–1309

Done, hopefully...

1392

Done.

1473

Done.

lib/Format/FormatToken.h
70

Done.

lib/Format/UnwrappedLineParser.cpp
475

I think that generally the names are bad. I should rename them, but not in this CL. Added a comment that hopefully helps a bit.

1418–1431

Done.

unittests/Format/FormatTest.cpp
15

Done.

klimek added inline comments.Apr 14 2014, 1:56 AM
lib/Format/UnwrappedLineParser.h
111–114

Fully agreed - in a follow-up CL.

djasper closed this revision.May 22 2014, 4:57 AM