[PATCH] D102730: [clang-format] Support custom If macros

Vitali Lovich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 18 15:29:11 PDT 2021


vlovich created this revision.
vlovich added reviewers: curdeius, MyDeveloperDay, HazardyKnusperkeks.
vlovich added a project: clang-format.
vlovich requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Like with ForEachMacros, support user to provide additional macros that act like `if` statements.

This makes it possible to support KJ_IF_MAYBE from the cap'n'proto library:
https://github.com/capnproto/capnproto/blob/master/kjdoc/tour.md#maybes.

https://bugs.llvm.org/show_bug.cgi?id=49354


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102730

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102730.346287.patch
Type: text/x-patch
Size: 6656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210518/0bfd7fea/attachment.bin>


More information about the cfe-commits mailing list