]> granicus.if.org Git - clang/commit
clang-format: Allow optimizer to break template declaration.
authorFrancois Ferrand <thetypz@gmail.com>
Wed, 16 May 2018 08:25:03 +0000 (08:25 +0000)
committerFrancois Ferrand <thetypz@gmail.com>
Wed, 16 May 2018 08:25:03 +0000 (08:25 +0000)
commit5a506038868f5e5cb910927489de4a5c09e3d31d
tree1d00a8837313a19fac3a8c73de8ae9b930d39b9b
parent9eb858c859f4b7c9e4314282286084983988a921
clang-format: Allow optimizer to break template declaration.

Summary:
Introduce `PenaltyBreakTemplateDeclaration` to control the penalty,
and change `AlwaysBreakTemplateDeclarations` to an enum with 3 modes:
* `No` for regular, penalty based, wrapping of template declaration
* `MultiLine` for always wrapping before multi-line declarations (e.g.
  same as legacy behavior when `AlwaysBreakTemplateDeclarations=false`)
* `Yes` for always wrapping (e.g. same as legacy behavior when
  `AlwaysBreakTemplateDeclarations=true`)

Reviewers: krasimir, djasper, klimek

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D42684

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332436 91177308-0d34-0410-b5e6-96231b3b80d8
docs/ClangFormatStyleOptions.rst
include/clang/Format/Format.h
lib/Format/ContinuationIndenter.cpp
lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp