Commit Graph

534 Commits

Author SHA1 Message Date
Ted Kremenek c40943224d Remove extra space in warn_maynot_respond diagnostic. Fixes <rdar://problem/7364274>.
llvm-svn: 89013
2009-11-17 00:35:14 +00:00
Fariborz Jahanian 9290ede494 Handle case of missing '@end' in implementation context
gracefully, on par with gcc, by: Issuing a warning,
doing final sematinc check of its definitions and generating
its meta-data.

llvm-svn: 88934
2009-11-16 18:57:01 +00:00
John McCall b0e419e34d Add <foo> = [<bar> nextObject] to the -Widiomatic-parentheses category,
and give that category an explicit test.  Generalize the internal diagnostic
name.

llvm-svn: 86905
2009-11-12 00:06:05 +00:00
Fariborz Jahanian 13e0c90fc1 writable atomic property's setter/getter must be in 'lock' step of
either both synthesized or bith user defined. 
Implements radar 6557233.

llvm-svn: 86887
2009-11-11 22:40:11 +00:00
John McCall 0506e4af2c Apparently the following idiom is specifically encouraged:
if (self = [super init])
Recognize it and only warn if -Wparentheses is explicitly enabled.

llvm-svn: 86790
2009-11-11 02:41:58 +00:00
Ted Kremenek f9a28abe8d Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses <rdar://problem/7381735>.
llvm-svn: 86731
2009-11-10 22:16:29 +00:00
Daniel Dunbar 8b57697954 Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

llvm-svn: 86430
2009-11-08 01:45:36 +00:00
Fariborz Jahanian 3600f41a3a Since default writable attribute is 'assign', allow
specification of 'assign' (no warning to be issued),
when a continuation class makes a 'readonly' attribute
'readwrite' but also specifies the 'assign' attribute.
(this matches gcc's behavior and prevents exessive 
 warnings)/

llvm-svn: 86297
2009-11-06 22:59:12 +00:00
Daniel Dunbar a530841b4f Switch XFAIL format to match LLVM.
llvm-svn: 85880
2009-11-03 07:25:45 +00:00
Fariborz Jahanian a386d9533b Assortment of property attributes declared in continuation
class must match those of same property declared
in its primary class. (Fixes radar 7352425)

llvm-svn: 85843
2009-11-03 00:01:38 +00:00
Fariborz Jahanian de8db16a7d Property declared in continuation class can only be used to
change a readonly property declared in the class (and its inherited protocols)
to writable property. (Fixes radar 7350645).

llvm-svn: 85836
2009-11-02 22:45:15 +00:00
Fariborz Jahanian ec344ed2f5 Diagnose implementation of a property declared in a category
in its class implementation instead of crashing. Fixes radar 7350345.

llvm-svn: 85813
2009-11-02 18:45:36 +00:00
Fariborz Jahanian 6c5a8e2555 This patch computes composite type of two objective-c expressions
used in a conditional expression by finding the most-derived common
super class of the two and qualifies the resulting type by the
intersection of the protocl qualifier list of the two objective-c
pointer types. ( this is continuation of radar 7334235).

llvm-svn: 85554
2009-10-30 01:13:23 +00:00
Fariborz Jahanian ef8b8ce207 Type of a conditional expression with two distinct objective-c
class pointer is the most derived common class of the two.
This is <rdar://problem/7334235>.

llvm-svn: 85337
2009-10-27 23:02:38 +00:00
Mike Stump ab8b2e08c3 Refine noreturn handling. Fixes -Wmissing-noreturn so that it doesn't
complain that functions that have a return statement should be
declared noreturn.  Fixed PR5286.

llvm-svn: 85195
2009-10-27 01:59:05 +00:00
Fariborz Jahanian b14d70413f Changed text of warning in my last patch.
Related to radar:
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

llvm-svn: 84647
2009-10-20 17:24:11 +00:00
Fariborz Jahanian 040d75d9b6 Issue warning if method body starts with a semicolon.
Fixes 
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

llvm-svn: 84645
2009-10-20 16:39:13 +00:00
Daniel Dunbar 88f2300d19 Add a test case demonstrating a situation where we get protocol type checking
right for multiple anonymous categories.

llvm-svn: 83085
2009-09-29 18:51:43 +00:00
Fariborz Jahanian e983d17570 Fix a regression in accessing class getter using the dot-syntax
notation. There is still an issue accessing field of a 'Class''s isa
in legacy code using dot field access notation (as noted in the test case)
but unrelated to this patch.

llvm-svn: 82555
2009-09-22 16:48:37 +00:00
Daniel Dunbar 1188987e23 clang-cc: Remove -ObjC -ObjC++ handling from clang-cc.
llvm-svn: 82103
2009-09-17 00:47:27 +00:00
Anders Carlsson 2898af59dc Update tests
llvm-svn: 81802
2009-09-14 22:00:20 +00:00
Fariborz Jahanian cb1c19147f Using the property dot-syntax to invoke a non-eixsting
structure-valued setter should cause a user error instead of
crash.

llvm-svn: 81769
2009-09-14 16:40:48 +00:00
Fariborz Jahanian f15d4b6050 This patch does the following.
1) Issue digsnostics in non-fragile ABI, when an expression
   evaluates to an interface type (except when it is used to
   access a non-fragile ivar).
2) Issue unsupported error in fragile ABI when an expression
   evaluates to an interface type (except when it is used to
   access a fragile ivar).

llvm-svn: 80860
2009-09-03 00:43:07 +00:00
Fariborz Jahanian 589202d8e6 Added a FIXME to the test case.
llvm-svn: 80840
2009-09-02 21:24:14 +00:00
Fariborz Jahanian 3a964ebdc4 Changed abi mode for these test which are dereferencing
an interface pointer.

llvm-svn: 80836
2009-09-02 21:06:27 +00:00
Fariborz Jahanian f40183f436 Test for my last patch.
llvm-svn: 80740
2009-09-02 00:05:10 +00:00
Fariborz Jahanian 18f4107eb7 test case for my last patch.
llvm-svn: 80382
2009-08-28 17:53:05 +00:00
Fariborz Jahanian a83c016d22 Type of a ?: expression whose either expression is a built-in 'id'
type is 'id' type.

llvm-svn: 79781
2009-08-22 22:27:17 +00:00
Fariborz Jahanian cbf10f5de5 Don't issue warning on multiple selector found when
selector name is for a @selector expression.

llvm-svn: 79776
2009-08-22 21:13:55 +00:00
Fariborz Jahanian 1b5d6133f9 Removed -Wundeclared-selector and -Wreadonly-setter-attrs from
-Wmost group (too noisy). Placed warning on parameter type
misatch between methods in sub and super class under
-Wsuper-class-method-mismatch (also too noisy).

llvm-svn: 79745
2009-08-22 19:24:56 +00:00
Daniel Dunbar 3a4fc4b2ec XFAIL this test for now. David/Steve, please sort out the correct fix.
llvm-svn: 79259
2009-08-17 18:01:54 +00:00
Chris Lattner 2ba5ca9d4f Improve the diagnostic emitted when an unused ObjC property getter
is found.  Instead of complaining about a generic "unused expr",
emit:
t.m:7:3: warning: property access result unused - getters should not have side effects

While objc property getters *could* have side effects, according to
the language best practices, they *shouldn't*.  Hopefully the
diagnostic now gets this across.

llvm-svn: 79192
2009-08-16 16:57:27 +00:00
Ted Kremenek 08479ae7fe Change handling of attribute 'malloc' to only accept the attribute on function
declarations (and not function pointers). This is consistent with GCC. Accepting
this attribute on function pointers means that the attribute should be treated
as a type qualifier, which apparently is not what GCC does. We obviously can
change this later should we desire to enhance the 'malloc' attribute in this
way.

llvm-svn: 79060
2009-08-15 00:51:46 +00:00
Ted Kremenek 8d091dbe13 Add more attribute 'malloc' test cases involving function pointers.
llvm-svn: 79055
2009-08-14 22:06:01 +00:00
Fariborz Jahanian 2e4a46b745 objc2's foreach statement's selector type can be
a block pointer too.

llvm-svn: 79050
2009-08-14 21:53:27 +00:00
Ted Kremenek 026d201eca This test case does not need to include 'stdlib.h'.
llvm-svn: 79042
2009-08-14 20:53:10 +00:00
Ted Kremenek 527042b5a9 Improve Sema's handling of attribute 'malloc' to reject the attribute when
attaching to Objective-C methods (which mirrors GCC's behavior) and to allow the
return type of the function to be an Objective-C pointer or Block pointer (which
GCC also accepts).

Along the way, add 'const' to some of the pointer arguments of various utility
functions...

llvm-svn: 79040
2009-08-14 20:49:40 +00:00
Fariborz Jahanian 83b000c713 Fixed a regression in deciding when to issue warning on properties which
implement NSCopying protocol in GC mode.

llvm-svn: 79008
2009-08-14 18:06:25 +00:00
Fariborz Jahanian 887cd6a8eb error on property of objc interface type instead of crashing
llvm-svn: 78826
2009-08-12 18:17:53 +00:00
Fariborz Jahanian 853d21a18a Warn on use of property dot syntax when unused.
llvm-svn: 78760
2009-08-12 00:45:33 +00:00
Fariborz Jahanian 3f8917abf6 Patch to warn if a property which is 'assign' by default
may not implement NSCopying protocol in -fobjc-gc[-only] mode.

llvm-svn: 78726
2009-08-11 22:02:25 +00:00
Chris Lattner 66a388b859 merge two tests.
llvm-svn: 78705
2009-08-11 20:08:52 +00:00
Chris Lattner f1c9797ffa Fix rdar://7126285: don't warn on unused ObjC property access
that uses "dot syntax" since it might have a side effect.

llvm-svn: 78704
2009-08-11 20:08:03 +00:00
Daniel Dunbar d3a114fe2d Update test case; I don't really understand why packed enums changed this, but
the new havior is better so...

llvm-svn: 78473
2009-08-08 15:47:00 +00:00
Fariborz Jahanian b61af4c566 Some code refactoring. Be more generous in issuance of warning
on method type mismatches per Chris's comment.

llvm-svn: 78075
2009-08-04 17:01:09 +00:00
Fariborz Jahanian 10ff786e1e Compare matching selectors in current and
super class(s) and warn on any parameter
type mismatch if potentially unsafe. 

llvm-svn: 78029
2009-08-04 01:07:16 +00:00
Steve Naroff 53fcbb89f9 Remove an ObjC-specific XFAIL (and tweak test).
llvm-svn: 77454
2009-07-29 15:24:47 +00:00
Steve Naroff 85d9715c24 Fix <rdar://problem/7100524> regression: "error: incompatible operand types ('void *' and 'NSString *')".
Remove XFAIL from 'conditional-expr-4.m' test case (which would have caught this).
Also tweaked several aspects of the test to jive with the current type checking.

llvm-svn: 77453
2009-07-29 15:09:39 +00:00
John McCall 02dee0a46a Semantic checking for main().
Fix some invalid main() methods in the test suite that were nicely
exposed by the new checks.

llvm-svn: 77047
2009-07-25 04:36:53 +00:00
Steve Naroff e87026a08f Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).

Still need back-end CodeGen for ObjCIsaExpr.

llvm-svn: 76979
2009-07-24 17:54:45 +00:00
Steve Naroff 8e6aee5821 Remove a bunch of FIXME's related to ObjC type checking.
- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible(). 
- Tweak several test cases to accommodate the new/improved type checking.

llvm-svn: 76830
2009-07-23 01:01:38 +00:00
Mike Stump 33979f75a0 Add warning for falling off the end of a function that should return a
value.  This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall).  I believe there should be very few false positives, though
the most interesting case would be:

  int() { bar(); }

