[clang-tidy] Any interest in a new s/assert\(0 && /llvm_unreachable/ checker?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[clang-tidy] Any interest in a new s/assert\(0 && /llvm_unreachable/ checker?

Nathan Ridge via cfe-dev
Noticed there are several cases of "assert(0 &&" in many of our projects, so this would be a simple find and replace checker in the llvm_check namespace.

If this appears valuable, I can gen one up pretty quickly.

thanks...
don

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Any interest in a new s/assert\(0 && /llvm_unreachable/ checker?

Nathan Ridge via cfe-dev
Would be nice to clean them up & keep them cleaned up - but without a means to consistently apply LLVM style checkers from clang-tidy, I'm not sure how much value they'll be (this is my general attitude towards LLVM style checking in clang-tidy - but perhaps there's enough people using them in some way that they end up getting cleaned up relatively quickly/not getting out of hand? I'd love it if there were a way to opt into LLVM style clang-tidy checks in a CMake build with similar surfacing (including -Werror support) to normal compiler warnings)

On Mon, Jun 17, 2019 at 11:07 AM Don Hinton via cfe-dev <[hidden email]> wrote:
Noticed there are several cases of "assert(0 &&" in many of our projects, so this would be a simple find and replace checker in the llvm_check namespace.

If this appears valuable, I can gen one up pretty quickly.

thanks...
don
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Any interest in a new s/assert\(0 && /llvm_unreachable/ checker?

Nathan Ridge via cfe-dev
There might already be a cmake mechanism in place.  If not, creating it, and putting it on a bit, wouldn't be difficult.

Perhaps run it as a commit hook?  

On Mon, Jun 17, 2019 at 11:32 AM David Blaikie <[hidden email]> wrote:
Would be nice to clean them up & keep them cleaned up - but without a means to consistently apply LLVM style checkers from clang-tidy, I'm not sure how much value they'll be (this is my general attitude towards LLVM style checking in clang-tidy - but perhaps there's enough people using them in some way that they end up getting cleaned up relatively quickly/not getting out of hand? I'd love it if there were a way to opt into LLVM style clang-tidy checks in a CMake build with similar surfacing (including -Werror support) to normal compiler warnings)

On Mon, Jun 17, 2019 at 11:07 AM Don Hinton via cfe-dev <[hidden email]> wrote:
Noticed there are several cases of "assert(0 &&" in many of our projects, so this would be a simple find and replace checker in the llvm_check namespace.

If this appears valuable, I can gen one up pretty quickly.

thanks...
don
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Any interest in a new s/assert\(0 && /llvm_unreachable/ checker?

Nathan Ridge via cfe-dev
On Mon, Jun 17, 2019 at 11:45 AM Don Hinton <[hidden email]> wrote:
There might already be a cmake mechanism in place.  If not, creating it, and putting it on a bit, wouldn't be difficult.

*nod* perhaps, though it hasn't been done yet so far as I know - so I'm not sure when/where/how these LLVM clang-tidy checks are currently being used.
 
Perhaps run it as a commit hook?  

I don't think we have anything like that - but maybe? I don't really know.
 

On Mon, Jun 17, 2019 at 11:32 AM David Blaikie <[hidden email]> wrote:
Would be nice to clean them up & keep them cleaned up - but without a means to consistently apply LLVM style checkers from clang-tidy, I'm not sure how much value they'll be (this is my general attitude towards LLVM style checking in clang-tidy - but perhaps there's enough people using them in some way that they end up getting cleaned up relatively quickly/not getting out of hand? I'd love it if there were a way to opt into LLVM style clang-tidy checks in a CMake build with similar surfacing (including -Werror support) to normal compiler warnings)

On Mon, Jun 17, 2019 at 11:07 AM Don Hinton via cfe-dev <[hidden email]> wrote:
Noticed there are several cases of "assert(0 &&" in many of our projects, so this would be a simple find and replace checker in the llvm_check namespace.

If this appears valuable, I can gen one up pretty quickly.

thanks...
don
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Any interest in a new s/assert\(0 && /llvm_unreachable/ checker?

Nathan Ridge via cfe-dev
Hi David:

On Mon, Jun 17, 2019 at 11:52 AM David Blaikie <[hidden email]> wrote:
On Mon, Jun 17, 2019 at 11:45 AM Don Hinton <[hidden email]> wrote:
There might already be a cmake mechanism in place.  If not, creating it, and putting it on a bit, wouldn't be difficult.

*nod* perhaps, though it hasn't been done yet so far as I know - so I'm not sure when/where/how these LLVM clang-tidy checks are currently being used.
 
Perhaps run it as a commit hook?  

I don't think we have anything like that - but maybe? I don't really know.

I think it would be good to have a git-clang-tidy module that works like git-clang-format, and only runs clang-tidy on the .h and .cpp files in the diff.
 
 

On Mon, Jun 17, 2019 at 11:32 AM David Blaikie <[hidden email]> wrote:
Would be nice to clean them up & keep them cleaned up - but without a means to consistently apply LLVM style checkers from clang-tidy, I'm not sure how much value they'll be (this is my general attitude towards LLVM style checking in clang-tidy - but perhaps there's enough people using them in some way that they end up getting cleaned up relatively quickly/not getting out of hand? I'd love it if there were a way to opt into LLVM style clang-tidy checks in a CMake build with similar surfacing (including -Werror support) to normal compiler warnings)

On Mon, Jun 17, 2019 at 11:07 AM Don Hinton via cfe-dev <[hidden email]> wrote:
Noticed there are several cases of "assert(0 &&" in many of our projects, so this would be a simple find and replace checker in the llvm_check namespace.

If this appears valuable, I can gen one up pretty quickly.

thanks...
don
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev