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

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


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f881a2abe2c3eceeae0272fc41ba0a237770450
      https://github.com/llvm/llvm-project/commit/7f881a2abe2c3eceeae0272fc41ba0a237770450
  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/FormatTest.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