[PATCH] D12889: [Static Analyzer] Generics Checker: When an ObjC method returns a specialized object, track it properly.

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 15:24:02 PDT 2015


xazax.hun created this revision.
xazax.hun added reviewers: zaks.anna, dcoughlin, jordan_rose.
xazax.hun added a subscriber: cfe-commits.

When the return type of a method of a generic class was itself a generic type, this type was not recorded for the returned symbol.
This patch address this issue (see the test for examples).

There is one odd thing: the return type of a method is computed twice. Once in the preObjCMessage callback and once in the postObjCMessage callback. The reason is that, it is better to report the type error in the pre callback, because this way the user gets cleaner diagnostic (shorter path). However it is only possible to record the type information in the post callback, since the symbol for the return type is not available yet in the pre callback.

http://reviews.llvm.org/D12889

Files:
  lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
  test/Analysis/generics.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12889.34844.patch
Type: text/x-patch
Size: 225659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150915/356410e0/attachment-0001.bin>


More information about the cfe-commits mailing list