[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-12 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 81083. NoQ added a comment. - Fix crashes on checking properties in categories. - Address both comments. https://reviews.llvm.org/D27535 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-09 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:494 +def ObjCPropertyChecker : Checker<"ObjCProperty">, + HelpText<"Find various issues with Objective-C properties">, + DescFile<"ObjCPropertyChecker.cpp">; Nit:

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-09 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:44 + BugReporter ) const { + if (D->isReadOnly() || D->getSetterKind() != ObjCPropertyDecl::Copy) +return; It is

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-08 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 80811. NoQ added a comment. Don't yell at read-only properties (no -copy is performed). Single-quote 'copy' in the error messages. https://reviews.llvm.org/D27535 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-08 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 80756. NoQ added a comment. Don't construct a `StringRef` to a temporary `std::string`. https://reviews.llvm.org/D27535 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/CMakeLists.txt

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-08 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:68 +return; + + BR.EmitBasicReport( dcoughlin wrote: > You'll also want to make sure to not warn on the following idiom, in which > programmers use @synthesize to

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-08 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 80751. NoQ marked an inline comment as done. NoQ added a comment. - Address comments - Richer warning message (is it in good shape?) - Add tests for lack of implementation https://reviews.llvm.org/D27535 Files:

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-07 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin added a comment. This looks great to me other than the idiom I mentioned inline (which is common, as I have found to my chagrin). Comment at: lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp:12 +// Currently finds only one kind of issue: +// - Find

[PATCH] D27535: [analyzer] Add ObjCPropertyChecker - check for autosynthesized copy-properties of mutable types.

2016-12-07 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin. NoQ added a subscriber: cfe-commits. Herald added a subscriber: mgorny. When an ObjC property is declared as `(copy)`, and the type of the property is mutable (eg. `NSMutableSomething`), the autosynthesized code for the