This patch makes the splits emitted for the beginning of comment lines during
reformatting absolute. Previously, they were relative to the start of the
non-whitespace content of the line, which messes up further TailOffset
calculations in breakProtrudingToken. This fixes an assertion failure reported
in bug 34236: https://bugs.llvm.org/show_bug.cgi?id=34236.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Format/BreakableToken.cpp | ||
---|---|---|
553 ↗ | (On Diff #111965) | I think a split cannot be "Trimmed". Maybe "Result" or "NewSplit"? |
557 ↗ | (On Diff #111965) | Why do you create a new split instead of: TrimmedSplit += Content[LineIndex].size() - TrimmedContent.size(); ? |
unittests/Format/FormatTestComments.cpp | ||
2785 ↗ | (On Diff #111965) | s/crusher/crasher/ :-D Also, I'd just remove " bug 34236", seems redundant. |