[all-commits] [llvm/llvm-project] 6f46bc: [clang-format] Treat AttributeMacro more like __at...

Owen Pan via All-commits all-commits at lists.llvm.org
Sun Oct 15 15:45:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f46bcc609f14121e6942763ba9871f98541ea0e
      https://github.com/llvm/llvm-project/commit/6f46bcc609f14121e6942763ba9871f98541ea0e
  Author: Jared Grubb <jgrubb at apple.com>
  Date:   2023-10-15 (Sun, 15 Oct 2023)

  Changed paths:
    M clang/lib/Format/ContinuationIndenter.cpp
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTestObjC.cpp
    M clang/unittests/Format/TokenAnnotatorTest.cpp

  Log Message:
  -----------
  [clang-format] Treat AttributeMacro more like __attribute__

There are two parts to this fix:
- Annotate the paren after an AttributeMacro as an AttributeLParen.
- Treat an AttributeMacro-without-paren the same as one with a paren.

I added a new test-case to differentiate a macro that is or is-not an
AttributeMacro; also handled whether ColumnLimit is set to infinite (0) or a
finite value, as part of this patch is in ContinuationIndenter.

Closes #68722.

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




More information about the All-commits mailing list