[clang-format] Add BitFieldColonSpacing option
authorAnders Waldenborg <anders@0x63.nu>
Sat, 18 Jul 2020 10:35:01 +0000 (12:35 +0200)
committerAnders Waldenborg <anders@0x63.nu>
Mon, 20 Jul 2020 18:55:51 +0000 (20:55 +0200)
commit52ab7aa0ba5a3c7a0b2fe1b48519f1d4dc52cacf
tree970724a0b559a81b223774b5d3e2cae10a921211
parentf8df2e1a19913e997d8d6dbe573de977406e736e
[clang-format] Add BitFieldColonSpacing option

This new option allows controlling if there should be spaces around
the ':' in a bitfield declaration.

BitFieldColonSpacing accepts four different values:

  // "Both" - default
  unsigned bitfield : 5
  unsigned bf2      : 5  // AlignConsecutiveBitFields=true

  // "None"
  unsigned bitfield:5
  unsigned bf2     :5

  // "Before"
  unsigned bitfield :5
  unsigned bf2      :5

  // "After"
  unsigned bitfield: 5
  unsigned bf2     : 5

Differential Revision: https://reviews.llvm.org/D84090
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/Format/Format.h [changed mode: 0755->0644]
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTest.cpp