]> granicus.if.org Git - clang/commit
clang-format: Allow line merging and partial formatting of nested blocks
authorDaniel Jasper <djasper@google.com>
Tue, 5 Nov 2013 19:10:03 +0000 (19:10 +0000)
committerDaniel Jasper <djasper@google.com>
Tue, 5 Nov 2013 19:10:03 +0000 (19:10 +0000)
commit2a80ad6fe7aa506b1df2bb638bc367d9e760f707
treee1898983a585cafd84d1a289b146996e3f1c0fc1
parent9ce5135c15b3dfd5ee666b843f5df8ffb3a5038f
clang-format: Allow line merging and partial formatting of nested blocks

Before, clang-format would always format entire nested blocks, which
can be unwanted e.g. for long DEBUG({...}) statements. Also
clang-format would not allow to merge lines in nested blocks (e.g. to
put "if (a) return;" on one line in Google style).

This is the first step of several refactorings mostly focussing on the
additional functionality (by reusing the "format many lines" code to
format the children of a nested block). The next steps are:
* Pull out the line merging into its own class.
* Seperate the formatting of many lines from the formatting of a single
  line (and the analysis of the solution space).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194090 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp