[Lexer] Speedup LexTokenInternal
authorserge-sans-paille <sguelton@mozilla.com>
Wed, 9 Nov 2022 22:13:51 +0000 (23:13 +0100)
committerserge-sans-paille <sguelton@mozilla.com>
Wed, 16 Nov 2022 14:57:32 +0000 (15:57 +0100)
commitcb3f8d53e6c35e6538ccbb54fdd848de2b3d0d1e
tree90a064529c5316ebb5eb000510ad79be1cc9cdec
parent462e4616662799761f3d716564a710320f815afd
[Lexer] Speedup LexTokenInternal

Only reset "NeedsCleaning" flag in case of re-entrant call.
Do not needlessly blank IdentifierInfo. This information will be set
once the token type is picked.

This yields a nice 1% speedup when pre-processing sqlite amalgamation
through:

valgrind --tool=callgrind ./bin/clang -E sqlite3.c -o/dev/null

Differential Revision: https://reviews.llvm.org/D137960
clang/include/clang/Lex/Token.h
clang/lib/Lex/Lexer.cpp