alexey.knyshev added a comment.
In https://reviews.llvm.org/D40715#951665, @dcoughlin wrote:
> Thanks for looking into this!
>
> This checker is in the 'core' package, which means (when moved out of alpha)
> it will be enabled by default.
>
> - Do you think that this checker should be enabled by
dcoughlin added a comment.
Thanks for looking into this!
This checker is in the 'core' package, which means (when moved out of alpha) it
will be enabled by default.
- Do you think that this checker should be enabled by default for all users of
the analyzer?
- If users do actually want to use l
alexey.knyshev added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/LabelInsideSwitchChecker.cpp:87
+BugReporter &BR) const {
+ auto LabelStmt = stmt(hasDescendant(switchStmt(
+ eachOf(has(compoundStmt(forEach(labelS
a.sidorin added a comment.
Hello Alexey,
Thank you for the update. The code looks much cleaner now.
Comment at: lib/StaticAnalyzer/Checkers/LabelInsideSwitchChecker.cpp:115
+
+namespace clang {
+ namespace ento {
alexey.knyshev wrote:
> a.sidorin wrote:
> > Y
alexey.knyshev added inline comments.
Comment at: lib/StaticAnalyzer/Checkers/LabelInsideSwitchChecker.cpp:24
+
+ class WalkAST : public ConstStmtVisitor {
+const CheckerBase *Checker;
kromanenkov wrote:
> Do you consider using ASTMatchers like in NumberObje
alexey.knyshev updated this revision to Diff 126293.
alexey.knyshev added a comment.
1. Now implemented via MatchFinder
2. Added missing License header
3. Pass all StringRefs by value
4. Method names now start from small letter
5. Using StringRef::edit_distance instead of custom "similarity" metri
kromanenkov added a comment.
A few comments.
Comment at: lib/StaticAnalyzer/Checkers/LabelInsideSwitchChecker.cpp:19
+if (S.second)
+ return S;
+
Maybe I miss something, but do not we return StringRef to temporary string
going out of scope here? Same
a.sidorin added a comment.
Hello Alexey,
Thank you for the patch. I have made a preliminary review and will add some
other reviewers. You can find my comments inline.
Comment at: lib/StaticAnalyzer/Checkers/LabelInsideSwitchChecker.cpp:1
+#include "clang/AST/StmtVisitor.h"
+#
alexey.knyshev created this revision.
alexey.knyshev added a project: clang.
Herald added subscribers: cfe-commits, mgorny.
Implementation of checker "different.LabelInsideSwitch" from potential checkers
list (https://clang-analyzer.llvm.org/potential_checkers.html#different)
Repository:
rC C