[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-31 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL285605: [analyzer] MacOSXAPIChecker: Disallow dispatch_once_t in ivars and heap. (authored by dergachev). Changed prior to commit: https://reviews.llvm.org/D25909?vs=75998=76446#toc Repository: rL

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-27 Thread Anna Zaks via cfe-commits
zaks.anna accepted this revision. zaks.anna added a comment. This revision is now accepted and ready to land. Looks great! Please, commit. https://reviews.llvm.org/D25909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/dispatch-once.m:62 +- (void)test_ivar_struct_from_inside { + dispatch_once(, ^{}); // expected-warning{{Call to 'dispatch_once' uses the instance variable 's' for the predicate value.}} +} dcoughlin wrote: >

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-27 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75998. NoQ marked 3 inline comments as done. NoQ added a comment. Also, do not create error nodes unless we're sure we're throwing a report. https://reviews.llvm.org/D25909 Files: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-25 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:94 + else if (isa(RS)) { +// FIXME: Presence of an IVar region has priority over this branch, because +// ObjC objects are on the heap even if the core doesn't realize this.

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-25 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75739. NoQ marked 2 inline comments as done. NoQ added a comment. Consider a lot more dispatch_once_t regions: improve diagnostics for local structs containing predicates, find ivar structs with predicates. Address a couple of review comments, discuss the rest.

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-25 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/dispatch-once.m:13 + +void test_stack() { + dispatch_once_t once; dcoughlin wrote: > Should the tests for dispatch_once in unix-fns.c be moved here? In fact we need to de-duplicate code with unix.API's

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Anna Zaks via cfe-commits
zaks.anna added a comment. Looks good overall! https://reviews.llvm.org/D25909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:94 + else if (isa(RS)) { +// FIXME: Presence of an IVar region has priority over this branch, because +// ObjC objects are on the heap even if the core doesn't realize this.

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp:92 + else if (isa(RS)) +os << " heap allocated memory"; + else if (isa(RS)) { "heap allocated" --> "heap-allocated" Comment at:

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ updated this revision to Diff 75589. NoQ added a comment. Hotfix code duplication i just noticed. https://reviews.llvm.org/D25909 Files: lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp test/Analysis/dispatch-once.m Index: test/Analysis/dispatch-once.m

[PATCH] D25909: [analyzer] MacOSXApiChecker: Disallow dispatch_once predicates on heap and in ivars.

2016-10-24 Thread Artem Dergachev via cfe-commits
NoQ created this revision. NoQ added reviewers: zaks.anna, dcoughlin. NoQ added a subscriber: cfe-commits. As documentation in https://developer.apple.com/reference/dispatch/dispatch_once_t says, only global or static variables should have type `dispatch_once_t`, otherwise the magic with fast