[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 6 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:255 + std::string NodeTypeName = + Node->getType().getAsString(Node->getASTContext().getPrintingPolicy()); +

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 3 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:402-403 + +// Unfortunately, undersquiggly highlights are for some reason chewed up +// and not respected

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D69560#2536570 , @steveire wrote: > I haven't read through all the comments, but the word 'easily' implies > 'desirable'. This check seems to be for finding params which are undesirably > swappable, right? The `easily`

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp:10 + +void declaration(int Param, int Other); // NO-WARN: No chance to change this function. + aaron.ballman wrote: >

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity marked an inline comment as done. whisperity added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp:10 + +void declaration(int Param, int Other); // NO-WARN: No chance to change this function. +

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-easily-swappable-parameters-len2.cpp:10 + +void declaration(int Param, int Other); // NO-WARN: No chance to change this function. + aaron.ballman wrote: >

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:135 void sanitize() { -assert(Flags != MIX_Invalid && "sanitize() called on invalid bitvec"); -// TODO: There will be statements here in further

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:402-403 + +// Unfortunately, undersquiggly highlights are for some reason chewed up +// and not respected by diagnostics from Clang-Tidy. :( +

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-02-02 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. (Typing this in here so it is not forgotten.) @aaron.ballman suggested in http://reviews.llvm.org/D69560#inline-893813 that a case of argument and parameter swaps could be discovered between forward declarations and the definitions, i.e. void fn(int x, int y);

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353969. whisperity marked 8 inline comments as done. whisperity added a comment. All changes are **NFC** and styling only. - Remove the `FB` macro in favour of explicitly specifying the bit flag value - Change debug printout from bit pattern to individual

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353978. whisperity added a comment. **NFC**: Rebase & update. While this patch conceptually only depends on D69560 , the diff itself has become linear during the code review and subsequent updates, and as such, must be

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D69560#2747092 , @alexfh wrote: > BTW, any ideas why "patch application failed"? (See the Build status in the > Diff Detail section) I think I figured out why the pre-build CI isn't working... it seems that the fact that

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353972. whisperity added a comment. **NFC**: Rebase & update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95736/new/ https://reviews.llvm.org/D95736 Files:

[PATCH] D97297: [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353979. whisperity added a comment. **NFC**: Rebase & update. While this patch conceptually only depends on D69560 , the diff itself has become linear during the code review and subsequent updates, and as such, must be

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353975. whisperity marked 5 inline comments as done. whisperity added a comment. **NFC**. - Rebase and update for changes of base patch D69560 . - Remove the `<<=` and `%=` operators in favour of named functions. -

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353983. whisperity added a comment. (Try nudging the CI to only apply this commit after removal of parent links.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69560/new/ https://reviews.llvm.org/D69560

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 353974. whisperity added a comment. **NFC**: Rebase & update. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96355/new/ https://reviews.llvm.org/D96355 Files:

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-23 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 2 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:657-667 + // Certain kinds unfortunately need to be side-stepped for canonical type + // matching. + if

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354218. whisperity added a comment. **NC** Rebase & more buildbot shenanigans so we can get a pass! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78652/new/ https://reviews.llvm.org/D78652 Files:

[PATCH] D90399: [clang-tidy] non-portable-integer-constant check

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Herald added a subscriber: cfe-commits. Comment at: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp:38 #include "NoEscapeCheck.h" +#include "NonportableintegerconstantCheck.h" #include "NotNullTerminatedResultCheck.h"

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354210. whisperity added a comment. **NC** Rebase, buildbots, etc. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75041/new/ https://reviews.llvm.org/D75041 Files:

[PATCH] D97297: [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354229. whisperity added a comment. **NC** Rebase and buildbot trigger. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97297/new/ https://reviews.llvm.org/D97297 Files:

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354203. whisperity added a comment. **NC** Fix lint mishap that occurred during previous rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96355/new/ https://reviews.llvm.org/D96355 Files:

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-06-25 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354467. whisperity added a comment. **NFC** Rebase and fix things broken by D104819 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D20689/new/

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-25 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354478. whisperity marked 5 inline comments as done. whisperity added a comment. **NFC** Fix nits. Let's have one final run with the buildbots, just in case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75041/new/

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-25 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:249 + /// the conversion sequence. This method does **NOT** return Begin and End. + SmallVector getInvolvedTypesInSequence() const { +SmallVector Ret;

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-25 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D69560#2840554 , @aaron.ballman wrote: > This is a very involved check that I think is going to produce some > interesting results for users, thank you for working so diligently on it! I > think all of the patches in the

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-05-10 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D69560#2747092 , @alexfh wrote: > BTW, any ideas why "patch application failed"? (See the Build status in the > Diff Detail section) > > It would be really nice to get pre-merge checks to work for the patch. Put simply, I

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-03 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:657-667 + // Certain kinds unfortunately need to be side-stepped for canonical type + // matching. + if (LType->getAs() || RType->getAs()) { +//

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-03 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:657-667 + // Certain kinds unfortunately need to be side-stepped for canonical type + // matching. + if (LType->getAs() || RType->getAs()) { +//

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-03 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:122 #define FB(Name, K) MIX_##Name = (1ull << (K##ull - 1ull)) martong wrote: > FB stands for FunnyBitmask? Could you please either

[PATCH] D76287: [analysis][analyzer] Introduce the skeleton of a reaching definitions calculator

2021-06-03 Thread Whisperity via Phabricator via cfe-commits
whisperity resigned from this revision. whisperity added a comment. Herald added a subscriber: manas. What about this patch? I'm removing my reviewer bit just so it doesn't appear in my list anymore, but if there are any updates, I'll keep myself as a subscriber.  Repository: rG LLVM

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-03 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. There was a bit of talk on Twitter recently about strong typing which reminded me of this checker!  I'll fix all issues in one go once we're through with all the comments, I'd like to see the full picture of what needs to be done. Repository: rG LLVM Github

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-04 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 5 inline comments as done. whisperity added a comment. In D75041#2799023 , @martong wrote: > Perhaps all conversion related logic should go into their own implementation > file? Seems like it adds up to roughly 1000 lines. That's

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-05-31 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. Bump.  This is the last part that's still unreviewed and also the most complex. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75041/new/ https://reviews.llvm.org/D75041 ___

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354180. whisperity added a comment. (Uploaded the prerequisite, wrong patch here by accident.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75041/new/ https://reviews.llvm.org/D75041 Files:

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354166. whisperity added a comment. Attempt to fix build failure on Windows buildbot (`operator new` was taking `unsigned long` instead of `size_t` in a test which resulted in hard error). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354183. whisperity added a comment. **NFC** Fix lint. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95736/new/ https://reviews.llvm.org/D95736 Files:

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354192. whisperity added a comment. **NC!** Recreate diff to try and get the buildbots running... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96355/new/ https://reviews.llvm.org/D96355 Files:

[PATCH] D89649: Fix __has_unique_object_representations with no_unique_address

2021-06-24 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. //Gentle boop.// Bugzilla is offline for me right now (and rumour has it that it will be completely shut down in the near future), so it would be good to know what is the status of this patch and how it related to the mentioned (and //right now// unavailable) bug

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
whisperity marked an inline comment as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:694-695 + + for (std::size_t I = 0, E = CalleeFuncDecl->getNumParams(); I != E; ++I) { +if (const auto *Param

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354867. whisperity added a comment. **NFC** Fix `ReleaseNotes` entry getting out of place during rebases earlier. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D20689/new/ https://reviews.llvm.org/D20689

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 354856. whisperity marked 2 inline comments as done. whisperity added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. - Fix comments and code according to comments - Turned `Substring` into a case-insensitive heuristic. -

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe33d0478831e: [clang-tidy] Extend bugprone-easily-swappable-parameters with mixability… (authored by whisperity). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb9ece0346112: [clang-tidy] Suppress reports to similarly used parameters in bugprone-easily… (authored by whisperity). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG26d864b44b9d: [clang-tidy] Extend bugprone-easily-swappable-parameters with `typedef` and… (authored by whisperity). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG961e9e6af65e: [clang-tidy] Extend bugprone-easily-swappable-parameters with optionally… (authored by whisperity). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG499e39c5983d: [clang-tidy] Add bugprone-easily-swappable-parameters check (authored by whisperity). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69560/new/

[PATCH] D97297: [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0fba450b9756: [clang-tidy] Suppress reports to patternedly named parameters in bugprone… (authored by whisperity). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-06-28 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 12 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:408-409 + + bool IsParamContinuouslyConst = + !IsParamReference ||

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-06-29 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 2 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:113-120 +#define FB(Name, K) MIX_##Name = (1ull << (K##ull - 1ull)) + + FB(None, 1), //< Mix between the two

[PATCH] D92777: [clang-tidy] Add bugprone-strlen-in-array-index checker

2021-07-09 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. The tests are a bit slim. We definitely need more cases... what if the array isn't allocated locally, but received as a parameter? I take that we need both an `fgets` and a `strlen` call in the same function(?) to emit diagnostics. Are we sure it will work if the

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-04-22 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 339533. whisperity edited the summary of this revision. whisperity added a comment. - **NFC** Fix lint of header guard nomenclature - **NFC** Tear out obsolete `LLVM_DEBUG` calls from the implementation Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-04-22 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 339625. whisperity added a comment. **NFC** Fix the header guard name lint again, hopefully to the proper value this time. I forgot the `CHECK` out of it... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-08 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:177 + const std::size_t StartIndex) { + const std::size_t NumParams = FD->getNumParams(); + assert(StartIndex <

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D69560#2549959 , @steveire wrote: > Why "easily" instead of "suspicious", "spuriously" or any of the other words > that are already used? The name was @aaron.ballman's idea after we postponed the

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 322431. whisperity marked 6 inline comments as done. whisperity added a comment. Herald added a subscriber: nullptr.cpp. - **NFC** Code style, formatting, wording, etc. changes as per review comments. - **NFC** Removed a stale FIXME Repository: rG LLVM

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity created this revision. whisperity added reviewers: aaron.ballman, alexfh, hokein, njames93. whisperity added projects: clang, clang-tools-extra. Herald added subscribers: nullptr.cpp, rnkovacs, xazax.hun. whisperity requested review of this revision. Herald added a subscriber:

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 4 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:255 + std::string NodeTypeName = + Node->getType().getAsString(Node->getASTContext().getPrintingPolicy()); +

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 322339. whisperity added a comment. - Added a C test file with some C-specific language constructs that we may or may not match. - Explained limitations with regards to variadics, templates, etc. better in the docs, and added test cases for these too. -

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 322357. whisperity added a comment. Made detection of macros as "parameter type names" more robust. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69560/new/ https://reviews.llvm.org/D69560 Files:

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity marked an inline comment as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:255 + std::string NodeTypeName = + Node->getType().getAsString(Node->getASTContext().getPrintingPolicy()); +

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 322363. whisperity added a comment. **NFC** (With all the restructuring and trying to figure out how to implement the latest change, I managed to upload the wrong, unclean diff...) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-01-28 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 319840. whisperity marked 9 inline comments as done. whisperity added a comment. - NFC Code style and organisation fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69560/new/

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-01-28 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:284 +/// The default value for the MinimumLength check option. +static constexpr unsigned DefaultMinimumLength = 2; + aaron.ballman wrote: >

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:207 + + LLVM_DEBUG(QT.dump()); + Actually this is one of those debug prints that should be removed and remained in here by accident.

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not respecting and highlighting fed SourceRanges

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. @aaron.ballman Could you please help me understand this pre-merge buildbot? It says that Debian failed, with the following message: [15/1038] Running lint check for sanitizer sources... FAILED: projects/compiler-rt/lib/CMakeFiles/SanitizerLintCheck cd

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 12 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:657-660 +} else { + ParamTypes.push_back(QualType()); + ParamNames.push_back(StringRef()); +}

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 5 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:377 + + bool indicatesMixability() const { return Flags > MIX_None; } + aaron.ballman wrote: >

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331560. whisperity marked 2 inline comments as done. whisperity added a comment. - **NFC** Fixed some nits - Added a new check option, //`MinimumIdentifierNameLength`// instead of a hardcoded `3` value. Defaults to `3`. - Fixed an issue with heuristics

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331564. whisperity marked 4 inline comments as done. whisperity added a comment. **NFC** Turned some `Optional` into just `T`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78652/new/

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:529 +/// ReturnStmts return them from the function. +class Returned { + llvm::SmallVector ReturnedParams; aaron.ballman wrote: > whisperity

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity marked an inline comment as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:657-660 +} else { + ParamTypes.push_back(QualType()); + ParamNames.push_back(StringRef()); +}

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:31-32 + + char DissimilarBelow; + char SimilarAbove; + aaron.ballman wrote: > `signed char` since we're doing `> -1` below? Or better yet,

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331532. whisperity marked 3 inline comments as done. whisperity added a comment. **NFC** Made the code more legible, updated and clarified some comments, fixed grammar issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-18 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 8 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:51 +{true, 40, 50}, // Substring. +{true, 50, 66}, // Levenshtein. +{true, 75, 85}, //

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity marked 2 inline comments as done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:529 +/// ReturnStmts return them from the function. +class Returned { + llvm::SmallVector ReturnedParams;

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:529 +/// ReturnStmts return them from the function. +class Returned { + llvm::SmallVector ReturnedParams; whisperity wrote: > aaron.ballman

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331241. whisperity marked 6 inline comments as done. whisperity added a subscriber: Szelethus. whisperity added a comment. - Add `const reverse iterator` to the default-ignored typename list. CHANGES SINCE LAST ACTION

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331242. whisperity marked 4 inline comments as done. whisperity added a comment. - Made the diagnostic message about "binding power" easier to understand. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95736/new/ https://reviews.llvm.org/D95736

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:363 +/// Returns the diagnostic-friendly name of the node, or empty string. +static SmallString<64> getName(const NamedDecl *ND) { + SmallString<64> Name;

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not respecting and highlighting fed SourceRanges

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331193. whisperity marked 4 inline comments as done. whisperity added a comment. **[NFC]** Fixed nits and code formatting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98635/new/

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331244. whisperity marked 4 inline comments as done. whisperity added a comment. - Added some test cases to ensure edge cases won't crash. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78652/new/ https://reviews.llvm.org/D78652 Files:

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:481 + + assert(TargetIdx.hasValue() && "Matched, but didn't find index?"); + TargetParams[PassedParamOfThisFn].insert( whisperity

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331243. whisperity marked 6 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96355/new/ https://reviews.llvm.org/D96355 Files: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp

[PATCH] D97297: [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

2021-03-17 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 331245. whisperity marked 5 inline comments as done. whisperity added a comment. - Made a precondition check explicit, and added an early `return` to not evaluate a case where it would return `false` anyways... CHANGES SINCE LAST ACTION

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-10 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 329666. whisperity edited the summary of this revision. whisperity added reviewers: hokein, njames93. whisperity added a comment. - Massively refactored and modernised the implementation - Removed spaghetti code related to the check options and made their

[PATCH] D20689: [clang-tidy] Add 'readability-suspicious-call-argument' check

2021-03-19 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp:347 +// Checks whether ArgType converts implicitly to ParamType. +static bool areTypesCompatible(QualType ArgType, QualType ParamType, +

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not respecting and highlighting fed SourceRanges

2021-03-15 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D98635#2626464 , @whisperity wrote: > Strange because I specifically ran both `check-clang` **and** > `check-clang-tools` locally, but will look into this. Turns out there is a `check-clang-extra-unit` too, and it looks

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not handlings SourceRange highlights

2021-03-15 Thread Whisperity via Phabricator via cfe-commits
whisperity created this revision. whisperity added reviewers: aaron.ballman, njames93. whisperity added projects: clang, clang-tools-extra. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs, xazax.hun. whisperity requested review of this revision. Herald added a

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not handlings SourceRange highlights

2021-03-15 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 330687. whisperity added a comment. **NFC** I originally wrote a Release Notes entry about this, which I forgot to commit before I generated the patch file I uploaded, this is fixed now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not respecting and highlighting fed SourceRanges

2021-03-15 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D98635#2626455 , @aaron.ballman wrote: > It looks like there are some unit test failures from the change: > https://buildkite.com/llvm-project/premerge-checks/builds/29754#a9b04ab5-e326-4ff1-beea-773f21a33349 Strange

[PATCH] D98635: [libtooling][clang-tidy] Fix diagnostics not respecting and highlighting fed SourceRanges

2021-03-15 Thread Whisperity via Phabricator via cfe-commits
whisperity updated this revision to Diff 330737. whisperity edited the summary of this revision. whisperity added a subscriber: compositeprimes. whisperity added a comment. Fixed a test file that I originally missed to align with the changes. CHANGES SINCE LAST ACTION

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added a comment. In D69560#2629555 , @aaron.ballman wrote: > [...] so please hold off on landing it for a bit in case any of the other > reviewers want to weigh in. Due to how the patch itself only being useful in practice if all the pieces

[PATCH] D97297: [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:384 + // Pad the two strings to the longer length. + std::size_t BiggerLength = std::max(Str1.size(), Str2.size()); + SmallString<32> S1PadE{Str1},

[PATCH] D69560: [clang-tidy] Add 'bugprone-easily-swappable-parameters' check

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:56 + +#ifndef NDEBUG + aaron.ballman wrote: > Are you planning to remove the debugging code now that the check is > approaching its final

[PATCH] D96355: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with optionally considering differently qualified types mixable

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:172 + /// Add the specified qualifiers to the common type in the Mix. + MixData operator<<(Qualifiers Quals) const { +SplitQualType Split =

[PATCH] D97297: [clang-tidy] Suppress reports to patternedly named parameters in 'bugprone-easily-swappable-parameters'

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity marked an inline comment as not done. whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:364-365 +StringRef S2) { + StringRef S1Prefix =

[PATCH] D78652: [clang-tidy] Suppress reports to similarly used parameters in 'bugprone-easily-swappable-parameters'

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:532-536 + if (find(FD->parameters(), ReturnedParam) == FD->param_end()) +// Returning an Expr to a ParmVarDecl that **isn't** parameter of the +

[PATCH] D95736: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with `typedef` and `const &` diagnostics

2021-03-16 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:706 +UniqueBindPower({LType, RType})) { + // FIXME: Don't emit multiple combinations here either. + StringRef DiagText = "a call

<    1   2   3   4   5   6   >