[all-commits] [llvm/llvm-project] 413a7c: [clang-format] Support block indenting array/struc...

Gedare Bloom via All-commits all-commits at lists.llvm.org
Thu Jul 6 13:42:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 413a7cb6e0db96b29bda0dab8541e225193ad139
      https://github.com/llvm/llvm-project/commit/413a7cb6e0db96b29bda0dab8541e225193ad139
  Author: Gedare Bloom <gedare at rtems.org>
  Date:   2023-07-06 (Thu, 06 Jul 2023)

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

  Log Message:
  -----------
  [clang-format] Support block indenting array/struct list initializers

C89 and C99 list initializers are treated differently than Cpp11 braced
initializers. This patch identifies the C array/struct initializer lists by
finding the preceding equal sign before a left brace, and applies formatting
rules for BracketAlignmentStyle.BlockIndent to those list initializers.

Fixes #57878.

Differential Revision: https://reviews.llvm.org/D153205




More information about the All-commits mailing list