ioeric accepted this revision.
ioeric added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tidy/abseil/TimeComparisonCheck.cpp:23
+  auto Matcher =
+      binaryOperator(anyOf(hasOperatorName(">"), hasOperatorName(">="),
+                           hasOperatorName("=="), hasOperatorName("<="),
----------------
hwright wrote:
> ioeric wrote:
> > `DurationComparisonCheck.cpp` has a very similar matcher pattern.
> > 
> > Maybe pull out a common matcher for this? E.g. 
> > `comparisonOperatorWithCallee(...)`?
> > 
> My one concern about doing so is that it would move the name bindings into a 
> separate location away from the callback consuming those bindings.
> 
> Since this is only the second instance of this pattern, would it be 
> reasonable to wait until there's a third to combine them?
> My one concern about doing so is that it would move the name bindings into a 
> separate location away from the callback consuming those bindings.
I think the name binding can stay in the same file. 
`comparisonOperatorWithCallee` is a matcher for a FunctionDecl, so, on the call 
site, you could do 
`comparisonOperatorWithCallee(functionDecl(TimeConversionFunction()).bind("function_decl")).bind("binop")`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58977/new/

https://reviews.llvm.org/D58977



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to