Commit Graph

616 Commits

Author SHA1 Message Date
Anders Carlsson 4fc229ef69 Move some Objective-C tests to SemaObjC and CodeGenObjC.
llvm-svn: 126175
2011-02-22 01:23:29 +00:00
Richard Smith 23eb9f707b In Objective-C, there are no trailing return types, so don't produce diagnostics suggesting they are missing.
llvm-svn: 126174
2011-02-22 01:22:29 +00:00
Fariborz Jahanian d7b0cb5388 Warn when type modifiers on objc method declarations in
protocols do not match with method implementation.
// rdar://7076235

llvm-svn: 126162
2011-02-21 23:49:15 +00:00
Fariborz Jahanian 786e04cda5 Turn on 'auto' in plain objc mode.
llvm-svn: 126134
2011-02-21 18:37:13 +00:00
Fariborz Jahanian f5bfc46c95 Remove warning on future change in ivar lookup rule
when doing the property default synthesis.
// rdar://9027673.

llvm-svn: 126128
2011-02-21 17:31:28 +00:00
Anders Carlsson ce8dd3a5d4 Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).
llvm-svn: 126061
2011-02-19 23:53:54 +00:00
Fariborz Jahanian 0dcb2a0d99 Test case for // rdar://8850818
llvm-svn: 125982
2011-02-18 22:37:54 +00:00
Douglas Gregor af2a6ae429 Selector::getIdentifierInfoForSlot() can return NULL values, a fact
that was ignored in a few places (most notably, code
completion). Introduce Selector::getNameForSlot() for the common case
where we only care about the name. Audit all uses of
getIdentifierInfoForSlot(), switching many over to getNameForSlot(),
fixing a few crashers.

Fixed <rdar://problem/8939352>, a code-completion crasher.

llvm-svn: 125977
2011-02-18 22:29:55 +00:00
Fariborz Jahanian 5fc74804a6 Improve diagnostics on missing property decl.
llvm-svn: 125752
2011-02-17 17:30:05 +00:00
Fariborz Jahanian 05d389f407 Improve diagnostics when property names an object type of
a forward class. // rdar://8851803

llvm-svn: 125699
2011-02-17 01:26:14 +00:00
Fariborz Jahanian d33ab8c635 Warn if method for a deprecated method is implemented.
Warn if class for a deprecated class is implemented.
Warn if category for a deprecated class is implemented.
All under control of -Wdeprecated-implementations.
// rdar://8973810.

llvm-svn: 125545
2011-02-15 00:59:30 +00:00
Ted Kremenek 05e63e0e37 Put "incomplete implementation" warning under a flag.
llvm-svn: 125535
2011-02-14 23:59:16 +00:00
Fariborz Jahanian 178259710a Fix a block sema bug where result type of initializer
is unqualified but its initialized is qualified.
This is for c only and fixes the imm. problem.
c++ is more involved and is wip.
// rdar://8979379

llvm-svn: 125386
2011-02-11 18:46:17 +00:00
Fariborz Jahanian ca3566fc20 Fix scoping of method declarations and issue
warning when same parameter name used multiple times.
// rdar://8877730

llvm-svn: 125229
2011-02-09 22:20:01 +00:00
Fariborz Jahanian 87967425f9 Support for objextive-c++ use of property-dot syntax as receiver
in liu of a class method getter. 
// rdar://8962253

llvm-svn: 125094
2011-02-08 18:05:59 +00:00
Fariborz Jahanian 14889fc671 Support for objc use of property-dot syntax as receiver
in liu of a class method getter. objc++ uses a different
code path and is more involved (TBD).

llvm-svn: 125061
2011-02-08 00:23:07 +00:00
Ted Kremenek e6a12a97d4 Move uninitialized variable checking back under -Wuninitialized-experimental. It is clear from user feedback that this warning is not quite ready.
llvm-svn: 125007
2011-02-07 17:38:38 +00:00
Fariborz Jahanian a533af7d98 Restore a test which I accientally overwrote in my last
patch.

