[clang] [Clang] [NFC] Introduce factory functions for `Token` (PR #229254)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 07:51:42 PDT 2026


================
@@ -192,6 +192,34 @@ class Token {
     Loc = SourceLocation().getRawEncoding();
   }
 
+  static Token Create(tok::TokenKind Kind, SourceLocation Loc,
----------------
AaronBallman wrote:

I'm confused -- we have a definitive decision described in https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly and every function in this file follow the convention correctly except for these newly introduced ones. I understand that other factory patterns use `Create*` (like for AST node creation) and so I get why there's an inclination to follow that, but my preference would be to follow the coding standard.

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


More information about the cfe-commits mailing list