ccotter added a comment.
Herald added subscribers: mgehre, shchenz.
Herald added projects: clang-tools-extra, All.
bump - I know this is really old, but @lewmpk do you plan on finishing up the
last remaining comments?
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
JonasToth added a comment.
IMHO the check is close to being finished. please address the notes and mark
them as done if finished with it. So its clear to see whats outstanding.
In my opinion the user-facing documentation misses a "Limitations" sections
that shows the artificial `goto` example,
JonasToth added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-use-raii-locks.cpp:90
+ for (auto i = 0; i < 3; i++) {
+m.lock();
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use RAII
JonasToth wrote:
> lewmpk wrote:
> > JonasToth wrote:
lewmpk updated this revision to Diff 189157.
lewmpk added a comment.
match lock() and unlock() calls by decl
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
JonasToth added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-use-raii-locks.cpp:90
+ for (auto i = 0; i < 3; i++) {
+m.lock();
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use RAII
lewmpk wrote:
> JonasToth wrote:
> > I got another one
lewmpk marked an inline comment as done.
lewmpk added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-use-raii-locks.cpp:90
+ for (auto i = 0; i < 3; i++) {
+m.lock();
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use RAII
JonasToth wrote:
lewmpk updated this revision to Diff 189078.
lewmpk marked an inline comment as done.
lewmpk added a comment.
added example in docs and explicitly specified types for some variables
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
Eugene.Zelenko added inline comments.
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:29
+
+DeclRefExpr *findDeclRefExpr(const CXXMemberCallExpr *MemberCallExpr) {
+ auto *ObjectExpr = MemberCallExpr->getImplicitObjectArgument();
Please use
JonasToth added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-use-raii-locks.cpp:90
+ for (auto i = 0; i < 3; i++) {
+m.lock();
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use RAII
I got another one that I think defeats the analysis:
JonasToth added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-use-raii-locks.cpp:4
+// Mock implementation of std::mutex
+namespace std {
+struct mutex {
lewmpk wrote:
> JonasToth wrote:
> > Please add more tests
> >
> > What happens for this?
lewmpk marked 7 inline comments as done.
lewmpk added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-use-raii-locks.cpp:4
+// Mock implementation of std::mutex
+namespace std {
+struct mutex {
JonasToth wrote:
> Please add more tests
>
> What
lewmpk updated this revision to Diff 189055.
lewmpk added a comment.
added support for boost lockable types
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
lewmpk updated this revision to Diff 189054.
lewmpk added a comment.
refactor and improved tests
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
JonasToth added inline comments.
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:35
+void UseRaiiLocksCheck::registerMatchers(MatchFinder *Finder) {
+ // lock_guards require c++11 or later
+ if (!getLangOpts().CPlusPlus11)
If we allow boost, pre
riccibruno added a comment.
Ugh, could you please avoid doing lots a tiny changes every 5 minutes ? This
causes spam on cfe-commits /:
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
lewmpk updated this revision to Diff 188920.
lewmpk added a comment.
remove support for try_lock_for and try_lock_until
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
lewmpk updated this revision to Diff 188919.
lewmpk added a comment.
support try_lock_for and try_lock_until
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
lewmpk updated this revision to Diff 188918.
lewmpk added a comment.
improved tests
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk updated this revision to Diff 188915.
lewmpk added a comment.
fixed documentation formatting
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk marked 3 inline comments as done.
lewmpk added inline comments.
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:26
+ recordType(hasDeclaration(cxxRecordDecl(hasName("::std::mutex"));
+ // Match expressions of type mutex or mutex pointer
+ const
lewmpk updated this revision to Diff 188913.
lewmpk added a comment.
fixed documentation formatting
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk updated this revision to Diff 188912.
lewmpk added a comment.
fixed documentation again
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk updated this revision to Diff 188911.
lewmpk added a comment.
fixed documentation
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk updated this revision to Diff 188910.
lewmpk added a comment.
renamed option for cppcoreguidelines-use-raii-locks
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
lewmpk updated this revision to Diff 188908.
lewmpk added a comment.
handle other basiclockable types
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk updated this revision to Diff 188900.
lewmpk added a comment.
fixed nested use case
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lewmpk updated this revision to Diff 188901.
lewmpk added a comment.
removed unneccesary include
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
clang-tidy/cppcoreguidelines/CMakeLists.txt
lebedev.ri added a comment.
+1 i was just going to comment - this needs **much** more tests.
Also, it would be really great if you could supply the differential's
description.T
Comment at: clang-tidy/cppcoreguidelines/UseRaiiLocksCheck.cpp:25
+ const auto MutexDecl =
lewmpk added a comment.
I'll improve the tests :)
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
MyDeveloperDay added a comment.
This looks good to me but I would wait for one of @JonasToth or @alexfh to
perhaps take a look,
maybe you should add some nested scope example too using the same name, I know
the compiler should warn about a shadow variable anyway but
std::mutex m;
lewmpk updated this revision to Diff 188893.
lewmpk added a comment.
fixed ordering of cppcoreguidelines module checks
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58818/new/
https://reviews.llvm.org/D58818
Files:
MyDeveloperDay added inline comments.
Comment at: clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp:47
+"cppcoreguidelines-use-raii-locks");
CheckFactories.registerCheck(
"cppcoreguidelines-avoid-c-arrays");
Nit: by and large
lewmpk created this revision.
lewmpk added reviewers: hokein, aaron.ballman, alexfh, JonasToth.
Herald added subscribers: cfe-commits, jdoerfert, kbarton, xazax.hun, mgorny,
nemanjai.
Herald added a project: clang.
lewmpk added a subscriber: clang-tools-extra.
Repository:
rCTE Clang Tools
33 matches
Mail list logo