when bar does:

  bar() { while (1) ; }

Here, we assume functions return, unless they are marked with the
noreturn attribute.  I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.

If anyone spots other false positives, let me know!

llvm-svn: 76821
2009-07-22 23:56:57 +00:00
Steve Naroff 51d4f79ffa Fix <rdar://problem/6770276> Support Class<Proto> syntax.
llvm-svn: 76741
2009-07-22 16:07:01 +00:00
Mike Stump 753d120975 Prep for new warning.
llvm-svn: 76709
2009-07-22 00:43:08 +00:00
Argyrios Kyrtzidis 43cee935ae Remove Sema::LookupObjCImplementation and replace it with just calling ObjCInterfaceDecl::getImplementation().
llvm-svn: 76509
2009-07-21 00:06:04 +00:00
Argyrios Kyrtzidis 6d9fab7619 - Introduce ASTContext::getObjCImplementation() and ASTContext::setObjCImplementation() which use a DenseMap to associate
an interface/category with its implementation (if one exists).

- Introduce ObjCInterfaceDecl::get/setImplementation() and ObjCCategoryDecl::get/setImplementation() that use the above methods.

- Add a compiler error for when a category is reimplemented.

llvm-svn: 76508
2009-07-21 00:05:53 +00:00
Daniel Dunbar a3f41f4bba Some more ?: for Obj-C tests.
llvm-svn: 76125
2009-07-16 23:34:22 +00:00
Daniel Dunbar 0418a5f11e Add more testing of ?: for Obj-C object types.
llvm-svn: 76108
2009-07-16 21:55:48 +00:00
Fariborz Jahanian ca75db7c02 Diagnose ++/-- op on objc pointers in
nonfragile abi, instead of crashing.

llvm-svn: 76088
2009-07-16 17:59:14 +00:00
Steve Naroff a057ba905b Avoid crashing for the enclosed test case.
This is fallout from the recent ObjCObjectPointerType rework. I'll work on fixing this tomorrow.

llvm-svn: 75870
2009-07-16 00:25:06 +00:00
Ted Kremenek d4adebbbd6 Handle some more fallout with the conversion of using PointerType for
Objective-C pointers to using ObjCObjectPointerType.

Now the checking for 'attribute ((nonnull))' in Sema doesn't emit an error when
trying to apply that attribute to a parameter that is an Objective-C pointer
(this is a regression).

To prevent this regression from occuring in the future, the 'nonnull.c' test was
moved to test/SemaObjC and renamed 'nonnull.m'. I also enhanced the tests to
show that function calls involved a NULL Objective-C pointer constant does not
trigger a warning. This is consistent with GCC, but should likely be fixed.

llvm-svn: 75856
2009-07-15 23:23:54 +00:00
Steve Naroff 7183eefdfa Remove cast from test case (cast was incorrectly added as part of http://llvm.org/viewvc/llvm-project?view=rev&revision=75314).
Add new warnings that are being produced.

llvm-svn: 75816
2009-07-15 19:44:23 +00:00
Steve Naroff 1329fa0ed9 Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).
This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.

llvm-svn: 75808
2009-07-15 18:40:39 +00:00
Daniel Dunbar df1cff7356 Remove excessive use of Carbon.h / Cocoa.h in clang tests.
- These kinds of "shotgun" tests are very slow, and do not belong in the
   regression suite. If these kinds of tests are regarded to have value, they
   should be added to the LLVM test-suite.

 - I would actually like to remove all of these tests, but I left Sema/carbon.c
   and SemaObjC/cocoa.m...

llvm-svn: 75399
2009-07-11 23:03:07 +00:00
Steve Naroff 7cae42b07a This patch includes a conceptually simple, but very intrusive/pervasive change.
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. 

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.

llvm-svn: 75314
2009-07-10 23:34:53 +00:00
Fariborz Jahanian 5582f231f2 don't crash if class is using itself as its super class.
llvm-svn: 75178
2009-07-09 22:08:26 +00:00
Fariborz Jahanian 385db80cc5 Diagnose, and not crash, when taking address of property expression.
llvm-svn: 74935
2009-07-07 18:50:52 +00:00
Douglas Gregor c9c02ed8f4 Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.

llvm-svn: 73797
2009-06-19 23:52:42 +00:00
Fariborz Jahanian bada785729 Test case was left behind from my last patch.
llvm-svn: 73519
2009-06-16 17:57:28 +00:00
Eli Friedman 9e81b02ec5 Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility 
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch 
still allows declaring block pointers without a prototype.

llvm-svn: 73041
2009-06-08 04:24:21 +00:00
Fariborz Jahanian 991a2b1933 Diagnose misuse of __strong attribute in a redeclaration.
llvm-svn: 72737
2009-06-02 20:58:58 +00:00
Fariborz Jahanian 6ab4375f87 Issue diagnostics on __weak attribute mismatch.
Fixes an error recovery issue which caused a crash.

llvm-svn: 72733
2009-06-02 18:32:00 +00:00
Eli Friedman 179f2b9ec7 Remove test which doesn't pass with gcc.
llvm-svn: 72714
2009-06-02 05:24:36 +00:00
Fariborz Jahanian 2d725b19da This patch attempts to fix the merging of __strong/__weak attributes
in merge_types. It is incomplete. We probably want to issue 
a warning if user attempts to change the attribute from __weak to
__strong or vice-vera. It also assumes that a __weak/__strong
attribute can not be specified with other (currently one) type
attriute. 

llvm-svn: 72711
2009-06-02 01:40:22 +00:00
Daniel Dunbar 7614192d03 Update test case.
llvm-svn: 72694
2009-06-01 17:27:37 +00:00
Eli Friedman dcca6333c6 Disable type merging with gc attributes. This has a number of nasty
properties at the moment:

1. It allows stuff like "__strong id x; __weak id x;".

