aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-12-05 16:28:47 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-12-05 16:28:47 +0000
commitab139a9e7998ee29d8d2254230811909d5957814 (patch)
tree5346c5ffba71914a8de49a345bf7fd1cdd115921 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parent1f158d6955a31b4decf03c5bf2d568f5e29cc2e8 (diff)
downloadllvm-ab139a9e7998ee29d8d2254230811909d5957814.zip
llvm-ab139a9e7998ee29d8d2254230811909d5957814.tar.gz
llvm-ab139a9e7998ee29d8d2254230811909d5957814.tar.bz2
[analyzer] ObjCGenerics: Warn only on mismatch for invariant type parameters
On a method call, the ObjCGenerics checker uses the type tracked by DynamicTypePropagation for the receiver to to infer substituted parmeter types for the called methods and warns when the argument type does not match the parameter. Unfortunately, using the tracked type can result in false positives when the receiver has a non-invariant type parameter and has been intentionally upcast. For example, becaue NSArray's type parameter is covaraint, the following code is perfectly safe: NSArray<NSString *> *allStrings = ... NSDate *date = ...; NSArray<NSObject *> *allObjects = allStrings; NSArray<NSObject *> *moreObjects = [allObjects arrayByAddingObject:date]; but the checker currently warns that the date parameter is not an NSString *. To avoid this kind of false positive, the checker will now only warn when the class defining the called method has only invariant type parameters. rdar://problem/28803951 llvm-svn: 288677
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
0 files changed, 0 insertions, 0 deletions