[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-11 Thread Alexey Knyshev via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-11 Thread Devin Coughlin via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-11 Thread Alexey Knyshev via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-11 Thread Aleksei Sidorin via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-10 Thread Alexey Knyshev via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-10 Thread Alexey Knyshev via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-03 Thread Kirill Romanenkov via Phabricator via cfe-commits
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

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-03 Thread Aleksei Sidorin via Phabricator via cfe-commits
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" +#

[PATCH] D40715: [analyser] different.LabelInsideSwitch checker implementation

2017-12-01 Thread Alexey Knyshev via Phabricator via cfe-commits
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