2. For constructs like "__strong id x; id x;", subsequent references to 
x lose the objc_gc attribute.

3. This incorrectly allows merges involving the address_space attribute.

4. Constructs like "id x; /* some code using x */ __weak id x;" don't 
apply the objc_gc attribute consistently to all uses of x.

The first three can probably be fixed relatively easily; the fourth 
would be extremely difficult to fix.

llvm-svn: 72683
2009-06-01 01:22:52 +00:00
Fariborz Jahanian 88fead8c48 Cannot type cast @selector expressions.
llvm-svn: 72284
2009-05-22 21:42:52 +00:00
Fariborz Jahanian 162af638a9 Added -fblocks to the test's options.
llvm-svn: 72274
2009-05-22 20:06:10 +00:00
Fariborz Jahanian db3a4c1388 (Next runtime only) check to see if class implements forwardInvocation method
and objects of this class are derived from 'NSProxy'.
Under such conditions, which means that every method possible is 
implemented in the class, we should not issue "Method definition not found" 
warnings.

llvm-svn: 72267
2009-05-22 17:12:32 +00:00
Fariborz Jahanian 8c46fec43d Fixed a warning bug when receiver is an object via
setting of NSObject attribute.

llvm-svn: 72225
2009-05-21 21:04:28 +00:00
Fariborz Jahanian f1c25029b4 implementation of format_arg for ObjC methods/functions.
Still more to do.

llvm-svn: 72173
2009-05-20 17:41:43 +00:00
Eli Friedman 45966b4671 Remove the -arch option from clang-cc: for all practical purposes, it's
redundant with -triple.

llvm-svn: 72108
2009-05-19 11:12:40 +00:00
Fariborz Jahanian 0c20bddc41 Don't warn if result/argument type of an implemented
method is a qualified id which conforms to the matching type
of its method declaration.

llvm-svn: 71817
2009-05-14 23:52:54 +00:00
Fariborz Jahanian 9e87721d47 Look for and diagnose missing sentinel argument on message
dispatch arguments which have sentinel attribute.

llvm-svn: 71737
2009-05-13 23:20:50 +00:00
Fariborz Jahanian d9d6e6e039 Changed wording of warning when attribute is on
method definition.

llvm-svn: 71615
2009-05-13 00:47:33 +00:00
Fariborz Jahanian 2bd617c46c Method attributes may only be specified on method
declarations.

llvm-svn: 71597
2009-05-12 21:36:23 +00:00
Fariborz Jahanian 5276014db2 We want to diagnose sending message to a forward class
and we also want to tell which message is actually 
being sent.

llvm-svn: 71296
2009-05-08 23:45:49 +00:00
Fariborz Jahanian 1bd844da80 Warn if forward class is used as a receiver.
llvm-svn: 71278
2009-05-08 23:02:36 +00:00
Fariborz Jahanian 3e68a1facc Fixes a bug in my last patch. Order of types reversed.
llvm-svn: 71267
2009-05-08 21:10:00 +00:00
Fariborz Jahanian b2ab73d93c More type checking for properties, accessors and
use of dot-syntax expression. This is to match gcc's.

llvm-svn: 71243
2009-05-08 19:36:34 +00:00
Mike Stump 5580bdcaa2 Add a warning for a missing copy attribute on a property that is a
block pointer.  Radar 6441502

llvm-svn: 71190
2009-05-07 23:06:50 +00:00
Fariborz Jahanian 0d451813f9 a forward class declaration matching a typedef name of a class
refers to the underlying class.
This is radar 6859726. Steve, please read the radar for my rational.

llvm-svn: 71181
2009-05-07 21:49:26 +00:00
Mike Stump 1b821b4fc5 Improve semantic checking for blocks. Radar 6441502
llvm-svn: 71145
2009-05-07 03:14:14 +00:00
Daniel Dunbar 4dbaaa6f43 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.

llvm-svn: 71061
2009-05-06 03:16:41 +00:00
Fariborz Jahanian 3baaffba6b Issue a warning in odd case of instance method used
in a 'Class' receiver which is not a root instance
method.

llvm-svn: 70987
2009-05-05 18:34:37 +00:00
Fariborz Jahanian 60637985de ignore weak_import attribute on objc method decls.
llvm-svn: 70901
2009-05-04 19:35:12 +00:00
Daniel Dunbar bdb23a1f56 Fix invalid error about duplicate declaration of padding bit field in
an interface.

llvm-svn: 70652
2009-05-03 01:08:28 +00:00
Fariborz Jahanian 07b7165b50 Check for method type conflict between declaration in
class/protocol and implementation which could be
an imm. implementation or down in the inheritance
hierarchy.

llvm-svn: 70568
2009-05-01 20:07:12 +00:00
Fariborz Jahanian 68592fc9e1 Use of super class ivar to synthesize property is back to being error.
llvm-svn: 70514
2009-04-30 21:39:24 +00:00
Fariborz Jahanian 334df667a3 Change to warning when property uses an ivar in super class
in an @synthesize diective, as it breaks few projects.

llvm-svn: 70441
2009-04-29 23:31:56 +00:00
Fariborz Jahanian bff0167a0b use of an ivar specified on a property @synthesize
and found in super class triggers a diagnostics.

llvm-svn: 70414
2009-04-29 21:45:02 +00:00
Chris Lattner 11a827471e fix PR4021, array and functions decay in the receiver position of an objc message send.
llvm-svn: 70373
2009-04-29 05:48:32 +00:00
Chris Lattner 669e32f8c0 rdar://6827200 - [sema] reject statically allocated arrays of interface types
Upgrade "array of interface" warning to an error.  In addition to being a
terrible idea, this crashes codegen.

llvm-svn: 70178
2009-04-27 01:55:56 +00:00
Chris Lattner edfa8d4557 Change SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to
always return a non-null QualType + error bit.  This fixes a bunch of 
cases that didn't check for null result (and could thus crash) and eliminates
some crappy code scattered throughout sema.

