[PATCH] D124500: [clang-tidy] Support expressions of literals in modernize-macro-to-enum
Richard via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 29 13:19:23 PDT 2022
LegalizeAdulthood marked 7 inline comments as done.
LegalizeAdulthood added inline comments.
Comment at: clang-tools-extra/clang-tidy/modernize/IntegralLiteralExpressionMatcher.h:18-20
+// Parses an array of tokens and returns true if they conform to the rules of
+// C++ for whole expressions involving integral literals. Follows the operator
+// precedence rules of C++.
> Oh boy, I'm not super excited about having another parser to maintain...
> It'd be nice if we had a ParserUtils.cpp/h file that made it easier to go from an arbitrary array of tokens to AST nodes + success/failure information on parsing the tokens. It's not strictly needed for what you're trying to accomplish here, but it would be a much more general interface and it would remove the support burden from adding another parser that's out of Clang's tree.
Yeah, I'm not a fan of duplication either, but see my earlier comments about why I think clangParse is overkill here.
CHANGES SINCE LAST ACTION
More information about the cfe-commits