[PATCH] D95168: Add InsertBraces option

Tiago Macarios via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 21 13:22:07 PST 2021


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

InsertBraces will insert braces for single line control flow statements (currently if/else/for).
It currently accepts the following options:

- Never - Keeps the current behavior and never add braces (also default value)
- Always - Always add braces to single lines after the control flow statement
- WrapLikely - If the line after the control flow statement is not braced and likely to wrap, braces will be  added


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95168

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95168.318301.patch
Type: text/x-patch
Size: 12082 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210121/f05eee1f/attachment-0001.bin>


More information about the cfe-commits mailing list