This revision was automatically updated to reflect the committed changes.
Closed by commit rL310539: clang-format: Fix bug with ENAS_DontAlign and empty
lines (authored by jtbandes).
Repository:
rL LLVM
https://reviews.llvm.org/D36019
Files:
cfe/trunk/lib/Format/WhitespaceManager.cpp
cfe/
jtbandes added a comment.
Thanks. Can you commit this when you get a chance? I don't have permissions.
https://reviews.llvm.org/D36019
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Thanks you.
Comment at: lib/Format/WhitespaceManager.cpp:650
+for (unsigned i = 0; i < Newlines; ++i)
+ Text.append(UseCRLF ? " \\\r\n" : " \\\n");
+return;
--
jtbandes added inline comments.
Comment at: lib/Format/WhitespaceManager.cpp:650
+for (unsigned i = 0; i < Newlines; ++i)
+ Text.append(UseCRLF ? " \\\r\n" : " \\\n");
+return;
djasper wrote:
> Note that when you have an empty line, this would turn i
jtbandes updated this revision to Diff 109898.
jtbandes added a comment.
@djasper ok, done
https://reviews.llvm.org/D36019
Files:
lib/Format/WhitespaceManager.cpp
lib/Format/WhitespaceManager.h
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTest.cpp
==
djasper added inline comments.
Comment at: lib/Format/WhitespaceManager.cpp:650
+for (unsigned i = 0; i < Newlines; ++i)
+ Text.append(UseCRLF ? " \\\r\n" : " \\\n");
+return;
Note that when you have an empty line, this would turn into:
#define A
jtbandes added a comment.
@djasper Bump :)
https://reviews.llvm.org/D36019
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jtbandes updated this revision to Diff 108863.
jtbandes added a comment.
- Undo change in argument list
https://reviews.llvm.org/D36019
Files:
lib/Format/WhitespaceManager.cpp
lib/Format/WhitespaceManager.h
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTest.cpp
=
jtbandes updated this revision to Diff 108860.
jtbandes added a comment.
Okay, I think this approach is better:
- Rename the version of `appendNewlineText` used for escaped newlines to
`appendEscapedNewlineText` to reduce confusability.
- If `ENAS_DontAlign`, skip all of the offset calculation l
jtbandes added a comment.
I can add some clarity but I can't claim to fully understand the whole program
flow here yet, so my explanation is probably insufficient.
The overflow (underflow? but I think that means something specific to FP) is on
line formerly-650: `EscapedNewlineColumn - Offset -
djasper added a comment.
Could you explain this in more detail? Which subtraction is underflowing? Why
can't we just add a ternary expression there to handle the case?
https://reviews.llvm.org/D36019
___
cfe-commits mailing list
cfe-commits@lists.l
jtbandes created this revision.
Herald added a subscriber: klimek.
This fixes a bug in `ENAS_DontAlign` (introduced in
https://reviews.llvm.org/D32733) where blank lines had an EscapedNewlineColumn
of 0, causing a subtraction to overflow when converted back to `unsigned` and
leading to runaway
12 matches
Mail list logo