[clang] [clang] Optimize Lexer hot path to reduce compile time (PR #177153)

via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 15 17:11:55 PST 2026


================
@@ -4539,6 +4518,9 @@ bool Lexer::LexTokenInternal(Token &Result, bool TokAtPhysicalStartOfLine) {
   return true;
 
 HandleDirective:
+  // We parsed a # character and it's the start of a preprocessing directive.
+
+  FormTokenWithChars(Result, CurPtr, tok::hash);
----------------
yronglin wrote:

Fixed

https://github.com/llvm/llvm-project/pull/177153


More information about the cfe-commits mailing list