This is an analog of the abseil-duration-comparison check, but for the absl::Time domain. It has a similar implementation and tests.
DurationComparisonCheck.cpp has a very similar matcher pattern.
Maybe pull out a common matcher for this? E.g. comparisonOperatorWithCallee(...)?
Move this comment closer the replacement logic below?
nit: double negation is a bit hard to read. maybe !(isNotInMacro(LSH) && isNotInMacro(RHS))? Ideally, the helper should be isInMacro instead of isNotInMacro.
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?
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").