[all-commits] [llvm/llvm-project] 52ab7a: [clang-format] Add BitFieldColonSpacing option

Anders Waldenborg via All-commits all-commits at lists.llvm.org
Mon Jul 20 11:59:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 52ab7aa0ba5a3c7a0b2fe1b48519f1d4dc52cacf
      https://github.com/llvm/llvm-project/commit/52ab7aa0ba5a3c7a0b2fe1b48519f1d4dc52cacf
  Author: Anders Waldenborg <anders at 0x63.nu>
  Date:   2020-07-20 (Mon, 20 Jul 2020)

  Changed paths:
    M clang/docs/ClangFormatStyleOptions.rst
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Format/Format.h
    M clang/lib/Format/Format.cpp
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTest.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list