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

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 12 02:51:22 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);
----------------
cor3ntin wrote:

```suggestion
  // We parsed a # character which is the start of a preprocessing directive.
```

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


More information about the cfe-commits mailing list