[clang] Reapply "[C++20][Modules] Implement P1857R3 Modules Dependency Discovery" (#173130)" (PR #173789)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 19 11:46:17 PST 2026
================
@@ -4019,11 +4030,23 @@ bool Lexer::LexTokenInternal(Token &Result, bool TokAtPhysicalStartOfLine) {
case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
case 'o': case 'p': case 'q': case 'r': case 's': case 't': /*'u'*/
case 'v': case 'w': case 'x': case 'y': case 'z':
- case '_':
+ case '_': {
// Notify MIOpt that we read a non-whitespace/non-comment token.
MIOpt.ReadToken();
- return LexIdentifierContinue(Result, CurPtr);
+ // LexIdentifierContinue may trigger HandleEndOfFile which would
+ // normally destroy this Lexer. However, the Preprocessor now defers
+ // lexer destruction until the Lex call stack unwinds (LexLevel == 0),
----------------
cor3ntin wrote:
```suggestion
// lexer destruction until the stack of Lexer unwinds (LexLevel == 0),
```
https://github.com/llvm/llvm-project/pull/173789
More information about the cfe-commits
mailing list