[clang] Perf/lexer faster slow get char and size (PR #70543)

via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 28 14:29:33 PDT 2023


================
@@ -565,10 +565,9 @@ Scanner::cleanStringIfNeeded(const dependency_directives_scan::Token &Tok) {
   const char *BufPtr = Input.begin() + Tok.Offset;
   const char *AfterIdent = Input.begin() + Tok.getEnd();
   while (BufPtr < AfterIdent) {
-    unsigned Size;
-    Spelling[SpellingLength++] =
-        Lexer::getCharAndSizeNoWarn(BufPtr, Size, LangOpts);
-    BufPtr += Size;
+    auto CharAndSize = Lexer::getCharAndSizeNoWarn(BufPtr, LangOpts);
----------------
cor3ntin wrote:

Structured binding here?

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


More information about the cfe-commits mailing list