[clang-tidy] Diagnose abseil-duration-comparison on macro arguments
authorHyrum Wright <hwright@google.com>
Wed, 19 Dec 2018 16:03:34 +0000 (16:03 +0000)
committerHyrum Wright <hwright@google.com>
Wed, 19 Dec 2018 16:03:34 +0000 (16:03 +0000)
commit06a8febe76cc72bb63af7e49967f7b839ee55141
tree4896f5cd36eb2f5f0eca7ff3b0b21749faa98ce6
parent0fdf5a9acccef8b5cf21a38bd5fd0496a285fbed
[clang-tidy] Diagnose abseil-duration-comparison on macro arguments

Summary:
This change relaxes the requirements on the utility
`rewriteExprFromNumberToDuration` function, and introduces new checking
inside of the `abseil-duration-comparison` check to allow macro argument
expression transformation.

Differential Revision: https://reviews.llvm.org/D55784

llvm-svn: 349636
clang-tools-extra/clang-tidy/abseil/DurationComparisonCheck.cpp
clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
clang-tools-extra/clang-tidy/abseil/DurationRewriter.h
clang-tools-extra/clang-tidy/abseil/DurationSubtractionCheck.cpp
clang-tools-extra/test/clang-tidy/abseil-duration-comparison.cpp