[PATCH] D80115: [clang-format] [PR45816] Add AlignConsecutiveBitFields

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 18 03:42:56 PDT 2020


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: krasimir, mitchell-stellar, JakeMerdichAMD, curdeius, owenpan.
MyDeveloperDay added projects: clang, clang-format.
MyDeveloperDay updated this revision to Diff 264575.
MyDeveloperDay added a comment.
MyDeveloperDay edited the summary of this revision.
MyDeveloperDay edited the summary of this revision.

clang-format


https://bugs.llvm.org/show_bug.cgi?id=45816

The following revision adds the ability to align consecutive bitfield similar to AlignConsecutiveAssignments and AlignConsecutiveDeclarations

This will format the following code from

  struct Options {
    bool some_field : 1;
    bool some_another_field : 1;
    int yet_another_field : 1;
  };

With the following consiguration change

  ...
  AlignConsecutiveBitFields: 'true'
  ...

To be

  struct Options {
    bool some_field         : 1;
    bool some_another_field : 1;
    int  yet_another_field  : 1;
  };


https://reviews.llvm.org/D80115

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/WhitespaceManager.cpp
  clang/lib/Format/WhitespaceManager.h
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80115.264575.patch
Type: text/x-patch
Size: 7170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200518/329fefbf/attachment-0001.bin>


More information about the cfe-commits mailing list