[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-07 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz created this revision. Herald added subscribers: mattd, carlosgalvezp, yaxunl, mgorny. Herald added a project: All. barcisz requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Signed-off-by: bcieslar Repository: rG LLVM

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-07 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 458502. barcisz added a comment. Fixed a copy-paste error with Google->Cuda in CudaTidyModule.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clang-tools

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-07 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 458504. barcisz added a comment. removed duplication of '.cu' in the lit config for clang-tidy tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clang-to

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-07 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added inline comments. Comment at: clang-tools-extra/clang-tidy/cuda/CudaTidyModule.cpp:25 + +// Register the GoogleTidyModule using this statically initialized variable. +static ClangTidyModuleRegistry::Add tschuett wrote: > Is Google a copy and paste er

[PATCH] D133725: Searching for tokens including comments

2022-09-12 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz created this revision. Herald added a project: All. barcisz requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is a small diff that adds an optional argument to the Lexer::findNextToken that allows for searching for the token whi

[PATCH] D133801: Extraction of a matcher for an unused value from an expression from the bugprone-unused-return-value check

2022-09-13 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz created this revision. Herald added a subscriber: carlosgalvezp. Herald added a project: All. barcisz requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This diff extracts the matcher for an unused expression result from b

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-13 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz created this revision. Herald added subscribers: mattd, carlosgalvezp, yaxunl, mgorny. Herald added a project: All. barcisz requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://r

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-13 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 459870. barcisz added a comment. Added some explanation comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/clang-tidy/CMakeLists.txt

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-13 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. @tschuett does it look alright now? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460019. barcisz added a comment. More explanation comments for the check's code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/clang-tidy/

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460025. barcisz added a comment. Rebase and better comments for cuda-related decisions in the check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-too

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460027. barcisz added a comment. Better explanation of cuda-related flags in tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clang-tools-extra/clang-ti

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460034. barcisz added a comment. Removed unnecessary cuda-related compilation flags from tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-ex

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added inline comments. Comment at: clang-tools-extra/test/clang-tidy/check_clang_tidy.py:121 +# Tests should not rely on a certain cuda device being available on the machine, +# or a certain version of it tra wrote: > The comment is incorrect.

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460055. barcisz added a comment. Update base to D133801 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460070. barcisz added a comment. Herald added a subscriber: arphaman. Common documentation for cuda checks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: cl

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460184. barcisz added a comment. Documentation and small check-message-related bugfixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/-

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460256. barcisz added a comment. Brought back different message prefix for when AcceptedHandlers is set Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460258. barcisz added a comment. Removed unneeded headers from the check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/- clang-tools-ex

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-14 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460261. barcisz added a comment. Removed unneeded headers from the check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/- clang-tools-ex

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460374. barcisz marked 2 inline comments as done. barcisz added a comment. Changes suggested by njames93 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clan

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460376. barcisz added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/- clang-tools-extra/clang-tidy/cuda/CMakeLists.tx

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz created this revision. Herald added a subscriber: carlosgalvezp. Herald added a project: All. barcisz requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D13394

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460405. barcisz added a comment. Use the new Lexer option to include comments while finding next token Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133942/new/ https://reviews.llvm.org/D133942 Files: clang-

[PATCH] D133804: Cuda Check for ignored return errors from api calls to cuda

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460410. barcisz added a comment. Use header guards instead of pragma Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133804/new/ https://reviews.llvm.org/D133804 Files: clang-tools-extra/- clang-tools-extra/

[PATCH] D133956: git push Cuda Check for ignored errors after calling a CUDA kernel

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz created this revision. Herald added subscribers: mattd, carlosgalvezp, yaxunl, mgorny. Herald added a project: All. barcisz requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Add cuda-unchecked-kernel-call check ===

[PATCH] D133956: git push Cuda Check for ignored errors after calling a CUDA kernel

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. In D133956#3793022 , @tra wrote: > I think ultimately the checker should be generalized to flag all unchecked > CUDA runtime calls. The problem is that that is going to be exceedingly noisy > in practice as a lot of real code do

[PATCH] D133725: Searching for tokens including comments

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. In D133725#3792787 , @aaron.ballman wrote: > Can you help me understand the expected use for these change? Changed the description to answer your question - it's a prerequisite to D133942 and

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460519. barcisz added a comment. Dummy definition for size_t Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clang-tools-extra/clang-tidy/CMakeLists.txt cl

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460520. barcisz added a comment. moved size_t definition to an stddef.h stub Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clang-tools-extra/clang-tidy/CMa

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460522. barcisz added a comment. Herald added a subscriber: mgorny. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133942/new/ https://reviews.llvm.org/D133942 Files: clang-tools-extra/clang-tidy/cuda/

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. In D133942#3793618 , @njames93 wrote: > Would I be correct in assuming you have uploaded the wrong diff here? Yes, sorry, got mixed up with D133956 (6 diffs ain't easy to shuffle :-/) Reposit

[PATCH] D133956: Cuda Check for ignored errors after calling a CUDA kernel

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460550. barcisz added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133956/new/ https://reviews.llvm.org/D133956 Files: clang-tools-extra/clang-tidy/cuda/CMakeLists.txt clang-tools-extra/

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460551. barcisz added a comment. Misplaced diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133942/new/ https://reviews.llvm.org/D133942 Files: clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp clang

[PATCH] D133956: Cuda Check for ignored errors after calling a CUDA kernel

2022-09-15 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cuda/unsafe-kernel-call-macro-handler.cu:53 + } + auto err = cudaGetLastError(); + tra wrote: > barcisz wrote: > > tra wrote: > > > Just curious -- is it sufficient to just c

