Details
- Reviewers
NoQ - Commits
- rG660cda572d6e: [Analyzer][WebKit] NoUncountedMembersChecker
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp | ||
---|---|---|
106–107 | Did you intentionally make a stronger check than the usual SourceManager::isInSystemHeader()? If so i'm curious why - like, what's so special about this checker that requires this? Should we fix all of our other checkers? It must be something something module maps. I don't know much about those. | |
110 | This looks unused. | |
111 | As far as i'm aware, in C++ every RecordDecl is a CXXRecordDecl. | |
112 | What's the motivation for skipping those? | |
129–134 | Can we elaborate a bit on why it's bad? Even something like ... which is error-prone would be great. | |
clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp | ||
10 | I found members:: fairly unexpected. Maybe simply Class::Member? The surrounding namespace is obvious from the location of the warning and doesn't seem to be worth dumping. |
clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp | ||
---|---|---|
106–107 | No, there was no intention. I'll just use SourceManager::isInSystemHeader(). Thanks for pointing this out! | |
110 | Indeed! Thanks | |
112 | This checker enforces that there are no raw-pointers/references to uncounted types as member variable but since that's actually how WebKit smartpointers are implemented we need to skip those. | |
129–134 | Ok. Shall I add it to the checkers.rst or here? | |
clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp | ||
10 | Ok. |
clang/lib/StaticAnalyzer/Checkers/WebKit/NoUncountedMembersChecker.cpp | ||
---|---|---|
129–134 | Here. I'd prefer to avoid this situation where the user reads the warning and is like "ok so what :/". |
Hi, @jkorous
Thanks for working on this analyzer check.
Just give you some feedback on this check, it seems to trigger the assertion quite often (we noticed that internally there were a lot of crashes).
you can easily reproduce it by running it a LLVM file, e.g. ./bin/clang-tidy -checks="-*,clang-analyzer-webkit*" ../clang-tools-extra/clangd/ClangdLSPServer.cpp
Looks similar to https://bugs.llvm.org/show_bug.cgi?id=46142. It sounds pretty important to address quickly because it crashes on a fairly large portion of C++ code with default settings.
Did you intentionally make a stronger check than the usual SourceManager::isInSystemHeader()? If so i'm curious why - like, what's so special about this checker that requires this? Should we fix all of our other checkers? It must be something something module maps. I don't know much about those.