Commit Graph

942 Commits

Author SHA1 Message Date
Fariborz Jahanian 836914c0aa fixes radar no. in this test.
llvm-svn: 157642
2012-05-29 19:59:25 +00:00
Fariborz Jahanian b5dd2cb13c objective-c: fix a sema and IRGen crash when property
getter result type is safe but does not match with property 
type resulting in spurious warning followed by crash in
IRGen. // rdar://11515196

llvm-svn: 157641
2012-05-29 19:56:01 +00:00
Fariborz Jahanian f021889036 -Wdeprecated warning to include reference (as a note)
to the declaration in this patch. // rdar://10893232

llvm-svn: 157537
2012-05-27 16:59:48 +00:00
Fariborz Jahanian f3b7681f2b Change warning to error when property setter names conflict.
// rdar://11528439

llvm-svn: 157517
2012-05-26 16:10:06 +00:00
Fariborz Jahanian 3f88afad2f objective-c: warn on use of property setters
backing two propeties because proprty names
match except for first letter being of different
case. // rdar://11528439, [PR12936].

llvm-svn: 157435
2012-05-24 22:48:38 +00:00
Fariborz Jahanian 246f519a51 objective-c: Fixes a corner case and interesting bug.
Where diagnostic about unfound property is not
issued in the context where a setter is looked up
in situation in which name and property name differ 
in their first letter case. // rdar://11363363

llvm-svn: 157407
2012-05-24 18:29:41 +00:00
Fariborz Jahanian 870265636c objc: change option to be -Wobjc-interface-ivars
llvm-svn: 157394
2012-05-24 16:19:51 +00:00
Fariborz Jahanian b52d8d2e5f objective-c: When default synthesizing readonly IBOutlet properties
provide a 'fixit' to change 'readonly' to 'readwrite'. // rdar://11448209

llvm-svn: 157193
2012-05-21 17:02:43 +00:00
Fariborz Jahanian 199a9b57a6 objective-c: Warn if default synthesizing readonly IBOutlet properties
and provide a 'fixit' to change 'readonly' to 'readwrite'. 'fixit'
part needs little more work. // rdar://11448209

llvm-svn: 157121
2012-05-19 18:17:17 +00:00
Fariborz Jahanian d945ce5fb7 objc: use "class extension" instead of "continuation class"
to match documentation. // rdar://11309706

llvm-svn: 157074
2012-05-18 21:22:49 +00:00
Fariborz Jahanian b4bef15ae6 Another test for r157025 <rdar://problem/11460990>.
llvm-svn: 157034
2012-05-18 00:19:25 +00:00
Douglas Gregor 0bf70f4be8 A selector match between two Objective-C methods does *not* guarantee
that the methods have the same number of parameters, although we
certainly assumed this in many places. Objective-C can be insane
sometimes. Fixes <rdar://problem/11460990>.

llvm-svn: 157025
2012-05-17 23:13:29 +00:00
Douglas Gregor c5928afb69 In the override search for Objective-C methods, protect against ASTs that have NULL interfaces behind a category, which can happen in invalid code. Fixes <rdar://problem/11478173>, a recent regression
llvm-svn: 157021
2012-05-17 22:39:14 +00:00
Fariborz Jahanian 0ebc0fa974 objective-c: perform strict type checking on property
type and its accessor type and issue error if types
are incompatible, instead of crashing in IRgen.
// rdar://1105153

llvm-svn: 156871
2012-05-15 22:37:04 +00:00
Argyrios Kyrtzidis 8e6951d81b Allow objc @() syntax for enum types.
Previously we would reject it as illegal using a value of
enum type and on ObjC++ it was illegal to use an enumerator
as well.

rdar://11454917

llvm-svn: 156843
2012-05-15 19:17:44 +00:00
Fariborz Jahanian 3da7775a6d objc: avoid duplicate diagnostics on certain type mismatches
between property and its backing ivar.