[PATCH] D133956: Cuda Check for ignored errors after calling a CUDA kernel

2022-09-16 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 460743. barcisz added a comment. Herald added a subscriber: aheejin. documentation for the check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133956/new/ https://reviews.llvm.org/D133956 Files: .clang-tidy

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-17 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. In D133942#3797449 , @njames93 wrote: > It would also be nice to add in some unittests to demonstrate that braces are > currently inserted etc. Right sorry, forgot to port unit tests, will do that swiftly Repository: rG LLVM

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-17 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. In D133942#3797449 , @njames93 wrote: > How does this handle pathological cases like the statement being the > iteration-expression of a for loop, or a init-statement in an > if/switch/range-for loop. The documentation looks lik

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-17 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/stddef.h:12 + +using size_t = long long unsigned; + njames93 wrote: > If this is all the file is used for, and it's only used for this one test > file, can prob

[PATCH] D133436: Ground work for cuda-related checks in clang-tidy

2022-09-20 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 461561. barcisz added a comment. Inlined definition of size_t Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133436/new/ https://reviews.llvm.org/D133436 Files: clang-tools-extra/clang-tidy/CMakeLists.txt c

[PATCH] D133801: Extraction of a matcher for an unused value from an expression from the bugprone-unused-return-value check

2022-09-20 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 461562. barcisz added a comment. Removed unused matcher definitions from bugprone-unused-return-value Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133801/new/ https://reviews.llvm.org/D133801 Files: clang-t

[PATCH] D133801: Extraction of a matcher for an unused value from an expression from the bugprone-unused-return-value check

2022-09-20 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added a comment. @njames93 What would be the best way to write up those tests here? I feel like writing a custom check to test the matcher each time we want to test one would be quite wasteful, but at the same time what would be the best way to invoke clang's frontend without using `too

[PATCH] D133801: Extraction of a matcher for an unused value from an expression from the bugprone-unused-return-value check

2022-09-20 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 461721. barcisz added a comment. Tests for the check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133801/new/ https://reviews.llvm.org/D133801 Files: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueC

[PATCH] D133942: Clang tidy utility to generate a fix hint for a subsequent expression to the existing one

2022-09-21 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz updated this revision to Diff 461955. barcisz added a comment. Tests for the utility Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133942/new/ https://reviews.llvm.org/D133942 Files: clang-tools-extra/clang-tidy/utils/FixItHintUtils.cpp

[PATCH] D133801: Extraction of a matcher for an unused value from an expression from the bugprone-unused-return-value check

2022-09-23 Thread Bartłomiej Cieślar via Phabricator via cfe-commits
barcisz added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/MatchersTest.cpp:2 +#include "utils/Matchers.h" +#include "../../clang/unittests/ASTMatchers/ASTMatchersTest.h" + njames93 wrote: > kwk wrote: > > njames93 wrote: > > > @kwk I seem