summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format: Fix corner case for string splitting ..Daniel Jasper2013-08-231-12/+18
| | | | | | | | .. in conjunction with Style.AlwaysBreakBeforeMultilineStrings. Also, simplify the implementation by handling newly split strings and already split strings by the same code. llvm-svn: 189102
* clang-format: Handle trailing commas in column layout of braced list.Daniel Jasper2013-08-231-0/+3
| | | | | | | | | | Before, this was causing errors. Also exit early in breakProtrudingToken() (before the expensive call to SourceManager::getSpellingColumnNumber()). This makes formatting huge (100k+-item) braced lists possible. llvm-svn: 189094
* clang-format: Add column layout formatting for braced listsDaniel Jasper2013-08-221-10/+27
| | | | | | | | | | | | | | | | | | | | With this patch, braced lists (with more than 3 elements are formatted in a column layout if possible). E.g.: static const uint16_t CallerSavedRegs64Bit[] = { X86::RAX, X86::RDX, X86::RCX, X86::RSI, X86::RDI, X86::R8, X86::R9, X86::R10, X86::R11, 0 }; Required other changes: - FormatTokens can now have a special role that contains extra data and can do special formattings. A comma separated list is currently the only implementation. - Move penalty calculation entirely into ContinuationIndenter (there was a last piece still in UnwrappedLineFormatter). Review: http://llvm-reviews.chandlerc.com/D1457 llvm-svn: 189018
* clang-format: Indent relative to unary operators.Daniel Jasper2013-08-211-1/+3
| | | | | | | | | | | | | | | | Before: if (!aaaaaaaaaa( // break aaaaa)) { } After: if (!aaaaaaaaaa( // break aaaaa)) { } Also cleaned up formatting using clang-format. llvm-svn: 188891
* Split UnwrappedLineFormatter into individual components.Daniel Jasper2013-08-161-0/+670
Goals: Structure code better and make components easier to use for future features (e.g. column layout for long braced initializers). No functional changes intended. llvm-svn: 188543
OpenPOWER on IntegriCloud