summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FastISel.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-06-11 01:09:30 +0000
committerDouglas Gregor <dgregor@apple.com>2011-06-11 01:09:30 +0000
commit33823727c80ad78773c09a588d8399fc0f4f0b9a (patch)
tree50d799ac17909bce14702c0b8a689ebabd05f9e8 /llvm/lib/Target/X86/X86FastISel.cpp
parent3d4e64b082717170ef918cb88b337087fb461b35 (diff)
downloadbcm5719-llvm-33823727c80ad78773c09a588d8399fc0f4f0b9a.tar.gz
bcm5719-llvm-33823727c80ad78773c09a588d8399fc0f4f0b9a.zip
Implement Objective-C Related Result Type semantics.
Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
Diffstat (limited to 'llvm/lib/Target/X86/X86FastISel.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud