[all-commits] [llvm/llvm-project] badb21: [clang] Optimize Lexer hot path to reduce compile ...

yronglin via All-commits all-commits at lists.llvm.org
Sun Feb 15 20:02:16 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: badb215d0364076c7790966f5033d6d81b6da7cd
      https://github.com/llvm/llvm-project/commit/badb215d0364076c7790966f5033d6d81b6da7cd
  Author: yronglin <yronglin777 at gmail.com>
  Date:   2026-02-16 (Mon, 16 Feb 2026)

  Changed paths:
    M clang/include/clang/Lex/Lexer.h
    M clang/include/clang/Lex/Preprocessor.h
    M clang/include/clang/Lex/Token.h
    M clang/lib/Lex/Lexer.cpp
    M clang/lib/Lex/PPDirectives.cpp
    M clang/lib/Lex/Preprocessor.cpp

  Log Message:
  -----------
  [clang] Optimize Lexer hot path to reduce compile time (#177153)

This patch fix this compile time regression that introduced in
https://github.com/llvm/llvm-project/pull/173789.
- Introduce a `TokenFlag::PhysicalStartOfLine` flag to replace
`IsAtPhysicalStartOfLine` in a brunch of `Lexer` member functions and
remove `ExportContextualKeywordInfo` struct.
- Handle `import`, `module` and `export` keyword in `HandleIdentifier`
instead of in a `Lexer` hot path.

---------

Signed-off-by: yronglin <yronglin777 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list