This revision was automatically updated to reflect the committed changes.
Closed by commit rG3860b2a0bd09: [clang-tidy] Update Abseil Duration Conversion
check to find more cases. (authored by hwright).
Changed prior to commit:
https://reviews.llvm.org/D75558?vs=247988&id=250252#toc
Repository
hwright created this revision.
hwright added reviewers: aaron.ballman, ymandel.
Herald added subscribers: cfe-commits, xazax.hun.
Herald added a project: clang.
This check now handles cases where there's a scalar multiplication happening
between the two conversions.
Repository:
rG LLVM Github
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE356141: [clang-tidy] Add additional patterns to the
abseil-duration-unnecessary… (authored by hwright, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D59183?vs=190456&id=190613#toc
hwright added inline comments.
Comment at: test/clang-tidy/abseil-duration-unnecessary-conversion.cpp:48
+ d2 = absl::Hours(d1 / absl::Hours(1));
+ // CHECK-MESSAGES: [[@LINE-1]]:8: warning: remove unnecessary absl::Duration
conversions [abseil-duration-unnecessary-conversio
hwright updated this revision to Diff 190456.
hwright marked 4 inline comments as done.
hwright added a comment.
Addressed reviewer comments
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59183/new/
https://reviews.llvm.org/D59183
Files:
clang-tidy/abseil/DurationUnnecessaryConversion
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE355835: [clang-tidy] Add the abseil-time-compare check
(authored by hwright, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D58977?vs=190075&id=190113#toc
Repository:
rCTE Clang
hwright updated this revision to Diff 190075.
hwright marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58977/new/
https://reviews.llvm.org/D58977
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duration
hwright created this revision.
hwright added a reviewer: hokein.
Herald added subscribers: cfe-commits, xazax.hun.
Herald added a project: clang.
This adds coverage for expressions of these forms
absl::Duration d2, d1;
d2 = absl::Seconds(d1 / absl::Seconds(1));
d2 = absl::Seconds(absl::FDiv
hwright updated this revision to Diff 189862.
hwright marked 6 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58977/new/
https://reviews.llvm.org/D58977
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/TimeComp
hwright added inline comments.
Comment at: clang-tidy/abseil/TimeComparisonCheck.cpp:23
+ auto Matcher =
+ binaryOperator(anyOf(hasOperatorName(">"), hasOperatorName(">="),
+ hasOperatorName("=="), hasOperatorName("<="),
ioeric wro
hwright created this revision.
hwright added reviewers: hokein, ioeric.
Herald added subscribers: cfe-commits, jdoerfert, xazax.hun, mgorny.
Herald added a project: clang.
This is an analog of the `abseil-duration-comparison` check, but for the
`absl::Time` domain. It has a similar implementatio
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE355024: [clang-tidy] Add the abseil-time-subtraction check
(authored by hwright, committed by ).
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58137/new/
h
hwright marked an inline comment as done.
hwright added inline comments.
Comment at: clang-tidy/abseil/TimeSubtractionCheck.cpp:97
+void TimeSubtractionCheck::check(const MatchFinder::MatchResult &Result) {
+ const auto *BinOp = Result.Nodes.getNodeAs("binop");
+ std::string in
hwright updated this revision to Diff 188372.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58137/new/
https://reviews.llvm.org/D58137
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/DurationRewriter.cpp
clang-tidy/abseil/DurationR
hwright added inline comments.
Comment at: clang-tidy/abseil/TimeSubtractionCheck.cpp:97
+void TimeSubtractionCheck::check(const MatchFinder::MatchResult &Result) {
+ const auto *BinOp = Result.Nodes.getNodeAs("binop");
+ std::string inverse_name =
JonasToth wr
hwright updated this revision to Diff 188289.
hwright marked 5 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58137/new/
https://reviews.llvm.org/D58137
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duration
hwright added inline comments.
Comment at: clang-tidy/abseil/TimeSubtractionCheck.cpp:97
+void TimeSubtractionCheck::check(const MatchFinder::MatchResult &Result) {
+ const auto *BinOp = Result.Nodes.getNodeAs("binop");
+ std::string inverse_name =
JonasToth wr
hwright updated this revision to Diff 187967.
hwright marked 15 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58137/new/
https://reviews.llvm.org/D58137
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duratio
hwright updated this revision to Diff 186569.
hwright marked 3 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58137/new/
https://reviews.llvm.org/D58137
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duration
hwright created this revision.
hwright added reviewers: ioeric, hokein, JonasToth, aaron.ballman.
hwright added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, jdoerfert, xazax.hun, mgorny.
Herald added a project: clang.
Repository:
rCTE Clang Tools Extra
https://reviews.ll
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE353079: [clang-tidy] Add the
abseil-duration-unnecessary-conversion check (authored by hwright, committed by
).
Herald added a project: clang.
Changed prior to commit:
https://reviews.llvm.org/D57353
hwright added a comment.
@hokein Thanks for the suggestion on the name, I was looking for something a
little less confusing.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57353/new/
https://reviews.llvm.org/D57353
___
cfe-commits mailing l
hwright updated this revision to Diff 185057.
hwright marked 4 inline comments as done.
hwright retitled this revision from "[clang-tidy] Add the
abseil-duration-double-conversion check" to "[clang-tidy] Add the
abseil-duration-unnecessary-conversion check".
hwright added a comment.
Renamed to `
hwright marked 2 inline comments as done.
hwright added inline comments.
Comment at: docs/clang-tidy/checks/abseil-duration-double-conversion.rst:20
+
+
+ // Original - Conversion to integer and back again
MyDeveloperDay wrote:
> hwright wrote:
> > Eugene.Zelenk
hwright added inline comments.
Comment at: docs/clang-tidy/checks/abseil-duration-double-conversion.rst:28
+
+Note: Converting to an integer and back to an `absl::Duration` might be a
+truncating operation if the value is not aligned to the scale of conversion.
E
hwright updated this revision to Diff 184146.
hwright marked 2 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57353/new/
https://reviews.llvm.org/D57353
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duration
hwright added inline comments.
Comment at: docs/clang-tidy/checks/abseil-duration-double-conversion.rst:20
+
+
+ // Original - Conversion to integer and back again
Eugene.Zelenko wrote:
> Unnecessary empty line.
This is consistent with other documentation in thi
hwright updated this revision to Diff 184143.
hwright marked 5 inline comments as done.
hwright added a comment.
Address reviewer comments.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57353/new/
https://reviews.llvm.org/D57353
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-t
hwright created this revision.
hwright added reviewers: hokein, JonasToth, aaron.ballman.
hwright added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D57353
Files:
clang-tidy/abseil/AbseilTi
This revision was automatically updated to reflect the committed changes.
Closed by commit rL352362: [clang-tidy] Add the abseil-duration-addition check
(authored by hwright, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D57185?vs=183
hwright updated this revision to Diff 183583.
hwright marked an inline comment as done.
hwright added a comment.
Add another test
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57185/new/
https://reviews.llvm.org/D57185
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil
hwright marked 2 inline comments as done.
hwright added inline comments.
Comment at: test/clang-tidy/abseil-duration-addition.cpp:84
+#undef PLUS_FIVE
+}
JonasToth wrote:
> a view template test-cases would be good to have.
I'm not sure I know that terminology; do
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationAdditionCheck.cpp:22
+void DurationAdditionCheck::registerMatchers(MatchFinder *Finder) {
+ Finder->addMatcher(
+ binaryOperator(hasOperatorName("+"),
JonasToth wrote:
> This whole file is
hwright updated this revision to Diff 183539.
hwright marked 11 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57185/new/
https://reviews.llvm.org/D57185
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duratio
hwright updated this revision to Diff 183531.
hwright added a comment.
Sort release notes
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57185/new/
https://reviews.llvm.org/D57185
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Dura
hwright created this revision.
hwright added reviewers: hokein, aaron.ballman, JonasToth.
hwright added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.
This is an analog to the existing `abseil-duration-subtraction` check.
Repository:
rCTE Clang Tools Ex
This revision was automatically updated to reflect the committed changes.
Closed by commit rL351473: [clang-tidy] Add abseil-duration-conversion-cast
check (authored by hwright, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D56532?vs=
hwright updated this revision to Diff 182043.
hwright marked 6 inline comments as done.
hwright added a comment.
Address reviewer comments
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56532/new/
https://reviews.llvm.org/D56532
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-ti
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationComparisonCheck.cpp:47-48
// if nothing needs to be done.
- if (!IsValidMacro(Result, Binop->getLHS()) ||
- !IsValidMacro(Result, Binop->getRHS()))
+ if (!isNotInMacro(Result, Binop->getLHS()) ||
+
hwright added a comment.
Ping.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56532/new/
https://reviews.llvm.org/D56532
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hwright updated this revision to Diff 181204.
hwright marked an inline comment as done.
hwright added a comment.
Run `clang-format`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56532/new/
https://reviews.llvm.org/D56532
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abse
hwright updated this revision to Diff 181125.
hwright marked 5 inline comments as done.
hwright added a comment.
Update documentation line wrapping.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56532/new/
https://reviews.llvm.org/D56532
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
hwright added inline comments.
Comment at: docs/clang-tidy/checks/abseil-duration-conversion-cast.rst:20
+
+
+ // Original - Cast from a double to an integer
MyDeveloperDay wrote:
> nit: double blank line
This is intentional (and consistent with other examples i
hwright created this revision.
hwright added reviewers: hokein, aaron.ballman.
hwright added a project: clang-tools-extra.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.
This suggests simplifying expressions which are casting conversion functions,
such as `static_cast(absl::ToDoubleSec
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350523: [clang] Add AST matcher for initializer list members
(authored by hwright, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D56090?vs=18
hwright marked 4 inline comments as done.
hwright added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:3527
+ return N < Node.getNumInits() &&
+ InnerMatcher.matches(*Node.getInit(N)->IgnoreParenImpCasts(), Finder,
+ B
hwright updated this revision to Diff 180248.
hwright added a comment.
Removed `IgnoreParenImpCasts` call.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56090/new/
https://reviews.llvm.org/D56090
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
lib
hwright added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:3527
+ return N < Node.getNumInits() &&
+ InnerMatcher.matches(*Node.getInit(N)->IgnoreParenImpCasts(), Finder,
+ Builder);
aaron.ballman wr
hwright updated this revision to Diff 180089.
hwright marked an inline comment as done.
hwright added a comment.
Added tests, update docs.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56090/new/
https://reviews.llvm.org/D56090
Files:
docs/LibASTMatchersReference.html
include/clang
hwright added a comment.
@lebedev.ri Where do the appropriate tests live? (I couldn't find an obvious
subdirectory in `test/`)
Where are the instructions for regenerating the documentation?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56090/new/
https://review
hwright created this revision.
hwright added a reviewer: aaron.ballman.
hwright added a project: clang.
Herald added a subscriber: cfe-commits.
Much like `hasArg` for various call expressions, this allows `LibTooling` users
to match against a member of an initializer list.
This is currently bein
This revision was automatically updated to reflect the committed changes.
Closed by commit rL349953: [clang-tidy] Be more liberal about literal zeroes in
abseil checks (authored by hwright, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.or
hwright added a comment.
btw, I think `hasInit` should probably be moved into the core set of matchers
at some point.
Comment at: clang-tidy/abseil/DurationRewriter.cpp:110
+ ast_matchers::internal::Matcher, InnerMatcher) {
+ return (N < Node.getNumInits() &&
+
hwright updated this revision to Diff 179335.
hwright marked 6 inline comments as done.
hwright added a comment.
Add documentation, adjust test.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56012/new/
https://reviews.llvm.org/D56012
Files:
clang-tidy/abseil/DurationFactoryScaleCheck
hwright created this revision.
hwright added reviewers: aaron.ballman, JonasToth, alexfh, hokein.
hwright added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.
Previously, we'd only match on literal floating or integral zeroes, but I've
now also learned that some users spell
This revision was automatically updated to reflect the committed changes.
hwright marked an inline comment as done.
Closed by commit rL349636: [clang-tidy] Diagnose abseil-duration-comparison on
macro arguments (authored by hwright, committed by ).
Herald added a subscriber: llvm-commits.
Changed
hwright marked 2 inline comments as done.
hwright added inline comments.
Comment at: test/clang-tidy/abseil-duration-comparison.cpp:146
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e, type) (v ? VALUE_IF_2(absl::To##type##Seconds(e)) : 0)
+ int a3 = VALUE_IF(1, d1, Double);
-
hwright added a comment.
@aaron.ballman I am both grateful and sad that I don't possess the same macro
creativity as you do. :)
(I'm also sad that the various clang APIs aren't as well documented as I hoped.
The current solution works well, but it took a while and a bit of consultation
with s
hwright updated this revision to Diff 178733.
hwright marked 3 inline comments as done.
hwright added a comment.
Another test.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55784/new/
https://reviews.llvm.org/D55784
Files:
clang-tidy/abseil/DurationComparisonCheck.cpp
clang-tidy/ab
hwright added inline comments.
Comment at: test/clang-tidy/abseil-duration-comparison.cpp:131
+ // We should still transform the expression inside this macro invocation
+#define VALUE_IF(v, e) v ? (e) : 0
+ int a = VALUE_IF(1, 5 > absl::ToDoubleSeconds(d1));
aa
hwright updated this revision to Diff 178680.
hwright marked 4 inline comments as done.
hwright added a comment.
Update tests
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55784/new/
https://reviews.llvm.org/D55784
Files:
clang-tidy/abseil/DurationComparisonCheck.cpp
clang-tidy/abs
This revision was automatically updated to reflect the committed changes.
Closed by commit rL349073: [clang-tidy] Add the abseil-duration-subtraction
check (authored by hwright, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D55245?vs=
hwright added a comment.
Thanks for reviewing, I'll go ahead and commit.
I've also removed the hash specialization, since we moved to `llvm::IndexedMap`
instead of `std::unordered_map` inside of `getInverseForScale`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://rev
hwright marked an inline comment as done.
hwright added a comment.
I've updated the documentation, and the rebased to `master`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
___
cfe-commits mailing
hwright updated this revision to Diff 178039.
hwright marked an inline comment as done.
hwright added a comment.
Rebase and update documentation
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
cl
hwright marked 2 inline comments as done.
hwright added inline comments.
Comment at: test/clang-tidy/abseil-duration-subtraction.cpp:12
+ // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(1))
+ x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(d1);
+ // CHECK-MESSAGES
hwright updated this revision to Diff 177749.
hwright marked 6 inline comments as done.
hwright added a comment.
Rebase
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeList
hwright added inline comments.
Comment at: test/clang-tidy/abseil-duration-subtraction.cpp:12
+ // CHECK-FIXES: absl::ToDoubleSeconds(d - absl::Seconds(1))
+ x = absl::ToDoubleSeconds(d) - absl::ToDoubleSeconds(d1);
+ // CHECK-MESSAGES: [[@LINE-1]]:7: warning: perform subtract
hwright updated this revision to Diff 177590.
hwright marked 9 inline comments as done.
hwright added a comment.
Add tests
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeL
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationRewriter.cpp:21
+struct DurationScale2IndexFunctor {
+ using argument_type = DurationScale;
+ unsigned operator()(DurationScale Scale) const {
JonasToth wrote:
> Are you using `argument_type`?
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationRewriter.cpp:20-39
+struct DurationScale2IndexFunctor {
+ using argument_type = DurationScale;
+ unsigned operator()(DurationScale Scale) const {
+switch (Scale) {
+case DurationScale::Hours:
+ re
hwright updated this revision to Diff 177509.
hwright marked 5 inline comments as done.
hwright added a comment.
Use `static_cast` instead of a `switch` for `IndexedMap` lookup.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy
hwright added a comment.
Reminder: I'll need somebody to submit this for me, since I don't have
subversion access.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
___
cfe-commits mailing list
cfe-co
hwright updated this revision to Diff 177325.
hwright marked 7 inline comments as done.
hwright added a comment.
Use an `IndexedMap` instead of an `std::unordered_map`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy/abseil/Ab
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationRewriter.cpp:35
+getInverseForScale(DurationScale Scale) {
+ static const std::unordered_map>
lebedev.ri wrote:
> hwright wrote:
> > lebedev.ri wrote:
> > > https://llvm.org/docs/ProgrammersMan
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationRewriter.cpp:35
+getInverseForScale(DurationScale Scale) {
+ static const std::unordered_map>
lebedev.ri wrote:
> https://llvm.org/docs/ProgrammersManual.html#other-map-like-container-options
>
hwright updated this revision to Diff 177266.
hwright marked 8 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duration
hwright added a comment.
Ping.
I assume I've got the right reviewers here, but I've also been sending a bunch
of stuff your way lately, so if I'm overwhelming review capacity, please let me
know.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
hwright updated this revision to Diff 176757.
hwright marked an inline comment as done.
hwright added a comment.
Fix double space.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55245/new/
https://reviews.llvm.org/D55245
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/absei
hwright added a comment.
Oh, and thanks for taking the time to review this. :)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llv
hwright added a comment.
@JonasToth reminder that you (or somebody else) will need to commit this for me.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
___
cfe-commits mailing list
cfe-commits@list
hwright updated this revision to Diff 176156.
hwright marked 2 inline comments as done.
hwright added a comment.
Add additional test
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abs
hwright updated this revision to Diff 176103.
hwright added a comment.
Slightly simplify the fixit text
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-ti
hwright marked an inline comment as done.
hwright added a comment.
Ping.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/
hwright marked 4 inline comments as done.
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:61
+
+ if (SimpleArg) {
diag(MatchedCall->getBeginLoc(),
JonasToth wrote:
> hwright wrote:
> > JonasToth wrote:
> > > hwrigh
hwright marked 4 inline comments as done.
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationDivisionCheck.h:23
// http://clang.llvm.org/extra/clang-tidy/checks/abseil-duration-division.html
class DurationDivisionCheck : public ClangTidyCheck {
-
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationComparisonCheck.cpp:69
+ // We know our map contains all the Scale values, so we can skip the
+ // nonexistence check.
+ auto InverseIter = InverseMap.find(Scale);
JonasToth wrote:
> non-exis
hwright updated this revision to Diff 175735.
hwright marked 13 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duratio
hwright marked 2 inline comments as done.
hwright added a comment.
Anything else for me here?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
hwright marked 12 inline comments as done.
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationComparisonCheck.cpp:25
+static llvm::Optional getScaleForInverse(llvm::StringRef Name) {
+ static const std::unordered_map ScaleMap(
+ {{"ToDoubleHours", Duration
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationComparisonCheck.cpp:25
+static llvm::Optional getScaleForInverse(llvm::StringRef Name) {
+ static const std::unordered_map ScaleMap(
+ {{"ToDoubleHours", DurationScale::Hours},
JonasToth w
hwright updated this revision to Diff 175476.
hwright marked 10 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duratio
hwright added a comment.
Sorry it's taken so long to get all the feedback addressed!
Comment at: clang-tidy/abseil/DurationComparisonCheck.cpp:25
+static llvm::Optional getScaleForInverse(llvm::StringRef Name) {
+ static const std::unordered_map ScaleMap(
+ {{"ToDoubleHou
hwright updated this revision to Diff 175379.
hwright marked 23 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54737/new/
https://reviews.llvm.org/D54737
Files:
clang-tidy/abseil/AbseilTidyModule.cpp
clang-tidy/abseil/CMakeLists.txt
clang-tidy/abseil/Duratio
hwright added a comment.
@aaron.ballman I don't actually have the commit bit, can you commit this, or
are we waiting for further review?
https://reviews.llvm.org/D54246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/c
hwright added a comment.
I think this is ready to go, please advise on next steps.
https://reviews.llvm.org/D54246
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hwright marked 5 inline comments as done.
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationFactoryScaleCheck.cpp:73
+ case DurationScale::Hours:
+if (Multiplier <= 1.0 / 60.0)
+ return std::make_tuple(DurationScale::Minutes, Multiplier * 60.0);
-
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationFactoryScaleCheck.cpp:57-58
+// One and only one of `IntLit` and `FloatLit` should be provided.
+static double GetValue(const IntegerLiteral *IntLit,
+ const FloatingLiteral *FloatLit) {
+
hwright updated this revision to Diff 174039.
hwright marked 11 inline comments as done.
hwright added a comment.
Combined multiplication and division logic, and also now handles scaling of
multiple steps (e.g., Seconds * 3600).
https://reviews.llvm.org/D54246
Files:
clang-tidy/abseil/Abseil
hwright added inline comments.
Comment at: clang-tidy/abseil/DurationFactoryScaleCheck.cpp:57-58
+// One and only one of `IntLit` and `FloatLit` should be provided.
+static double GetValue(const IntegerLiteral *IntLit,
+ const FloatingLiteral *FloatLit) {
+
1 - 100 of 120 matches
Mail list logo