summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] NFC: Negate the name and semantics of the isNotInMacro function.Hyrum Wright2019-03-081-3/+3
| | | | | | | This function is always used in a context where its result was also negated, which made for confusing naming and code. llvm-svn: 355702
* [clang-tidy] Add the abseil-time-subtraction checkHyrum Wright2019-02-271-0/+52
| | | | | | Differential Revision: https://reviews.llvm.org/D58137 llvm-svn: 355024
* [clang-tidy] Rename time lookup functions; NFCHyrum Wright2019-02-021-1/+1
| | | | llvm-svn: 352964
* [clang-tidy] Add the abseil-duration-addition checkHyrum Wright2019-01-281-0/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D57185 llvm-svn: 352362
* [clang-tidy] Rename the absl duration helper functions; NFCHyrum Wright2019-01-241-5/+5
| | | | llvm-svn: 352088
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] Move the macro helper function to a common location; NFCHyrum Wright2019-01-161-0/+17
| | | | | | This is useful for multiple checks. llvm-svn: 351348
* [clang-tidy] Use the public hasInit matcher, rather than defining our own, NFCHyrum Wright2019-01-071-21/+7
| | | | llvm-svn: 350526
* [clang-tidy] Export the abseil duration inverse lookup function, NFCHyrum Wright2018-12-281-2/+1
| | | | | | This allows other tools to use this function. llvm-svn: 350133
* [clang-tidy] Be more liberal about literal zeroes in abseil checksHyrum Wright2018-12-211-6/+36
| | | | | | | | | Summary: Previously, we'd only match on literal floating or integral zeroes, but I've now also learned that some users spell that value as int{0} or float{0}, which also need to be matched. Differential Revision: https://reviews.llvm.org/D56012 llvm-svn: 349953
* [clang-tidy] Diagnose abseil-duration-comparison on macro argumentsHyrum Wright2018-12-191-4/+1
| | | | | | | | | | | | 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-tidy] Add the abseil-duration-subtraction checkHyrum Wright2018-12-131-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [clang-tidy] Recommit: Add the abseil-duration-comparison checkJonas Toth2018-12-031-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This check finds instances where Duration values are being converted to a numeric value in a comparison expression, and suggests that the conversion happen on the other side of the expression to a Duration. See documentation for examples. This also shuffles some code around so that the new check may perform in sone step simplifications also caught by other checks. Compilation is unbroken, because the hash-function is now directly specified for std::unordered_map, as 'enum class' does not compile as key (seamingly only on some compilers). Patch by hwright. Reviewers: aaron.ballman, JonasToth, alexfh, hokein Reviewed By: JonasToth Subscribers: sammccall, Eugene.Zelenko, xazax.hun, cfe-commits, mgorny Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D54737 llvm-svn: 348169
* Revert "[clang-tidy] Add the abseil-duration-comparison check"Jonas Toth2018-12-031-109/+0
| | | | | | This commit broke buildbots and needs adjustments. llvm-svn: 348165
* [clang-tidy] Add the abseil-duration-comparison checkJonas Toth2018-12-031-0/+109
Summary: This check finds instances where Duration values are being converted to a numeric value in a comparison expression, and suggests that the conversion happen on the other side of the expression to a Duration. See documentation for examples. This also shuffles some code around so that the new check may perform in sone step simplifications also caught by other checks. Patch by hwright. Reviewers: aaron.ballman, JonasToth, alexfh, hokein Reviewed By: JonasToth Subscribers: sammccall, Eugene.Zelenko, xazax.hun, cfe-commits, mgorny Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D54737 llvm-svn: 348161
OpenPOWER on IntegriCloud