As noted in https://reviews.llvm.org/D93459, the formatting of
multi-line descriptions of clEnumValN and the likes is unfavorable.
Thus this patch adds support for correctly indenting these.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Would be good to have a test entry for that new pretty printer . That would also make the review easier ;-)
Given the awful formatting in clang-format is merged in release/12.x, would be great to get this in, before 12.0.0 final.. :)
mhh... I'd just say the assert was wrong.
The BaseIndent is the maximum width of an option. e.g. --compilation-database=<string>.
printEnumValHelpStr does not deal with that part at all, only with the help string that comes after that (e.g. This is the first enum value\nwhich has a really long description\nthus it is multi-line.).
For nice formatting in the first line - and are prepended for the enum values in the first line and later BaseIndent + are used for the indent.
What the assert should have verified is only that BaseIndent >= FirstLineIndentedBy so that we can later have the indent: BaseIndent - FirstLineIndentedBy and be sure it's >=0.
(and that really should always be true..)
So I will just adapt the assert..
This is not reflected to MaxWidth.