Commit Graph

549 Commits

Author SHA1 Message Date
Fariborz Jahanian c080a333ce Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061

llvm-svn: 115683
2010-10-05 21:02:11 +00:00
Fariborz Jahanian 3567c426c4 Patch to support transparent_union arguments
passed to nonnull attributed functions. Implements radar
6857843.

llvm-svn: 114917
2010-09-27 22:42:37 +00:00
Fariborz Jahanian cb67d7b7c2 Issue warning for trivial cases of nonnull attributes
(on functions with no pointer arguments) but only when
the attribute has not been coming from a macro 
instantiation in a header file. Fixes first part
of radar 6857843.

llvm-svn: 114860
2010-09-27 19:05:51 +00:00
Argyrios Kyrtzidis 40cec8326c Revert r114316, -Wunused-value enabled by default was intended.
llvm-svn: 114318
2010-09-19 23:03:35 +00:00
Argyrios Kyrtzidis 3698bf1c6d Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.
llvm-svn: 114316
2010-09-19 21:21:44 +00:00
Douglas Gregor 29d907de03 When we run into an error parsing or type-checking the left-hand side
of a binary expression, continue on and parse the right-hand side of
the binary expression anyway, but don't call the semantic actions to
type-check. Previously, we would see the error and then, effectively,
skip tokens until the end of the statement. 

The result should be more useful recovery, both in the normal case
(we'll actually see errors beyond the first one in a statement), but
it also helps code completion do a much better job, because we do
"real" code completion on the right-hand side of an invalid binary
expression rather than completing with the recovery completion. For
example, given

  x = p->y

if there is no variable named "x", we can still complete after the p->
as a member expression. Along the recovery path, we would have
completed after the "->" as if we were in an expression context, which
is mostly useless.

llvm-svn: 114225
2010-09-17 22:25:06 +00:00
Fariborz Jahanian b3e8712a14 Diagnose use of incomplete type on method argument type of
method definitions instead of crashing in code gen.
Fixes radar 8421082.

llvm-svn: 114223
2010-09-17 22:07:07 +00:00
Chris Lattner bb3bcd868a fix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers
llvm-svn: 114209
2010-09-17 21:12:38 +00:00
Ted Kremenek 0f107e4386 Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn
in this case, and the attribute is trivially satisfied (and benign).  Fixes <rdar://problem/8364828>.

llvm-svn: 113464
2010-09-09 01:17:32 +00:00
Fariborz Jahanian 5138b62edc Test removed.
llvm-svn: 113428
2010-09-08 22:36:14 +00:00
Fariborz Jahanian 40efc0feb4 Fix a crash when overloading id with objc_object*.
Radar 8400356.

llvm-svn: 113397
2010-09-08 20:08:18 +00:00
Chris Lattner 938cebc076 "const id<NSFoo> *" instead of "id<NSFoo> const *".
I think this wraps up all the legal cases.

llvm-svn: 113096
2010-09-05 00:43:21 +00:00
Chris Lattner 24b89469ac 'const std::type_info*' instead of 'std::type_info const*'
llvm-svn: 113092
2010-09-05 00:17:29 +00:00
Chris Lattner 53fa04909c make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning.  As usual, the most
fun with this sort of change is updating all the testcases.

llvm-svn: 113090
2010-09-05 00:04:01 +00:00
Chris Lattner 0073962025 when emitting an error about a missing } in a compound statement, emit
a "to match this {" note, pointing out the opener.

llvm-svn: 112709
2010-09-01 15:49:26 +00:00
Eric Christopher 52d5ec11cc Fix typo in error message and testcase.
llvm-svn: 112115
2010-08-25 23:45:44 +00:00
Fariborz Jahanian 54d75f6925 No need to default synthesize property if implementation
has its own getter and setter methods declared.
Fixed 8349319 (nonfragile-abi2).

llvm-svn: 112003
2010-08-25 00:31:58 +00:00
Fariborz Jahanian 76b35379f5 Fix a bug in nonfragile-abi2 when attempting to diagnose
previous use of a synthesized 'ivar' with property of same name
declared as @dynamic. In this case, 'ivar' is in the
inherited class and no diagnostics should be issued.

llvm-svn: 111940
2010-08-24 18:48:05 +00:00
Fariborz Jahanian 9d7d3d84ac Diagnose if type of iboutletcollection attribute is a builtin type.
llvm-svn: 111324
2010-08-17 23:19:16 +00:00
Fariborz Jahanian 798f83239c Diagnose use of iboutletcollection on ivar/property
of non-object types. Radar 8308053.

llvm-svn: 111296
2010-08-17 21:39:27 +00:00
Fariborz Jahanian b5d59b66c2 Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.

llvm-svn: 111275
2010-08-17 20:23:12 +00:00
Fariborz Jahanian 99311ba1a8 Diagnose assiging to an interface object in
non-fragile abi mode as sizes are not statically known.
Fixes radar 8315734.

llvm-svn: 111191
2010-08-16 21:51:12 +00:00
Fariborz Jahanian 18d90a97df When issuing warning for future conflict resolution,
(nonfragile-abi2), do not consider 'ivar' access
in class methods. Also, improve on diagnostics.
Radar 8304561.

llvm-svn: 111023
2010-08-13 18:09:39 +00:00
Fariborz Jahanian 753783a062 Fixes block type matching bug. Radar 8302845.
llvm-svn: 110950
2010-08-12 20:46:12 +00:00
Douglas Gregor 62157e5342 Downgrade error about nonnull attribute bbeing applied to a function without point arguments to a warning
llvm-svn: 110939
2010-08-12 18:48:43 +00:00
Fariborz Jahanian 0bce17e572 Change text of diagnostics on user request.
radar 7948654.

llvm-svn: 110857
2010-08-11 21:22:15 +00:00
Fariborz Jahanian d539d098a4 IRGen support for functions returning objc object
types. Fixes PR7865.

llvm-svn: 110832
2010-08-11 17:37:35 +00:00
Fariborz Jahanian 32e59ba01d Fix a spurious warning when message sent to qualified-id
type receiver (pr7861).

llvm-svn: 110696
2010-08-10 18:10:50 +00:00
Fariborz Jahanian 3337b2e8dd Implements gcc's -Wstrict-selector-match.
(radar 8127244).

llvm-svn: 110622
2010-08-09 23:27:58 +00:00
Fariborz Jahanian ec43022b99 Warn if class object does not implement qualified
id's protocols. Fixes radar 8154220.

llvm-svn: 110583
2010-08-09 18:21:43 +00:00
Douglas Gregor 114e55df5b Fix an Objective-C crasher, PR7839.
llvm-svn: 110515
2010-08-07 12:29:18 +00:00
Fariborz Jahanian 7b70eb4bb1 Tighten the rules when deciding if an ivar must be
auto-synthesized (nonfragile-abi2 specific).
Fixes radar 8251648.

llvm-svn: 109866
2010-07-30 16:59:05 +00:00
Ted Kremenek 28e1c9155e Don't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.
llvm-svn: 109833
2010-07-30 00:47:46 +00:00
Fariborz Jahanian c15dfd8a87 Tigthen the condition for issung ivar shadowing
variables to those in file scope (nonfragile-abi2).
Fixes radar 8248681.

llvm-svn: 109758
2010-07-29 16:53:53 +00:00
Fariborz Jahanian 86151343b4 Warn when property ivar lookup finds a global variable
of same name. In nonfragile-abi2, lookup accesses a synthesized
ivar. This is a transition warning.  Radar 8225011.

llvm-svn: 109197
2010-07-22 23:33:21 +00:00
Ted Kremenek 1ddd6d2b6b Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior. Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent.  We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.

Fixes <rdar://problem/8213093>.

llvm-svn: 109033
2010-07-21 20:43:11 +00:00
Fariborz Jahanian 3c7ebc3a5e Patch to type match comparing Objective-C Classes which implement
protocols (Radar 8191774).

llvm-svn: 108758
2010-07-19 22:02:22 +00:00
Fariborz Jahanian 2a36089eef Categories cannot synthesize property ivars,
and a minor cleanup.

llvm-svn: 108707
2010-07-19 16:14:33 +00:00
Fariborz Jahanian 6a06144021 Another test case for on demand synthesis of ivars.
llvm-svn: 108600
2010-07-17 01:16:59 +00:00
Fariborz Jahanian 18722981e2 Patch to synthesize property ivars on demand as
part of the new property synthesis by default.
wip.

llvm-svn: 108599
2010-07-17 00:59:30 +00:00
Fariborz Jahanian 56a9d54de8 Don't error when doing default property synthesis
and some are already synthesized by user declaration.

llvm-svn: 108341
2010-07-14 18:11:52 +00:00
Fariborz Jahanian c0b0ced477 Consider obective-c pointer arguments as valid sentinel args
as well. Fixes radar 7975788.

llvm-svn: 108333
2010-07-14 16:37:51 +00:00
Fariborz Jahanian 5848d333b4 Check on property attributes which are declared
in class extensions (radar 8171968).

llvm-svn: 108283
2010-07-13 22:04:56 +00:00
Ted Kremenek 3f1240b614 Add test case for <rdar://problem/4289832>. Clang actuallys gets
the test case right (for the noreturn warning) because the CFG
doesn't support @try yet, but the test case is now present when
we do properly implement CFG support for @try...@catch.

llvm-svn: 107203
2010-06-29 20:25:42 +00:00
Fariborz Jahanian 66f9a6560e This patch fixes a bug whereby, clang skipped
unimplemented property warning for properties 
coming from class's conformin protocol. It also
simplifies the algorithm in the process.
Fixes radar 8035776.

llvm-svn: 107174
2010-06-29 18:12:32 +00:00
Fariborz Jahanian 3bf0ded346 Patch to provide separate ASTs for multiple ObjC class extension
declarations (implements radar 7928731).

llvm-svn: 106597
2010-06-22 23:20:40 +00:00
Ted Kremenek 64c235e4c6 Extend format string type-checking to include '%p'. Fixes remaining cases PR 4468.
llvm-svn: 106151
2010-06-16 21:23:04 +00:00
Fariborz Jahanian 5981b04718 Clang missing warning about conflicting declaration vs. definition
for variable arguments list methods. (radar 8006060).

llvm-svn: 104407
2010-05-21 23:28:58 +00:00
Fariborz Jahanian 9f963c2488 Misc. fixes to bring Objetive-C++'s handling of
gc attributes to be inline with Objective-C
(for radar 7925141).

llvm-svn: 104084
2010-05-18 23:04:17 +00:00
Fariborz Jahanian 87b915a9bc These test now run in objective-c++ mode we well.
llvm-svn: 104041
2010-05-18 18:24:06 +00:00