Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
15,610 ms | x64 debian > MLIR.Examples/standalone::test.toy |
Event Timeline
clang/test/Lexer/update_consecutive_macro_crash.cpp | ||
---|---|---|
9 | More details about the issue :
|
clang/lib/Lex/TokenLexer.cpp | ||
---|---|---|
1022–1031 | You had refactored the previous version, was this the way it was handled before? Do we need to add more test to ensure that we don't have any other unintended issues? | |
1030 | I don't believe we include links to issues in comments but you should definitely add the information to the commit message and when folks look at the commit they can get the that context there. |
clang/lib/Lex/TokenLexer.cpp | ||
---|---|---|
1022–1031 |
Yeah, the previous implementation literally checked whether every token is from the same file id by calling getFileID.
I'd like to add more, but it is hard to foresee all invalid cases (clang has different error-recovery strategies that might have different side effects). | |
1030 | I'm happy to remove it. But is there any guideline discouraging this practise? I have already seen this pattern in LLVM project. I think this is based on the author's judgement (IMO, it seems better to keep it for this case). |
clang/lib/Lex/TokenLexer.cpp | ||
---|---|---|
1028 | Naively, it seems like if recovery tokens could lead us to read one-past-the-end, it could also cause us to read two-past-the-end in which case this check would fail. We're relying on this never happening, so I think the comment should refer more specifically to the tokens that get inserted. Maybe "recovery only ever inserts a single token past the end of the FileID, specifically the ) when a macro-arg containing a comma should be guarded by parentheses"? | |
1030 | I see 50+ refs to github issues, 70+ links to bugs.llvm.org, 1K+ references to PRNNNNN. | |
clang/test/Lexer/update_consecutive_macro_crash.cpp | ||
9 | can you add these as comments to the test? |
Naively, it seems like if recovery tokens could lead us to read one-past-the-end, it could also cause us to read two-past-the-end in which case this check would fail.
We're relying on this never happening, so I think the comment should refer more specifically to the tokens that get inserted.
Maybe "recovery only ever inserts a single token past the end of the FileID, specifically the ) when a macro-arg containing a comma should be guarded by parentheses"?