aaron.ballman added inline comments.
================
Comment at: clang-tidy/readability/OperatorsRepresentationCheck.cpp:34
+
+ if (const auto *B = Result.Nodes.getNodeAs<BinaryOperator>("binary")) {
+ switch (B->getOpcode()) {
----------------
alexfh wrote:
> aaron.ballman wrote:
> > I think this would make more sense lifted into an AST matcher -- there are
> > bound to be a *lot* of binary operators, so letting the matcher memoize
> > things is likely to give better performance.
> Any reasons not to do this on the lexer level?
Technical reasons? None.
User-experience reasons? We wouldn't want this to be on by default (I don't
think) and we usually don't implement off-by-default diagnostics in Clang. I
think a case could be made for doing it in the Lexer if the performance is
really that bad with a clang-tidy check and we couldn't improve it here, though.
https://reviews.llvm.org/D31308
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits