[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ planned changes to this revision. NoQ added a comment. Todo: - See if the extra __kindofs leak into diagnostic messages. - Test how this behaves in cases (2) and (4), add tests. - Add tests for the recursive `__kindof` specifier merge (i.e. properly merge the second `__kindof` in

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-18 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D33191#758583, @NoQ wrote: > I think i found a relatively clean way of storing the kindof specifiers, > which is within the most-specialized type object itself. > > Like, if we see `Foo` being casted to `Foo<__kindof X, Y>` and in >

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 99444. NoQ added a comment. Added a bit more info in the code comments. https://reviews.llvm.org/D33191 Files: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp test/Analysis/generics.m Index: test/Analysis/generics.m

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-18 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 99443. NoQ added a comment. I think i found a relatively clean way of storing the kindof specifiers, which is within the most-specialized type object itself. Like, if we see `Foo` being casted to `Foo<__kindof X, Y>` and in another place to `Foo

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-17 Thread Anna Zaks via Phabricator via cfe-commits
zaks.anna added inline comments. Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:464 ASTContext ) { + if (hasKindofArgs(StaticUpperBound)) { +// If the upper bound type has more __kindof specs, we drop all the info,

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. In https://reviews.llvm.org/D33191#756174, @NoQ wrote: > @Gábor: I didn't want to bother you with this, but i'm not entirely sure > about how to deal with these false positives; since you're the original > author of this check, if you see anything obviously wrong

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-16 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ updated this revision to Diff 99150. NoQ added a comment. Cover more cases and be more conservative. @Gábor: I didn't want to bother you with this, but i'm not entirely sure about how to deal with these false positives; since you're the original author of this check, if you see anything

[PATCH] D33191: [analyzer] ObjCGenerics: account for __kindof specifiers met along a chain of casts.

2017-05-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision. Herald added a subscriber: xazax.hun. `__kindof` type specifiers allow the developers to express their intent in discriminating between generic type arguments being matched exactly or allowing sub-types. When generics were introduced, it was already too late to add