hanchenye-llvm-project/clang/unittests
Ben Hamilton 4dc658ca52 [clang-format] New format param ObjCBinPackProtocolList
Summary:
This is an alternative approach to D42014 after some
investigation by stephanemoore@ and myself.

Previously, the format parameter `BinPackParameters` controlled both
C function parameter list bin-packing and Objective-C protocol conformance
list bin-packing.

We found in the Google style, some teams were changing
`BinPackParameters` from its default (`true`) to `false` so they could
lay out Objective-C protocol conformance list items one-per-line
instead of bin-packing them into as few lines as possible.

To allow teams to use one-per-line Objective-C protocol lists without
changing bin-packing for other areas like C function parameter lists,
this diff introduces a new LibFormat parameter
`ObjCBinPackProtocolList` to control the behavior just for ObjC
protocol conformance lists.

The new parameter is an enum which defaults to `Auto` to keep the
previous behavior (delegating to `BinPackParameters`).

Depends On D42649

Test Plan: New tests added. make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, stephanemoore, djasper

Reviewed By: stephanemoore

Subscribers: Wizard, hokein, cfe-commits, klimek

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

llvm-svn: 324131
2018-02-02 20:15:14 +00:00
..
AST [AST] namespace ns { extern "C" { int X; }} prints as "ns::X", not as "X" 2018-02-02 13:34:47 +00:00
ASTMatchers Add hasTrailingReturn AST matcher 2018-01-22 22:45:23 +00:00
Analysis [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Basic [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
CodeGen Unit tests for TBAA metadata generation. 2017-12-22 15:22:45 +00:00
CrossTU [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Driver [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Format [clang-format] New format param ObjCBinPackProtocolList 2018-02-02 20:15:14 +00:00
Frontend [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Lex [Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch. 2018-01-29 13:21:23 +00:00
Rename [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Rewrite [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Sema [Sema] Add visited contexts to CodeCompleteContext 2018-01-17 14:29:25 +00:00
StaticAnalyzer [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Tooling [Tooling] Test more APIs of ToolExecutor. NFC. 2018-01-26 11:10:32 +00:00
libclang [libclang] Add PrintingPolicy for pretty printing declarations 2018-01-16 10:19:56 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00