[PATCH] D42684: clang-format: Allow optimizer to break template declaration.

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 04:46:57 PST 2018


Typz created this revision.
Typz added reviewers: krasimir, djasper, klimek.

Introduce ``PenaltyBreakTemplateDeclaration`` to control the penalty,
and change ``AlwaysBreakTemplateDeclarations`` to an enum with 3 modes:

- ``None`` for automatic (e.g. penalty based) wrapping of template

declaration

- ``BeforeFunction`` for always wrapping before functions, and applying

penalty before classes (e.g. same as legacy behavior when
AlwaysBreakTemplateDeclarations=false)

- ``Always`` for always wrapping (e.g. same as legacy behavior when

AlwaysBreakTemplateDeclarations=true)


Repository:
  rC Clang

https://reviews.llvm.org/D42684

Files:
  include/clang/Format/Format.h
  lib/Format/ContinuationIndenter.cpp
  lib/Format/Format.cpp
  lib/Format/TokenAnnotator.cpp
  unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42684.131945.patch
Type: text/x-patch
Size: 11338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180130/bd52dc92/attachment-0001.bin>


More information about the cfe-commits mailing list