diff options
author | Hyrum Wright <hwright@google.com> | 2018-12-13 19:23:52 +0000 |
---|---|---|
committer | Hyrum Wright <hwright@google.com> | 2018-12-13 19:23:52 +0000 |
commit | 35cb7e9fe83852713c22f966a9856a4999bc2bd7 (patch) | |
tree | df8f04edc1694c0cc97dc73b9ba4201f570d49a2 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | c6bfb05762d1b2458ca6b6916be437ed83e156d1 (diff) | |
download | llvm-35cb7e9fe83852713c22f966a9856a4999bc2bd7.zip llvm-35cb7e9fe83852713c22f966a9856a4999bc2bd7.tar.gz llvm-35cb7e9fe83852713c22f966a9856a4999bc2bd7.tar.bz2 |
[clang-tidy] Add the abseil-duration-subtraction check
Summary:
This check uses the context of a subtraction expression as well as knowledge
about the Abseil Time types, to infer the type of the second operand of some
subtraction expressions in Duration conversions. For example:
absl::ToDoubleSeconds(duration) - foo
can become
absl::ToDoubleSeconds(duration - absl::Seconds(foo))
This ensures that time calculations are done in the proper domain, and also
makes it easier to further deduce the types of the second operands to these
expressions.
Reviewed By: JonasToth
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D55245
llvm-svn: 349073
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions