Skip to content
Snippets Groups Projects
  • Daniel Jasper's avatar
    1321eb59
    Better support for constructor initializers. · 1321eb59
    Daniel Jasper authored
    We used to format initializers like this (with a sort of hacky implementation):
    Constructor()
        : Val1(A),
          Val2(B) {
    
    and now format like this (with a somewhat better solution):
    Constructor()
        : Val1(A), Val2(B) {
    
    assuming this would not fit on a single line. Also added tests.
    
    As a side effect we now first analyze whether an UnwrappedLine needs to be
    split at all. If not, not splitting it is the best solution by definition. As
    this should be a very common case in normal code, not exploring the entire
    solution space can provide significant speedup.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170457 91177308-0d34-0410-b5e6-96231b3b80d8
    1321eb59
    History
    Better support for constructor initializers.
    Daniel Jasper authored
    We used to format initializers like this (with a sort of hacky implementation):
    Constructor()
        : Val1(A),
          Val2(B) {
    
    and now format like this (with a somewhat better solution):
    Constructor()
        : Val1(A), Val2(B) {
    
    assuming this would not fit on a single line. Also added tests.
    
    As a side effect we now first analyze whether an UnwrappedLine needs to be
    split at all. If not, not splitting it is the best solution by definition. As
    this should be a very common case in normal code, not exploring the entire
    solution space can provide significant speedup.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170457 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.