| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
constants. Fixes PR10145.
llvm-svn: 133179
|
|
|
|
|
|
|
|
|
|
| |
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.
Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.
llvm-svn: 133103
|
|
|
|
|
|
| |
reason to allow the user to control these semantics through a flag.
llvm-svn: 132919
|
|
|
|
| |
llvm-svn: 132874
|
|
|
|
|
|
|
| |
pointer assignment in C++. This was a longstanding problem spotted by
Jordy Rose.
llvm-svn: 132873
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
return <expression> ;
in blocks with a 'void' result type, so long as <expression> has type
'void'. This follows the rules for C++ functions.
llvm-svn: 132658
|
|
|
|
|
|
| |
pointers. Fixes PR10052.
llvm-svn: 132397
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bit by allowing __weak and __strong to be added/dropped as part of
implicit conversions (qualification conversions in C++). A little
history: GCC lets one add/remove/change GC qualifiers just about
anywhere, implicitly. Clang did roughly the same before, but we
recently normalized the semantics of qualifiers across the board to
get a semantics that we could reason about (yay). Unfortunately, this
tightened the screws a bit too much for GC qualifiers, where it's
common to add/remove these qualifiers at will.
Overall, we're still in better shape than we were before: we don't
permit directly changing the GC qualifier (e.g., __weak -> __strong),
so type safety is improved. More importantly, we're internally
consistent in our handling of qualifiers, and the logic that allows
adding/removing GC qualifiers (but not adding/removing address
spaces!) only touches two obvious places.
Fixes <rdar://problem/9402499>.
llvm-svn: 131065
|
|
|
|
|
|
|
|
| |
any names that aren't in the appropriate identifier namespaces. Fixes
an embarrassing bug where we give a redefinition error due to an
Objective-C category (<rdar://problem/9388207>).
llvm-svn: 131036
|
|
|
|
| |
llvm-svn: 130280
|
|
|
|
|
|
|
|
|
|
|
| |
determine which is a better conversion to "void*", be sure to perform
the comparison using the safe-for-id
ASTContext::canAssignObjCInterfaces() rather than the asserts-with-id
ASTContext::canAssignObjCInterfaces().
Fixes <rdar://problem/9327203>.
llvm-svn: 130259
|
|
|
|
|
|
|
|
|
|
|
| |
the qualifiers (e.g., GC qualifiers) on the type we're converting
from, rather than just blindly adopting the qualifiers of the type
we're converting to or dropping qualifiers altogether.
As an added bonus, properly diagnose GC qualifier mismatches to
eliminate a crash in the overload resolution failure diagnostics.
llvm-svn: 130255
|
|
|
|
| |
llvm-svn: 130045
|
|
|
|
| |
llvm-svn: 129866
|
|
|
|
|
|
|
| |
access expression that appears to be a property reference. Fixes
<rdar://problem/8985943>.
llvm-svn: 129865
|
|
|
|
|
|
|
|
|
| |
Objective-C pointer to void* as a "conversion to void*". This allows
us to prefer an Objective-C object pointer conversion to a superclass
object pointer over an Objective-C object pointer conversion to
cv-void*. Fixes PR9735.
llvm-svn: 129603
|
|
|
|
|
|
| |
Objective-C pointer type. Fixes <rdar://problem/9142559>.
llvm-svn: 129339
|
|
|
|
|
|
|
| |
implement lhs's protocols. // rdar://9091389.
llvm-svn: 129142
|
|
|
|
|
|
| |
Add a test case for synthesize ivar. // rdar://9070460
llvm-svn: 128554
|
|
|
|
|
|
|
| |
an executable test to llvm test suite.
// rdar://9070460.
llvm-svn: 128435
|
|
|
|
|
|
| |
// rdar:// 9139947
llvm-svn: 128013
|
|
|
|
|
|
|
|
|
|
|
| |
ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that
we diagnose undefined labels before the jump-scope checker gets run,
since the jump-scope checker requires (as its invariant) that all of
the GotoStmts be wired up correctly.
Fixes PR9495.
llvm-svn: 127738
|
|
|
|
| |
llvm-svn: 126599
|
|
|
|
|
|
|
|
| |
-fobjc-exceptions flag to turn them on.
Update all tests accordingly.
llvm-svn: 126177
|
|
|
|
| |
llvm-svn: 126037
|
|
|
|
|
|
| |
PR8626.
llvm-svn: 125506
|
|
|
|
|
|
|
| |
types which are contravariance in argument types and covariance
in return types. // rdar://8979379.
llvm-svn: 125445
|
|
|
|
|
|
|
|
|
| |
a glvalue as a temporary. Previously, we were enumerating all of the
cases that coul return glvalues and might be called with
Sema::MaybeBindToTemporary(), but that was gross and we missed the
Objective-C property reference case.
llvm-svn: 125070
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
conversions (<rdar://problem/8592139>) for overload resolution. The
conversion ranking mirrors C++'s conversion ranking fairly closely,
except that we use a same pseudo-subtyping relationship employed by
Objective-C pointer assignment rather than simple checking
derived-to-base conversions. This change covers:
- Conversions to pointers to a specific object type are better than
conversions to 'id', 'Class', qualified 'id', or qualified 'Class'
(note: GCC doesn't perform this ranking, but it matches C++'s rules
for ranking conversions to void*).
- Conversions to qualified 'id' or qualified 'Class' are better than
conversions to 'id' or 'Class', respectively.
- When two conversion sequences convert to the same type, rank the
conversions based on the relationship between the types we're
converting from.
- When two conversion sequences convert from the same non-id,
non-Class type, rank the conversions based on the relationship of
the types we're converting to. (note: GCC allows this ranking even
when converting from 'id', which is extremeley dangerous).
llvm-svn: 124591
|
|
|
|
|
|
|
| |
reuse it for BlockDeclRefExpr. Do so, fixing the dependence calculate
for BlockDeclRefExpr.
llvm-svn: 123851
|
|
|
|
|
|
|
| |
there's a respectable point of instantiation. Also, make sure we do
this operation even when instantiating a dependently-typed variable.
llvm-svn: 123818
|
|
|
|
|
|
|
| |
complete. However, if it returns a reference type, don't require the
type it refers to to be complete. Fixes <rdar://problem/8807070>.
llvm-svn: 123214
|
|
|
|
|
|
|
|
| |
cv-qualification conversions. More specifically, there's an implicit
cv-qualification conversion (even one that drops qualifiers) when
converting to 'id' or qualified 'id'. Fixes <rdar://problem/8734046>.
llvm-svn: 121047
|
|
|
|
|
|
|
|
|
| |
about deprecated Objective-C pointer conversions. Plus, make sure to
actually set an appropriate AssignmentAction when performing an
implicit conversion from an InitializationSequence. Fixes regressions
in the GCC DejaGNU testsuite.
llvm-svn: 120744
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
conversions. Previously, we would end up collapsing qualification
conversions into the Objective-C pointer conversion step, including
(possibly) stripping qualifiers that shouldn't be removed.
This generalizes BuildSimilarlyQualifiedPointerType() to also work on
Objective-C object pointers, then eliminates the (redundant, not
totally correct) BuildSimilarlyQualifiedObjCObjectPointerType()
function.
Fixes <rdar://problem/8714395>.
llvm-svn: 120607
|
|
|
|
|
|
| |
out because there are still bugs left.
llvm-svn: 119722
|
|
|
|
| |
llvm-svn: 117942
|
|
|
|
| |
llvm-svn: 117356
|
|
|
|
|
|
| |
conversion to id over conversion to void*.
llvm-svn: 117355
|
|
|
|
|
|
|
|
|
|
| |
the same rank as conversions of normal pointers to 'void*'.
Also, resurrect a test case.
Fixes rdar://problem/8592139
llvm-svn: 117354
|
|
|
|
|
|
| |
protocol-qualified types such as id<Protocol>.
llvm-svn: 117081
|
|
|
|
|
|
|
|
|
| |
find a copy constructor/assignment operator used
in getter/setter synthesis. This removes an unintended
diagnostics and makes objc++ consistant with objective-c.
// rdar: //8550657.
llvm-svn: 116631
|
|
|
|
| |
llvm-svn: 116519
|
|
|
|
|
|
| |
declarations. Fixes PR8169.
llvm-svn: 115411
|
|
|
|
| |
llvm-svn: 115410
|
|
|
|
|
|
|
|
| |
verify that we aren't in a message-send expression before digging into
the identifier or looking ahead more tokens. Fixes a regression
(<rdar://problem/8483253>) I introduced with bracket insertion.
llvm-svn: 114968
|
|
|
|
|
|
|
|
| |
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.
llvm-svn: 113555
|
|
|
|
| |
llvm-svn: 113418
|
|
|
|
|
|
|
| |
use of 'struct objc_object*' for 'is' (and others)
in clang.
llvm-svn: 113414
|