This also improves the diagnostics in the recursive struct case to eliminate
a bogus second error.  It also cleans up the case added to function.c by forming
a proper function type even though the declarator is erroneous, allowing the
parameter to be added to the function.  Before:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^
t.c:4:3: error: use of undeclared identifier 'P'
  P+1;
  ^

After:
t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^

llvm-svn: 70023
2009-04-25 08:47:54 +00:00
Chris Lattner 12bdebbbf7 reject explicit pointer arithmetic on interface pointers in 64-bit objc ABI
llvm-svn: 70004
2009-04-24 23:50:08 +00:00
Fariborz Jahanian 1dcb32260a Avoid issuing spurious errors as side-effect of diagnosing
application of sizeof on an interface.

llvm-svn: 69980
2009-04-24 17:34:33 +00:00
Daniel Dunbar a2666fefd8 We don't accept this test anymore in a non-fragile ABI.
llvm-svn: 69944
2009-04-24 02:11:35 +00:00
Chris Lattner 62975a788e Fix rdar://6821047 - clang crashes on subscript of interface in 64-bit mode
Several changes here:
1. We change Type::isIncompleteType to realize that forward declared 
   interfaces are incomplete.  This eliminate special case code for this
   from the sizeof path, and starts us rejecting P[4] when P is a pointer
   to an incomplete interface.
2. Explicitly reject P[4] when P points to an interface in non-fragile ABI
   mode.
3. Switch the sizeof(interface) diagnostic back to an error instead of a 
   warning in non-fragile abi mode.

llvm-svn: 69943
2009-04-24 00:30:45 +00:00
Fariborz Jahanian 6f0f25b0d8 Diagnose if an implementation implements a forward class
declaration (and avoid issuing bogus error later on).

llvm-svn: 69928
2009-04-23 21:49:04 +00:00
Steve Naroff 3c301dc573 Sema::ActOnStartClassInterface(): Use PushOnScopeChains().
This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate.

llvm-svn: 69891
2009-04-23 15:15:40 +00:00
Chris Lattner d27f8d8c9f rename test
llvm-svn: 69761
2009-04-22 00:59:27 +00:00
Chris Lattner 934074cd5f Fix a problem with objc foreach loop. It turns out that objc mode changes
for scoping to match C99 even when in C89 mode.  This patch fixes this 
(eliminating a "redefinition of thisKey" error), and also prevents non-sensical
diagnostics in -pedantic mode like this:

t.m:7:8: warning: variable declaration in for loop is a C99-specific feature
  for (id thisKey in keys) ;
       ^

llvm-svn: 69760
2009-04-22 00:54:41 +00:00
Mike Stump d79b5a85b0 Tighten up blocks type checking. This was discussed back in the
r56595 timeframe, but left undone.  Radar 6812711

llvm-svn: 69745
2009-04-21 22:51:42 +00:00
Chris Lattner 6750113d54 force a 32-bit triple.
llvm-svn: 69729
2009-04-21 21:42:41 +00:00
Daniel Dunbar d361c345c6 Force triple (test case fails for platforms with the non-fragile ABI).
llvm-svn: 69727
2009-04-21 21:17:29 +00:00
Chris Lattner a8c92540dd temporarily downgrade to a warning.
llvm-svn: 69720
2009-04-21 21:14:41 +00:00
Fariborz Jahanian ece1b2b0e1 Patch to diagnose use of objc's @defs in nonfragile abi.
llvm-svn: 69710
2009-04-21 20:28:41 +00:00
Chris Lattner 37920f5359 reject sizeof(itf) when itf is a forward declared interface, or when
in non-fragile abi mode.  rdar://6811884

llvm-svn: 69701
2009-04-21 19:55:16 +00:00
Daniel Dunbar 108098d56c Fix test typo.
llvm-svn: 69676
2009-04-21 16:03:31 +00:00
Daniel Dunbar 93c1914de3 Use an ASTRecordLayout to compute the sizeof an interface, not
addRecordToClass.
 - Among other things, this fixes a crash when applying sizeof to an
   interface with synthesized ivars, although things still aren't
   "correct" here.

llvm-svn: 69675
2009-04-21 15:48:54 +00:00
Chris Lattner 3501d43a10 implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks

llvm-svn: 69670
2009-04-21 06:11:25 +00:00
Chris Lattner c70dd56477 add support for goto checking and @synchronized blocks,
rdar://6810106

llvm-svn: 69667
2009-04-21 06:01:00 +00:00
Chris Lattner c5f4ab6372 test that vlas are checked in an objc method context.
llvm-svn: 69508
2009-04-19 05:20:37 +00:00
Chris Lattner 508253d64b the scope checker does work with objc methods, add testcase.
llvm-svn: 69487
2009-04-18 22:37:38 +00:00
Chris Lattner b6e368235a I didn't understand how @catches were chained. Now that I get it, fix
the scope checker to not think @catches are nested in each other, eliminating
some bogus notes.

llvm-svn: 69486
2009-04-18 22:35:34 +00:00
Chris Lattner 5c926f3660 reject invalid jumps among pieces of @try blocks. This seems to work
reasonably well except for the problem that @catches are nested within
each other in the AST, giving the ugly diagnostics in L8.

