[clang] [clang-format][NFC] Clean up FormatTokenLexer (PR #203825)

Björn Schäpers via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 15 13:51:56 PDT 2026


================
@@ -1466,9 +1472,9 @@ FormatToken *FormatTokenLexer::getNextToken() {
         FormatTok->Tok.setKind(tok::kw_if);
       }
     } else if (FormatTok->is(tok::identifier)) {
-      if (MacroBlockBeginRegex.match(Text))
+      if (llvm::Regex(Style.MacroBlockBegin).match(Text))
----------------
HazardyKnusperkeks wrote:

I don't think we should recreate the same regex over and over again.

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


More information about the cfe-commits mailing list