This is an archive of the discontinued LLVM Phabricator instance.

[clang-tools-extra] Format sources with clang-format. NFC.
ClosedPublic

Authored by mgrang on Nov 5 2016, 9:10 PM.

Details

Summary

Ran clang-format on all .c/.cpp/.h files in clang-tools-extra.
Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories.

Diff Detail

Repository
rL LLVM

Event Timeline

mgrang updated this revision to Diff 76978.Nov 5 2016, 9:10 PM
mgrang retitled this revision from to [clang-tools-extra] Make spacing around loops and conditionals uniform. NFC..
mgrang updated this object.
mgrang added reviewers: klimek, alexfh.
mgrang added a project: Restricted Project.
alexfh edited edge metadata.Nov 6 2016, 9:29 AM

I assume you've just run clang-format on the sources? If yes, please say so in the patch description. If no, why fix any whitespace manually?

alexfh requested changes to this revision.Nov 6 2016, 9:29 AM
alexfh edited edge metadata.

I assume you've just run clang-format on the sources? If yes, please say so in the patch description. If no, why fix any whitespace manually?

This revision now requires changes to proceed.Nov 6 2016, 9:29 AM
mgrang updated this revision to Diff 76990.Nov 6 2016, 11:32 AM
mgrang retitled this revision from [clang-tools-extra] Make spacing around loops and conditionals uniform. NFC. to [clang-tools-extra] Format sources with clang-format. NFC..
mgrang edited edge metadata.

Ran clang-format on all C\C++ source files in clang-tools-extra.

alexfh requested changes to this revision.Nov 6 2016, 10:40 PM
alexfh edited edge metadata.

Please revert all files in test/. In many cases whitespace is important there and I don't want anyone to spend time figuring out all these cases.

This revision now requires changes to proceed.Nov 6 2016, 10:40 PM
mgrang updated this revision to Diff 77050.Nov 7 2016, 9:53 AM
mgrang updated this object.
mgrang edited edge metadata.
alexfh requested changes to this revision.Nov 7 2016, 11:19 AM
alexfh edited edge metadata.
  1. Please revert clang-reorder-fields, include-fixer, modularize and pptrace. The patch is too large now to work conveniently with it.
  2. Try using a fresher version of clang-format to fix the formatting of switch case labels (see inline comments for details).
  3. Once you address the comments, mark them as "Done" and check that clang-tools-extra still compiles and the tests pass.
clang-tidy/cert/CERTTidyModule.cpp
48–69 ↗(On Diff #77050)

<ignore this comment. phabricator doesn't let me delete it for some reason>

clang-tidy/cppcoreguidelines/SlicingCheck.h
21–25 ↗(On Diff #77050)

Please revert this.

clang-tidy/google/GlobalNamesInHeadersCheck.cpp
1–2 ↗(On Diff #77050)

Please fix.

clang-tidy/google/MemsetZeroLengthCheck.cpp
1–2 ↗(On Diff #77050)

Please fix.

clang-tidy/google/MemsetZeroLengthCheck.h
1–2 ↗(On Diff #77050)

Please fix.

clang-tidy/google/NonConstReferences.cpp
88–124 ↗(On Diff #77050)

Case labels should be indented by 2. Looks like a bug in clang-format, which doesn't, however, manifest in the version I'm using. Please revert this block.

clang-tidy/google/StringReferenceMemberCheck.h
1–2 ↗(On Diff #77050)

Please fix.

clang-tidy/misc/ArgumentCommentCheck.h
30–31 ↗(On Diff #77050)

Please revert this line.

clang-tidy/misc/NoexceptMoveConstructorCheck.cpp
46–66 ↗(On Diff #77050)

Case labels should be indented. Please revert this block or reformat using a fresher version of clang-format.

This revision now requires changes to proceed.Nov 7 2016, 11:19 AM
mgrang updated this revision to Diff 77127.Nov 7 2016, 5:56 PM
mgrang updated this object.
mgrang edited edge metadata.

Thanks Alexander for your comments. I have addressed all of them in this patch.

mgrang updated this revision to Diff 77128.Nov 7 2016, 6:00 PM
mgrang edited edge metadata.
mgrang marked 4 inline comments as done.
mgrang added a comment.Nov 7 2016, 6:02 PM

clang-tools-extra compiles fine and tests pass:

Testing Time: 8.27s

Expected Passes    : 291
Expected Failures  : 1
alexfh accepted this revision.Nov 7 2016, 9:52 PM
alexfh edited edge metadata.

One nit, otherwise LG. Do you need me to commit this for you?

clang-tidy/google/MemsetZeroLengthCheck.cpp
1 ↗(On Diff #77128)

The right way to fix this is to remove extra -s so that clang-format won't wrap the line next time.

This revision is now accepted and ready to land.Nov 7 2016, 9:52 PM

Thanks Alexander. I can commit this myself.

mgrang updated this revision to Diff 77152.Nov 7 2016, 11:45 PM
mgrang edited edge metadata.

I had to rebase the patch as one of the files (clang-tidy/misc/NonCopyableObjects.cpp) had changed since I pushed my patch.

mgrang updated this revision to Diff 77153.Nov 7 2016, 11:48 PM
mgrang updated this revision to Diff 77155.Nov 7 2016, 11:56 PM
This revision was automatically updated to reflect the committed changes.