llvm-svn: 156832
2012-05-15 18:12:51 +00:00
Fariborz Jahanian e1ada58ef4 Remove word 'block' from option and diagnostic I added
in r156825.

llvm-svn: 156831
2012-05-15 17:43:16 +00:00
Fariborz Jahanian 80297b1d90 objective-c nonfragile abi: discourage ivar declarations
in @interface by issuing warning (off by default) under
opt'ed in flag -Winterface-block-ivar. // rdar://10763173

llvm-svn: 156825
2012-05-15 16:33:04 +00:00
Fariborz Jahanian 16d71bb834 objc: allow typedef'ing an id to a pointer to a c-struct only.
// rdar://11356439

llvm-svn: 156788
2012-05-14 22:48:56 +00:00
Jordy Rose 4af4487ba4 Only check NSArray/NSDictionary boxing method params once.
Once we've found a "good" method, we don't need to check its argument types
again. (Even if we might have later found a "bad" method, we were already
caching the method we first looked up.)

llvm-svn: 156719
2012-05-12 17:32:56 +00:00
Jordy Rose 890f4577b1 Don't crash on boxed strings when +stringWithUTF8String: is missing.
Also, unify some diagnostics for boxed expressions that have the same form.

Fixes PR12804.

llvm-svn: 156713
2012-05-12 15:53:41 +00:00
Argyrios Kyrtzidis 9b4fe35689 Don't crash when using objc boxed expression with parsing error.
rdar://11426994

llvm-svn: 156565
2012-05-10 20:02:36 +00:00
John McCall 0bd3e404af Bind cleanups after doing l2r conversion on the operand of a
@throw expression;  l2r conversion can introduce new cleanups
in certain cases, like when the expression is an ObjC property
reference of retainable type in ARC.

llvm-svn: 156425
2012-05-08 21:41:25 +00:00
Jean-Daniel Dupas 2b7da83759 Inhibit ObjC format warning only in system headers (NSLocalizedString).
Add a test case for the related NSAssert workaround.

llvm-svn: 156205
2012-05-04 21:08:08 +00:00
Fariborz Jahanian d5f34f9fee objective-c: warn for properties being default synthesized
under -Wobjc-missing-property-synthesis which must be
opted-in. // rdar://11295716

llvm-svn: 156078
2012-05-03 16:43:30 +00:00
Eli Friedman 169ec35bb3 Add a missing RequireCompleteType call when synthesizing properties. <rdar://problem/11333367>.
While I'm here, fix source locations for other diagnostics related to property synthesis.

llvm-svn: 155953
2012-05-01 22:26:06 +00:00
David Blaikie afd3d0ba40 Fix test cases broken by 155936.
llvm-svn: 155948
2012-05-01 21:29:03 +00:00
Ted Kremenek 124066c5cb Place several uncovered warnings under warning flags, and tweak diagnostic output including the term "gc" (in lowercase).
llvm-svn: 155892
2012-05-01 05:56:02 +00:00
Fariborz Jahanian 08a1eb77c5 with -Wdeprecated, include a note to its deprecated declaration
location. // rdar://10893232

llvm-svn: 155385
2012-04-23 20:30:52 +00:00
Fariborz Jahanian 344d65c248 objective-c arc: With currnt documentation,
objc_returns_inner_pointer attribute can be applied to
methods only. Diagnsose otherwise, instead of
crashing. // rdar://11253688

llvm-svn: 155245
2012-04-20 22:00:46 +00:00
Fariborz Jahanian d155c78d18 objective-arc: Retune my previous patch so warning
is issued on weak property as receiver and not on
any other use of a weak property. // rdar://10225276

llvm-svn: 155169
2012-04-19 23:49:39 +00:00
Fariborz Jahanian fce89c609d objective-c arc: Issue warning under -Wreceiver-is-weak
if receiver is a 'weak' property, by type or by attribute.
// rdar://10225276