llvm-svn: 124911
2011-02-04 23:30:23 +00:00
Fariborz Jahanian c9b7c209bb -Wselector should warn on implemented selectors only
when selector metadata is generated, which is triggered 
by at least on class implementation. This is to match gcc's
behavior. // rdar://8851684.

llvm-svn: 124909
2011-02-04 23:19:27 +00:00
Ted Kremenek d68ec818c3 Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to anything but a instance method to a warning.
llvm-svn: 124858
2011-02-04 06:54:16 +00:00
Ted Kremenek b3dbe28e31 Based on user feedback, swap -Wuninitialized diagnostics to have the warning refer to the bad use, and the note to the variable declaration.
llvm-svn: 124758
2011-02-02 23:35:53 +00:00
Argyrios Kyrtzidis b5b5a59f18 Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
llvm-svn: 124620
2011-01-31 23:20:03 +00:00
Argyrios Kyrtzidis dd88dbf9d2 Add -Wcustom-atomic-properties which warns if an atomic-by-default property has custom getter or setter.
The rationale is that it is highly likely that the user's getter/setter isn't atomically implemented. Off by default.
Addresses rdar://8782645.

-Wcustom-atomic-properties and -Wimplicit-atomic-properties are under the -Watomic-properties group.

llvm-svn: 124609
2011-01-31 21:34:11 +00:00
Ted Kremenek 4058d87ad5 Teach -Wuninitialized about ObjC fast enumeration loops.
llvm-svn: 124347
2011-01-27 02:01:31 +00:00
Fariborz Jahanian 9312fcc2d3 Tweak the rule for deciding if a provisional ivar is needed
in default ivar synthesis.  Fixes // rdar://8913053.

llvm-svn: 124258
2011-01-26 00:57:01 +00:00
John McCall 4bb483629f Change the wording of the bad-decl-for-attribute warning and error
to make it clear that we're talking about the declarations and not the types.

llvm-svn: 124175
2011-01-25 03:51:08 +00:00
Ted Kremenek 499897b463 Tweak diagnostic:
error: no super class declared in @interface for 'XXX'

to be:

  error: 'X' cannot use 'super' because it is a root class

The latter explains what the user actually did wrong.

Fixes: <rdar://problem/8904409>
llvm-svn: 124074
2011-01-23 17:21:34 +00:00
Ted Kremenek 18f4a755a3 Add test case for <rdar://problem/8891119>. In
earlier revisions Clang was incorrectly warning
about an incomplete @implementation when a property
was getting synthesized.  This got fixed somewhere
down the line.

llvm-svn: 123939
2011-01-20 19:45:14 +00:00
Fariborz Jahanian a61f676cfe Don't warn on missing 'copy' attribute on a 'block'
property when it is 'readonly'. // rdar://8820813

llvm-svn: 122923
2011-01-05 23:00:04 +00:00
Fariborz Jahanian 3aa19e9a70 Fold -fobjc-nonfragile-abi2 into -fobjc-nonfragile-abi.
// rdar://8818375

llvm-svn: 122831
2011-01-04 20:05:20 +00:00
Fariborz Jahanian c63f1c5ab6 Guard lazy synthesis of provisional ivars under the new
-fobjc-default-synthesize-properties flag.

llvm-svn: 122757
2011-01-03 18:08:02 +00:00
Ted Kremenek 1d56c9eed7 Add -fobjc-default-synthesized-properties flag
to allow us to explicitly control whether or
not Objective-C properties are default synthesized.
Currently this feature only works when using
the -fobjc-non-fragile-abi2 flag (so there is
no functionality change), but we can now turn
off this feature without turning off all the features
coupled with -fobjc-non-fragile-abi2.

llvm-svn: 122519
2010-12-23 21:35:43 +00:00
Fariborz Jahanian 0f0b302ffe Complain on missing property getter method only
if property-dot expression is decidedly
an rvalue. // rdar://8155806.

