This revision was automatically updated to reflect the committed changes.
Closed by commit rL310576: [Lexer] Finding beginning of token with escaped new
line (authored by alexfh).
Changed prior to commit:
https://reviews.llvm.org/D30748?vs=110029&id=110544#toc
Repository:
rL LLVM
https://re
idlecode added a comment.
I don't have commit rights yet so I would be grateful for help in this matter :)
Comment at: lib/Lex/Lexer.cpp:469-477
+if (!isVerticalWhitespace(LexStart[0]))
+ continue;
- const char *LexStart = StrData;
- while (LexStart != BufStart) {
idlecode updated this revision to Diff 110029.
idlecode added a comment.
Redability fix in `findBeginningOfLine`
https://reviews.llvm.org/D30748
Files:
include/clang/Lex/Lexer.h
lib/Lex/Lexer.cpp
unittests/Lex/LexerTest.cpp
Index: unittests/Lex/LexerTest.cpp
=
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.
Looks good with one nit.
Do you need someone to commit the patch for you after you address the comment?
Comment at: lib/Lex/Lexer.cpp:469-477
+if (!isVerticalWhitespace(
idlecode updated this revision to Diff 109748.
idlecode added a comment.
Applied clang-format
https://reviews.llvm.org/D30748
Files:
include/clang/Lex/Lexer.h
lib/Lex/Lexer.cpp
unittests/Lex/LexerTest.cpp
Index: unittests/Lex/LexerTest.cpp
idlecode updated this revision to Diff 109740.
idlecode marked an inline comment as done.
https://reviews.llvm.org/D30748
Files:
include/clang/Lex/Lexer.h
lib/Lex/Lexer.cpp
unittests/Lex/LexerTest.cpp
Index: unittests/Lex/LexerTest.cpp
==
idlecode marked 3 inline comments as done.
idlecode added inline comments.
Comment at: lib/Lex/Lexer.cpp:460
+/// \brief Check if new line pointed by Str is escaped.
+bool isNewLineEscaped(const char *BufferStart, const char *Str) {
+ assert(isVerticalWhitespace(Str[0]));
--
alexfh added a comment.
Sorry for the delay, I was on vacation.
This looks much better now, thanks! A few more comments though.
Comment at: lib/Lex/Lexer.cpp:460
+/// \brief Check if new line pointed by Str is escaped.
+bool isNewLineEscaped(const char *BufferStart, const char
idlecode updated this revision to Diff 102110.
idlecode added a comment.
Added tests for `isNewLineEscaped` - this fixed some corner cases
https://reviews.llvm.org/D30748
Files:
lib/Lex/Lexer.cpp
unittests/Lex/LexerTest.cpp
Index: unittests/Lex/LexerTest.cpp
===
alexfh added a comment.
In https://reviews.llvm.org/D30748#750626, @idlecode wrote:
> Oh, sorry about this - I forgot. I will send patch during this weekend
No worries, I just stumbled upon the bug and recalled that there had been a
patch to fix it.
https://reviews.llvm.org/D30748
___
idlecode added a comment.
Oh, sorry about this - I forgot. I will send patch during this weekend
https://reviews.llvm.org/D30748
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
alexfh added a comment.
Paweł, are you planning to finish this patch?
https://reviews.llvm.org/D30748
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.
Comment at: lib/Lex/Lexer.cpp:457
+static bool isNewLineEscaped(const char *BufferStart, const char *Str) {
+ while (Str > BufferStart && isWhitespace(*Str))
+
idlecode updated this revision to Diff 91466.
idlecode added a comment.
Addressed Alexander's comments
https://reviews.llvm.org/D30748
Files:
lib/Lex/Lexer.cpp
unittests/Lex/LexerTest.cpp
Index: unittests/Lex/LexerTest.cpp
===
idlecode marked 3 inline comments as done.
idlecode added inline comments.
Comment at: lib/Lex/Lexer.cpp:457
+static bool isNewLineEscaped(const char *BufferStart, const char *Str) {
+ while (Str > BufferStart && isWhitespace(*Str))
+--Str;
alexfh wrote:
> W
alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.
Comment at: lib/Lex/Lexer.cpp:457
+static bool isNewLineEscaped(const char *BufferStart, const char *Str) {
+ while (Str > BufferStart && isWhitespace(*Str))
+
idlecode created this revision.
Lexer::GetBeginningOfToken produced invalid location when
backtracking across escaped new lines.
This fixes PR26228
https://reviews.llvm.org/D30748
Files:
lib/Lex/Lexer.cpp
unittests/Lex/LexerTest.cpp
Index: unittests/Lex/LexerTest.cpp
17 matches
Mail list logo