[PATCH] D137960: [Lexer] Speedup LexTokenInternal

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 06:03:23 PST 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Lex/Lexer.cpp:3522
-  Result.clearFlag(Token::NeedsCleaning);
-  Result.setIdentifierInfo(nullptr);
 
----------------
Was this setting the identifier info to nullptr as a shorthand to clear *any* token data that was previously built up (basically, a cheaper call to `startToken()`)? Should we be asserting that `Token::PtrData` is `nullptr`?


================
Comment at: clang/lib/Lex/Lexer.cpp:4142-4144
+      if (CurPtr[1] == '|' && HandleEndOfConflictMarker(CurPtr - 1)) {
         goto LexNextToken;
+      }
----------------
Unrelated formatting changes?


================
Comment at: clang/lib/Lex/Lexer.cpp:4172-4174
+      if (CurPtr[1] == '=' && HandleEndOfConflictMarker(CurPtr - 1)) {
         goto LexNextToken;
+      }
----------------
Unrelated formatting changes?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137960/new/

https://reviews.llvm.org/D137960



More information about the cfe-commits mailing list