llvm-svn: 122430
2010-12-22 19:46:35 +00:00
Fariborz Jahanian 7d6e11a192 Warn when message is sent to receiver of
unknown type and there is a possibility that
at runtime method is resolved to a deprecated or 
unavailable method.  Addreses // rdar://8769853

llvm-svn: 122294
2010-12-21 00:44:01 +00:00
Fariborz Jahanian 382c040da2 Warn when synthesizing a property which is
implicitly atomic under -Wimplicit-atomic-properties
flag. // rdar://8774580

llvm-svn: 122095
2010-12-17 22:28:16 +00:00
Fariborz Jahanian 7cabbe04eb Improve diagnostics when property being looked up
in a forward @class object. // rdar://8774513

llvm-svn: 121933
2010-12-16 00:56:28 +00:00
Fariborz Jahanian 522eb7b894 ivars craeted for explicit @synthesize and those
created for auto-synthesis are @private.
Fixes: // rdar://8769582

llvm-svn: 121913
2010-12-15 23:29:04 +00:00
Fariborz Jahanian 5d7e9160e7 Enhance my implementation of //rdar ://8747333 in r121597 to allow
for declaration of property setter/getter in forward
class extensions and also skip over
propeties which are @dynamic.

llvm-svn: 121617
2010-12-11 18:39:37 +00:00
Fariborz Jahanian c21f543bc4 Any property declared in a class extension might have user
declared setter or getter in current class extension or one
of the other class extensions. Mark them as synthesized as
property will be synthesized when property with same name is
seen in the @implementation. This prevents bogus warning
about unimplemented methods to be issued for these methods.
Fixes // rdar://8747333

llvm-svn: 121597
2010-12-10 23:36:33 +00:00
Fariborz Jahanian aae7926e79 Added remaining objective-c library builtins (as in gcc) to
clang. // rdar://8735023

llvm-svn: 121441
2010-12-10 00:39:16 +00:00
Fariborz Jahanian ecbbb6e9ba Diagnose when accessing property in a class method and
no property accessor class method to be found, instead of
crashing in IRGen. // rdar://8703553

llvm-svn: 120855
2010-12-03 23:37:08 +00:00
Fariborz Jahanian fb40bda54e Improve on objc diagnostics. // rdar://8721692
llvm-svn: 120737
2010-12-02 21:00:16 +00:00
Fariborz Jahanian 68500913ec When unknown method is sent to a receiver of
'Class' type, disgnostic should refere to a
class method. Fixes // rdar://8592156

llvm-svn: 120517
2010-12-01 01:07:24 +00:00
Fariborz Jahanian 1fdbaa84aa Add objc_getClass as an objc builtin function
(// rdar://8592641). Also rename LANGUAGEID to
LanguageID.

llvm-svn: 120437
2010-11-30 18:25:34 +00:00
Fariborz Jahanian 8046af7d50 Warn if direct accessing synthesized ivar backing the property in
nonofragile-abi2. Fixes //rdar://8673791

llvm-svn: 119543
2010-11-17 19:41:23 +00:00
Fariborz Jahanian a0a9d85a5d Check for duplicate declaration of a property in current and
other class extensions. // rdar://7629420

llvm-svn: 118689
2010-11-10 18:01:36 +00:00
John McCall ad31b5f2cb Propagate the deprecated and unavailable attributes from a
@property declaration to the autogenerated methods.  I'm uncertain
whether this should apply to attributes in general, but these are
a reasonable core.

Implements rdar://problem/8617301

llvm-svn: 118676
2010-11-10 07:01:40 +00:00
Fariborz Jahanian d11da7e52a Restore patch reversed in r118475. Fixes
// rdar://8632525

llvm-svn: 118634
2010-11-09 21:38:20 +00:00
Fariborz Jahanian 1e2d01e77d Remove this test for now.
llvm-svn: 118476
2010-11-09 02:24:38 +00:00
Fariborz Jahanian 115393ce66 Remove space from rdar URIs.
llvm-svn: 118474
2010-11-09 02:16:57 +00:00