Commit Graph

24 Commits

Author SHA1 Message Date
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
Douglas Gregor 7bfb2d026e Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()
off PartialDiagnostic. PartialDiagnostic is rather heavyweight for
something that is in the critical path and is rarely used. So, switch
over to an abstract-class-based callback mechanism that delays most of
the work until a diagnostic is actually produced. Good for ~11k code
size reduction in the compiler and 1% speedup in -fsyntax-only on the
code in <rdar://problem/11004361>.

llvm-svn: 156176
2012-05-04 16:32:21 +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
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
Douglas Gregor aa0df2d373 Make control flow more explicit for rebuilding property reference expressions without their OpaqueValueExprs
llvm-svn: 154669
2012-04-13 16:05:42 +00:00
Douglas Gregor eba02fecdd super and class property reference expressions don't need to be
rebuilt. Fixes <rdar://problem/11052352>. 

llvm-svn: 154667
2012-04-13 15:53:08 +00:00
Argyrios Kyrtzidis ab468b0381 Add info to ObjCPropertyRefExpr to indicate whether the dot syntax property
reference is going to message the setter, the getter, or both.

Having this info on the ObjCPropertyRefExpr node makes it easier for AST
clients (like libclang) to reason about the meaning of the property reference.

[AST/Sema]
-Use 2 bits (with a PointerIntPair) in ObjCPropertyRefExpr to record the above info
-Have ObjCPropertyOpBuilder set the info appropriately.

[libclang]
-When there is an implicit property reference (property syntax using methods)
have clang_getCursorReferenced return a cursor for the method. If the property
reference is going to result in messaging both the getter and the setter choose
to return a cursor for the setter because it is less obvious from source inspection
that the setter is getting called.

The general idea has the seal of approval by John.

rdar://11151621

llvm-svn: 153709
2012-03-30 00:19:18 +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
David Blaikie bbafb8a745 Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

llvm-svn: 152536
2012-03-11 07:00:24 +00:00
Ted Kremenek e65b086e07 Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals.  This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch.  It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

llvm-svn: 152137
2012-03-06 20:05:56 +00:00
Douglas Gregor 2d5aea0f25 Pull the OpaqueValueExpr's source expression into its constructor, so
that we can correctly compute value-dependence of the OVE.

llvm-svn: 151291
2012-02-23 22:17:26 +00:00
Argyrios Kyrtzidis a80f1bf262 Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.

This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.

llvm-svn: 148013
2012-01-12 02:34:39 +00:00
John McCall e929082806 Fix the instantiation of pseudo-object expressions. This is a
really bad way to go about this, but I'm not sure there's a better
choice without substantial changes to TreeTransform --- most
notably, preserving implicit semantic nodes instead of discarding
and rebuilding them.

llvm-svn: 145480
2011-11-30 04:42:31 +00:00
John McCall d5c98ae695 Resolve placeholder expressions before trying to deduce
'auto'.  Introduce a convenience method to make this a bit
easier, and use it elsewhere.

llvm-svn: 144605
2011-11-15 01:35:18 +00:00
Matt Beaumont-Gay fb3cb9a861 Revert r143972, which didn't actually compile under -Wnon-virtual-dtor.
(TIL: -Wnon-virtual-dtor is not in -Wall.)

llvm-svn: 144058
2011-11-08 01:53:17 +00:00
John McCall cfef546d40 There are some crazy cases that LookupMethodInReceiverType
doesn't duplicate, but they all surface as implicit
properties.  It's also a useful optimization to not
duplicate the implicit getter lookup.  So, trust the
getter lookup that was already done in these cases.

llvm-svn: 144031
2011-11-07 22:49:50 +00:00
Matt Beaumont-Gay 50da84bdb9 Better fix for -Wnon-virtual-dtor
llvm-svn: 143972
2011-11-07 18:30:47 +00:00
Matt Beaumont-Gay 43e15ff357 Appease -Wnon-virtual-dtor
llvm-svn: 143965
2011-11-07 17:16:31 +00:00
Benjamin Kramer 5c29d69588 Unbreak gcc build.
For some reason clang and msvc accept this, but gcc doesn't.

llvm-svn: 143872
2011-11-06 09:50:13 +00:00
John McCall fe96e0b6be Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions.  It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST.  I've gone ahead and simplified the
ObjC rewriter's use of properties;  other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily.  Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.

llvm-svn: 143867
2011-11-06 09:01:30 +00:00
Benjamin Kramer 8dc5760eed Reflow code. No intended functionality change.
llvm-svn: 143192
2011-10-28 13:21:18 +00:00
John McCall 526ab47a55 Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.

llvm-svn: 142931
2011-10-25 17:37:35 +00:00