llvm-svn: 155159
2012-04-19 21:44:57 +00:00
Patrick Beard 0caa39474b Implements boxed expressions for Objective-C. <rdar://problem/10194391>
llvm-svn: 155082
2012-04-19 00:25:12 +00:00
Fariborz Jahanian b525b52987 objective-c: Issue diagnostic when an implicit
property accessor (getter) missing, instead of crashing.
// rdar://11273060

llvm-svn: 155036
2012-04-18 19:13:23 +00:00
Fariborz Jahanian 29898f4565 objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426. 

llvm-svn: 154861
2012-04-16 21:03:30 +00:00
John McCall d239387098 When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups,
we should flag that in the enclosing function, not in the block
that we're about to pop.

llvm-svn: 154646
2012-04-13 01:08:17 +00:00
Fariborz Jahanian e2b037d6ea objective-c literals: Issue warning and ignore
when BOOL is not of an intergal type when
boolean literals are used. // rdar://11231426

llvm-svn: 154619
2012-04-12 21:24:56 +00:00
Patrick Beard acfbe9e1f2 Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>

llvm-svn: 154187
2012-04-06 18:12:22 +00:00
Fariborz Jahanian c806b90717 objective-c: Don't warn when a category does not implement a method
declared in its adopted protocol when another category declares it  
because that category will implement it. // rdar://11186449

llvm-svn: 154132
2012-04-05 22:14:12 +00:00
Fariborz Jahanian 6bd2226037 objc-arc: provide a warning when 'receiver' of a message is 'weak'
in arc mode and opted-in with -Wreceiver-is-weak flag.
// rdar://10225276

llvm-svn: 154042
2012-04-04 20:05:25 +00:00
John McCall bc15335e58 Handle placeholder expressions in an ObjC for-collection loop.
The way we handle this implicitly removes the ability to use
property l-values in this position, but that's really okay.

llvm-svn: 153729
2012-03-30 05:43:39 +00:00
John McCall 67cd5e094e Forbid the block and lambda copy-capture of __autoreleasing variables
in ARC, under the usual reasoning limiting the use of __autoreleasing.

llvm-svn: 153725
2012-03-30 05:23:48 +00:00
Eli Friedman 410fc7ae89 Make sure we perform the relevant implied conversions correctly for ObjC methods with related result types. PR12384.
llvm-svn: 153716
2012-03-30 01:13:43 +00:00
Fariborz Jahanian e798ba4b67 Fix typo in my last patch.
llvm-svn: 153602
2012-03-28 21:13:53 +00:00
Fariborz Jahanian ba0afde486 objective-c: Improve diagnostics and
provide 'fixit' hint when dictionary index 
is not of proper type. // rdar://11062080

llvm-svn: 153584
2012-03-28 17:56:49 +00:00
Argyrios Kyrtzidis 822c433a27 Make sure we don't accept an @interface inside another objc container
just because there was an attribute in front of it.

llvm-svn: 153355
2012-03-23 23:24:23 +00:00
Ted Kremenek c08c475fe0 Support '%p' format specifier with block pointers.
llvm-svn: 152839
2012-03-15 21:22:27 +00:00
Argyrios Kyrtzidis 3b60cffa22 Fix crash at @implementation with a forward reference as base class.
rdar://11020003

llvm-svn: 152596
2012-03-13 01:09:36 +00:00
Richard Smith c5b0552055 Fix parsing of type-specifier-seq's. Types are syntactically allowed to be
defined here, but not semantically, so

  new struct S {};

is always ill-formed, even if there is a struct S in scope.

We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being
under-loved (due to it only being used in a few places) so merge it into
ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this
required improving ParseDeclarationSpecifiers' diagnostics in some cases. This
also required teaching ParseSpecifierQualifierList about constexpr... which
incidentally fixes an issue where we'd allow the constexpr specifier in other
bad places.

llvm-svn: 152549
2012-03-12 07:56:15 +00:00
Fariborz Jahanian c8a322a407 lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//10988847

llvm-svn: 152420
2012-03-09 18:47:16 +00:00