llvm-svn: 69477
2009-04-18 21:28:52 +00:00
Chris Lattner 07f62f1881 improve wording of scope violation error messages.
llvm-svn: 69456
2009-04-18 18:42:55 +00:00
Chris Lattner e227091199 rename test
llvm-svn: 69455
2009-04-18 18:41:40 +00:00
Chris Lattner 960cc525ec rewrite the goto scope checking code to be more efficient, simpler,
produce better diagnostics, and be more correct in ObjC cases (fixing
rdar://6803963).

An example is that we now diagnose:

int test1(int x) {
  goto L;
  int a[x];
  int b[x];
  L:
  return sizeof a;
}

with:

scope-check.c:15:3: error: illegal goto into protected scope
  goto L;
  ^
scope-check.c:17:7: note: scope created by variable length array
  int b[x];
      ^
scope-check.c:16:7: note: scope created by variable length array
  int a[x];
      ^

instead of just saying "invalid jump".  An ObjC example is:

void test1() {
  goto L;
  @try {
L: ;
  } @finally {
  }
}

t.m:6:3: error: illegal goto into protected scope
  goto L;
  ^
t.m:7:3: note: scope created by @try block
  @try {
  ^

There are a whole ton of fixme's for stuff to do, but I believe that this
is a monotonic improvement over what we had.

llvm-svn: 69437
2009-04-18 09:36:27 +00:00
Fariborz Jahanian 3453f7d410 Fix decl type merges when they have
__string/__weak attributes.

llvm-svn: 69229
2009-04-15 21:54:48 +00:00
Fariborz Jahanian 47b21081cb Patch to remove a bogus warning which pointed to underlying AST
gen. issue for property in continuation class declared readwrite 
but which did not generate the declaration for the setter. Fix also
removed a FIXME and resulted in code cleanup.

llvm-svn: 69200
2009-04-15 19:19:03 +00:00
Steve Naroff bb99c5c933 Fixup http://llvm.org/viewvc/llvm-project?rev=69165&view=rev (based on feedback from Eli).
llvm-svn: 69184
2009-04-15 17:31:31 +00:00
Steve Naroff 6f84266619 Revert previous patch (will commit a fix soon).
llvm-svn: 69178
2009-04-15 16:58:41 +00:00
Steve Naroff fab0262047 Fix <rdar://problem/6791490> [clang10 regression] [sema] invalid illegal jump diagnostic.
caused by: <rdar://problem/6252084> [sema] jumps into Obj-C exception blocks should be disallowed.

Sema::RecursiveCalcLabelScopes() and Sema::RecursiveCalcJumpScopes() need to pop the ScopeStack within the statement iteration loop (was outside the loop).

Eli, please review (thanks).

llvm-svn: 69165
2009-04-15 14:38:36 +00:00
Fariborz Jahanian 6c6aea914a Diagnose properties which have no implementations;
either unimplemented setter/getter or no
implementation directive.

llvm-svn: 69098
2009-04-14 23:15:21 +00:00
Steve Naroff 5196c618fb Fix <rdar://problem/6252084> [sema] jumps into Obj-C exception blocks should be disallowed.
This builds on Eli's work from http://llvm.org/viewvc/llvm-project?view=rev&revision=65678.

llvm-svn: 69073
2009-04-14 20:53:38 +00:00
Steve Naroff 06f440dd7b ASTContext::mergeTypes(): Loosen up the type checking for 'Class' (treating it like 'id').
This fixes <rdar://problem/6782722> XCDataTipsManager.m registers, observes notifications in class methods.

The radar above is the result of clang typing 'self' in a class method as 'Class', which results in some spurious warnings (GCC types 'self' in a class method as 'id').

I considered changing the type of 'self' to 'id' (to conform to GCC), however this resulted in *many* test cases breaking. In addition, I really prefer a more strongly typed 'self'.

All in all, this is the least obtrusive fix I could find for removing the spurious warnings (though we do loose some valid warnings).

llvm-svn: 69041
2009-04-14 15:11:46 +00:00
Fariborz Jahanian b6d5b54839 In objc2's None-Fragile ABI, one cannot use the super class ivar for
setter/getter synthesis.

llvm-svn: 68976
2009-04-13 19:30:37 +00:00
Steve Naroff 42959b2660 Change diagnostic as a result of researching <rdar://problem/6779809> missing interface name in "error: cannot declare variable inside a class, protocol or category ''.
Since ObjC 2.0 class "extensions" have a null name, the diagnostic above is actually "correct". Nevertheless, it is confusing. Decided to remove the name entirely (from my perspective, it didn't add any value). Also simplified the text of the diagnostic a bit.

llvm-svn: 68967
2009-04-13 17:58:46 +00:00
Chris Lattner bc670459ad fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.
by making ASTContext::isObjCObjectPointerType accept typedefs of id.

llvm-svn: 68931
2009-04-12 23:51:02 +00:00
Chris Lattner 1e2f763c4c rename test
llvm-svn: 68930
2009-04-12 23:49:38 +00:00
Chris Lattner bdccb0393c add some more coverage.
llvm-svn: 68928
2009-04-12 23:29:27 +00:00
Chris Lattner e1b4174a9a clean up test.
llvm-svn: 68927
2009-04-12 23:27:53 +00:00
Chris Lattner 0177518897 rename test
llvm-svn: 68926
2009-04-12 23:27:31 +00:00
Chris Lattner a2ca03a908 if we already know that a decl is invalid in an @catch, don't verify its type.
llvm-svn: 68925
2009-04-12 23:26:56 +00:00
Chris Lattner 6cc055af1d Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename.  In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful.  For example, we now produce:

t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
       ^

instead of:

t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
             ^

Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:

t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
                   ^

I'd really appreciate any scrutiny possible on this, it 
is a tricky area.

llvm-svn: 68911
2009-04-12 20:42:31 +00:00
Chris Lattner fa6059ff2f rename test
llvm-svn: 68900
2009-04-12 09:04:18 +00:00
Chris Lattner 0d5640c7be Fix rdar://6770142 - Class and qualified id's are compatible, just like
Class and unqualified id's are.

llvm-svn: 68899
2009-04-12 09:02:39 +00:00
Chris Lattner baa405fc4c rename test
llvm-svn: 68898
2009-04-12 08:47:09 +00:00
Chris Lattner 98b30412ab merge protocol-test-1.m -> protocol-test-2.m
llvm-svn: 68897
2009-04-12 08:46:44 +00:00
Chris Lattner 7a9c6d2973 Merge forward-circular into protocol-test-2
llvm-svn: 68896
2009-04-12 08:45:55 +00:00
Chris Lattner 10644fac2f this test is subsumed by protocol-test-2.m
llvm-svn: 68895
2009-04-12 08:44:47 +00:00
Chris Lattner dac168d2a6 Fix rdar://6771034: don't warn on use of forward declared protocol in protocol
list of another protocol definition.  This warning is very noisy and GCC doesn't
produce it so existing code doesn't expect it.

llvm-svn: 68894
2009-04-12 08:43:13 +00:00
Chris Lattner 1c7b885f5f fix typo in test name.
llvm-svn: 68893
2009-04-12 08:37:16 +00:00
Chris Lattner 261b6a5c3a call objc interfaces just "interfaces" in diagnostics, not "Objective-C types"
or "Objective-C interface types" etc.

llvm-svn: 68892
2009-04-12 08:25:48 +00:00
Chris Lattner a8a7d0f371 implement rdar://6780761, making sema reject some code that otherwise
crashes codegen.

llvm-svn: 68891
2009-04-12 08:11:20 +00:00
Chris Lattner 67f35b051b improve the 'conflicting types' diagnostics to include correct location info, now
that it is plumbed through Sema.  On a file from growl, we used to emit:

t.mi:107059:1: warning: conflicting types for 'removePluginHandler:forPluginTypes:'
- (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions {
^
t.mi:105280:1: note: previous definition is here
- (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types;
^

now we produce:

t.mi:107059:55: warning: conflicting parameter types in implementation of 'removePluginHandler:forPluginTypes:': 'id<NSObject>' vs 'id<GrowlPluginHandler>'
- (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions {
                                                      ^
t.mi:105280:45: note: previous definition is here
- (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types;
                                            ^

We still don't have proper loc info for properties, hence the FIXME.

rdar://6782494

llvm-svn: 68879
2009-04-11 19:58:42 +00:00
Chris Lattner 6de05080e4 fix blocks to reject objc interfaces returned by value. Also,
a block without a prototype should still coerce a return in it to
use the declared return type.

llvm-svn: 68875
2009-04-11 19:27:54 +00:00
Chris Lattner 80718823ae fix test
llvm-svn: 68874
2009-04-11 19:18:22 +00:00
Chris Lattner 347eec9d84 diagnose attempts to return objc interfaces by-value from C functions.
llvm-svn: 68873
2009-04-11 19:17:25 +00:00
Chris Lattner de5a531677 Improve the 'cannot pass objc interface by value' diagnostic:
1) improve localizability by not passing english strings in.
2) improve location for arguments.
3) print the objc type being passed.

Before:
method-bad-param.m:15:1: error: Objective-C type cannot be passed by value
-(void) my_method:(foo) my_param
^

after:
method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value
-(void) my_method:(foo) my_param
                        ^

llvm-svn: 68872
2009-04-11 19:08:56 +00:00
Fariborz Jahanian 60331be08d Fix another fallout from defining __weak unconditionally.
llvm-svn: 68834
2009-04-10 22:42:54 +00:00
Daniel Dunbar 670af594d8 Force triple for a number of tests that rely on __weak.
llvm-svn: 68826
2009-04-10 21:23:20 +00:00
Steve Naroff b47acdb2e5 Fix <rdar://problem/6770998> make cast of super illegal (again:-)
llvm-svn: 68659
2009-04-08 23:52:26 +00:00
Fariborz Jahanian fc58ca4af6 Fixed a problem using property syntax on a 'super'
used as receiver.

llvm-svn: 68631
2009-04-08 19:50:10 +00:00
Steve Naroff 65a0089eb7 Fix <rdar://problem/6764172> [sema] crash on invalid.
llvm-svn: 68568
2009-04-07 22:56:58 +00:00
Fariborz Jahanian 9ecb84bb21 Now that we have __weak defined as attribute in all modes,
we must not issue gc-specific errors in non-gc mode.

llvm-svn: 68551
2009-04-07 21:25:06 +00:00
Fariborz Jahanian 69ba935743 Fixes method name lookup when method appears in
the base implementations (and not in
current implementation).

llvm-svn: 68527
2009-04-07 18:28:06 +00:00
Steve Naroff ebc790d4d8 Tweak Sema::ActOnInstanceMessage() to look for a class method when dealing with qualified id's. This change is motivated by our desire to not support the "Class<foo>" idiom. Note that the change makes perfect sense (since all ObjC classes are also id/instances).
This allow us to document a simple migration path...change "Class <foo>" to "id <foo>".

This effects: 
- <rdar://problem/6761939> TASK: File source change radars for "qualified Class" errors
- <rdar://problem/6761864> Protocol qualified Class is unsupported

llvm-svn: 68517
2009-04-07 15:07:57 +00:00
Steve Naroff d338d08f49 Fix typo in newly added test case.
llvm-svn: 68515
2009-04-07 14:22:40 +00:00
Steve Naroff 54e5945297 Change the type of ObjC @ string constants (from NSConstantString->NSString).
This fixes <rdar://problem/6757102> clang type for @"xxx" is "NSConstantString *" (GCC type is "NSString *").

llvm-svn: 68514
2009-04-07 14:18:33 +00:00
Fariborz Jahanian 54d569c51d Warn instead of error on duplicate protocol definitions.
Be kind to so many projects which are doing this (and be
like gcc).

llvm-svn: 68474
2009-04-06 23:43:32 +00:00
Steve Naroff 837dc03222 Make casting 'super' a deprecated warning (instead of a hard error).
This will simplify clang adoption, and is probably better "etiquette" (since gcc has always accepted this idiom without warning). Once we are over the adoption hurdle, we can turn this into an error.

llvm-svn: 68468
2009-04-06 22:07:54 +00:00
Fariborz Jahanian 15e3a5c4b8 writable property in a category of class's superclass
makes the property writable in the current class.
 

llvm-svn: 68446
2009-04-06 16:59:10 +00:00
Fariborz Jahanian 2705859981 Real corener case of a method declared in a protocol
used in a class which declares a property of the same
name. This should not result in an unimplemented
method warning.

llvm-svn: 68409
2009-04-03 21:51:32 +00:00
Chris Lattner 01b8ef2ac4 improve the string literal comparison warning to not call @encode's "string literals".
llvm-svn: 68407
2009-04-03 21:11:28 +00:00
Steve Naroff 3e90e33356 Tweak test (now that http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090330/015001.html is fixed).
llvm-svn: 68364
2009-04-03 01:25:18 +00:00
Fariborz Jahanian 38a5c9650e Fix up lookup rules for properties declared in
objc's continuation class.

llvm-svn: 68339
2009-04-02 18:44:20 +00:00
Steve Naroff d5ca2d0165 Fix http://llvm.org/bugs/show_bug.cgi?id=3907.
llvm-svn: 68338
2009-04-02 18:37:59 +00:00
Steve Naroff 0f55fd9f33 Update test case and comment.
llvm-svn: 68247
2009-04-01 21:27:56 +00:00
Steve Naroff 8d816d6cb5 CodeGenModule::GetAddrOfConstantCFString():
- Finish up support for converting UTF8->UTF16 to support ObjC @"string" constants.

Remove warning from CheckObjCString.

As the FIXME in the test case indicates, I still have a bug to work out (apparently with \u handling).

llvm-svn: 68245
2009-04-01 21:16:31 +00:00
Daniel Dunbar 9ff631039c Forgot to remove trailing &&
llvm-svn: 68220
2009-04-01 18:11:41 +00:00
Daniel Dunbar f46945b274 Ted & I crossed paths here, these tests are in cocoa-pth.m now.
llvm-svn: 68215
2009-04-01 16:59:39 +00:00
Daniel Dunbar f524eff37d Add cocoa-pth.c test case, this got lost in shuffling PTH test cases.
llvm-svn: 68205
2009-04-01 15:36:37 +00:00
Ted Kremenek 455de13de1 Re-enable PTH testing for cocoa.h and carbon.h. This tests that PTH works on
real-world header files and these tests have caught serious bugs in the past.

llvm-svn: 68204
2009-04-01 15:28:20 +00:00
Daniel Dunbar 386ef885bb Pull clang-cc code for generating PTH files based on the input type.
- <rdar://problem/6741594> [pth] don't abuse -x to drive pth
   generation

 - Simpler, and fixes PR3915.

Cleanup test cases for PTH:
 - Update to use -emit-pth

 - Removed PTH test of carbon.c and cocoa.mm; these didn't actually
   verify anything, and since PTH is token based the extra coverage
   (over cocoa.m) isn't particularly helpful.

 - Split PTH tests in cocoa.m to cocoa-pth.m, solely to increase
   available parallelism when running tests.

Ted, could you update the PTH test cases (include-pth.c and
cocoa-pth.m) to have some sort of positive check that the PTH is
getting used? "# of PTH cache hits" or "tokens read from PTH cache"
statistics would work great. :)

llvm-svn: 68189
2009-04-01 05:09:09 +00:00
Mike Stump cafa0a9746 Fix block comparisons. Radar 6732116.
llvm-svn: 68171
2009-04-01 01:17:39 +00:00
Fariborz Jahanian b35b4a9b42 fe support for objc2's nonfragile-abi synthesized ivars.
llvm-svn: 68077
2009-03-31 00:06:29 +00:00
Steve Naroff 389925dc87 Fix <rdar://problem/6697053> instance variable is protected.
Treat @package the same as @public. The documentation for @package says it is analogous to private_extern for variables/functions. Fully implementing this requires some kind of linker support (so access is denied to code outside the classes executable image). I don't believe GCC fully implements this semantic. Will discuss with Fariborz offline.

llvm-svn: 67755
2009-03-26 16:01:08 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Fariborz Jahanian 629aed9327 Issue error if variables are defined inside an objc class,
category or protocol.

llvm-svn: 67450
2009-03-21 18:06:45 +00:00
Fariborz Jahanian d302bbd0c1 When looking for property name (or getter method) in a
dot-syntax expression after earching the list of protocols
in the qualified-id, must keep searching the protocol list
of each of the protocols in the list.

llvm-svn: 67314
2009-03-19 18:15:34 +00:00
Mike Stump 38cae30095 Ignore weak import on properties.
llvm-svn: 67205
2009-03-18 15:05:17 +00:00
Daniel Dunbar 94d48e0bd0 Force triple for a couple test cases.
llvm-svn: 66974
2009-03-13 22:48:51 +00:00
Steve Naroff 28a531e003 Implement FIXME related to <rdar://problem/6496506> Implement class setter/getter for properties.
llvm-svn: 66689
2009-03-11 20:12:18 +00:00
Steve Naroff aa82be2b5b Fix <rdar://problem/6655054> clang issues bogus error on property usage in a dot-syntax.
llvm-svn: 66659
2009-03-11 15:15:01 +00:00
Steve Naroff 1d984fe2bd Fix <rdar://problem/6578665> user declared setter method should be used when using property syntx.
llvm-svn: 66658
2009-03-11 13:48:17 +00:00
Chris Lattner 6e76e592a3 Improve the "bad receiver" warning for ObjC message sends to be less confusing.
llvm-svn: 66635
2009-03-11 03:47:47 +00:00
Chris Lattner 1897de1c38 Fix PR3766, a really nasty silent miscompilation case where we emitted
a warning and then threw away the AST.  While I'm in there, tighten up the
code to actually reject completely bogus cases (sending a message to a 
struct).  We still allow sending a message to an int, which doesn't make
sense but GCC allows it and is easy to support.

llvm-svn: 66468
2009-03-09 21:19:16 +00:00
Steve Naroff 9527bbfc08 Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(
This fixes <rdar://problem/6496506> Implement class setter/getter for properties.

llvm-svn: 66465
2009-03-09 21:12:44 +00:00