[PATCH] D104096: [Clang-Format] Add ReferenceAlignment directive

Seraphime Kirkovski (VMware) via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 11 00:45:50 PDT 2021


skirkovski created this revision.
skirkovski requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This is a roll-forward of D90238 <https://reviews.llvm.org/D90238> originally implemented by @mrexodia and
@catskul

This introduces `ReferenceAlignment` style option modeled around
`PointerAlignment`.
Style implementors can specify Left, Right, Middle or Pointer to
follow whatever the PointerAlignment option specifies.

Changes since D90238 <https://reviews.llvm.org/D90238>:

- Added tests for ref-qualified functions
- Reorganized the newly introduced TEST_F so pure LLVM style tests come first
- Removed ReferenceAlignment assignements in LLVM derived styles (now only the LLVM style specifies RAS_Pointer)
- Split the getTokenPointerAlignment helper in getTokenReferenceAlignment and getTokenPointerOrReferenceAlignment
- Test clang-format by running unittests and reformatting the entire compiler-rt tree


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104096

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/TokenAnnotator.cpp
  clang/lib/Format/TokenAnnotator.h
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104096.351354.patch
Type: text/x-patch
Size: 14017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210611/b6659613/attachment-0001.bin>


More information about the cfe-commits mailing list