This is an archive of the discontinued LLVM Phabricator instance.

clang-format: Allow customizing the penalty for breaking assignment
ClosedPublic

Authored by Typz on Apr 25 2017, 1:14 AM.

Details

Summary

Add option to customize the penalty for breaking assignment

This allows increasing the priority of the assignment, to prefer spliting
an operation instead of splitting the assignment, e.g. :

int a = bbbbbbbbbbbbbbbb +
        cccccccccccccccc;

Diff Detail

Repository
rL LLVM

Event Timeline

Typz created this revision.Apr 25 2017, 1:14 AM
Typz updated this revision to Diff 96522.Apr 25 2017, 1:38 AM

Updated commit description

Typz retitled this revision from Allow customizing the penalty for breaking assignment to [clang-format] Allow customizing the penalty for breaking assignment.Apr 25 2017, 1:39 AM
Typz edited the summary of this revision. (Show Details)
Typz edited the summary of this revision. (Show Details)Apr 26 2017, 6:47 AM
djasper edited edge metadata.May 17 2017, 5:50 AM

Basically looks good, but please add a test case where the penalty is high show that it changes behavior.

Typz updated this revision to Diff 99415.May 18 2017, 2:33 AM

Add test to verify the option actually has some effect

Typz retitled this revision from [clang-format] Allow customizing the penalty for breaking assignment to clang-format: Allow customizing the penalty for breaking assignment.May 18 2017, 4:55 AM
djasper accepted this revision.May 18 2017, 11:59 PM
This revision is now accepted and ready to land.May 18 2017, 11:59 PM
This revision was automatically updated to reflect the committed changes.