Daniel Dunbar
56fdb6ae69
More #include cleaning
...
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.
llvm-svn: 54632
2008-08-11 06:23:49 +00:00
Daniel Dunbar
34fb67272c
Minor #include cleaning
...
- Drop TokenKinds.h from Action.h
- Move DeclSpec.h from Sema.h into individual Sema .cpp files
llvm-svn: 54625
2008-08-11 03:27:53 +00:00
Chris Lattner
35ffe331b9
remove two uses of getCanonicalType I missed.
...
llvm-svn: 54114
2008-07-27 00:05:05 +00:00
Chris Lattner
574dee6cac
change more instances of QualType::getCanonicalType to call
...
ASTContext::getCanonicalType instead (PR2189)
llvm-svn: 54105
2008-07-26 22:17:49 +00:00
Chris Lattner
ac87ef5dcc
remove a helper method.
...
llvm-svn: 54101
2008-07-26 20:50:02 +00:00
Chris Lattner
df59f5aa3c
Pull protocol resolution of out ActOnStartClassInterface, this is also the
...
last client of the old ParseObjCProtocolReferences, so it also removes it.
llvm-svn: 54094
2008-07-26 04:13:19 +00:00
Chris Lattner
b1f3c948ee
refactor protocol resolution out of ActOnStartCategoryInterface
...
llvm-svn: 54093
2008-07-26 04:07:02 +00:00
Chris Lattner
3bbae00f50
pull protocol resolution out into ActOnStartProtocolInterface.
...
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.
llvm-svn: 54092
2008-07-26 04:03:38 +00:00
Chris Lattner
9c1842b612
simplify some code.
...
llvm-svn: 54091
2008-07-26 03:47:43 +00:00
Chris Lattner
908d39e45e
remove duplicate error message.
...
llvm-svn: 54090
2008-07-26 03:40:25 +00:00
Steve Naroff
542cd5d3f9
Move fix in r54013 from the parser to sema.
...
llvm-svn: 54032
2008-07-25 17:57:26 +00:00
Chris Lattner
d7352d6801
minor cleanup to the actions interface to pass around SmallVectorImpl instead
...
of a specific smallvector size.
Fix protocol lists to pass down proper location info, so we get diagnostics
like this:
t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^
instead of this:
t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^
Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>
llvm-svn: 53883
2008-07-21 22:17:28 +00:00
Chris Lattner
390d39ac7e
move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
...
simplifying code along the way and fixing a problem and memory leak or two.
llvm-svn: 53876
2008-07-21 21:32:27 +00:00
Chris Lattner
102ccc4f8c
add forward definition protocols to the protocol list for a class.
...
llvm-svn: 53864
2008-07-21 18:35:17 +00:00
Chris Lattner
461d3f8eb8
references to completely undeclared protocols should be errors.
...
References to forward definitions should be warnings.
llvm-svn: 53863
2008-07-21 18:34:02 +00:00
Chris Lattner
d004505b74
introduce a new ObjCList templated class and start moving
...
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.
llvm-svn: 53856
2008-07-21 18:19:38 +00:00
Chris Lattner
65056c48a7
rename setReferencedProtocolList -> addReferencedProtocols to
...
be consistent with ObjCInterfaceDecl.
llvm-svn: 53852
2008-07-21 17:23:15 +00:00
Argyrios Kyrtzidis
b3fa8639e1
Change 'MDecl' to 'MD' to fix redefinition compiler error in MSVC++.
...
llvm-svn: 53849
2008-07-21 09:18:38 +00:00
Chris Lattner
ca1e848588
Switch initialization of the protocol list for an interface decl to use
...
the standard "set these as the list of protocols" interface instead of a
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.
This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't. Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on
test/Sema/objc-interface-1.m
While I'm at it, clean up some locations so that we produce:
t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~ ^
instead of:
t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^
llvm-svn: 53846
2008-07-21 07:06:49 +00:00
Seo Sanghyeon
d27410b580
Fix warnings
...
llvm-svn: 53141
2008-07-05 02:01:25 +00:00
Argyrios Kyrtzidis
853fbea313
Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
...
llvm-svn: 52852
2008-06-28 06:07:14 +00:00
Argyrios Kyrtzidis
8a73d1f327
The assert at Sema::ObjCActOnStartOfMethodDef should check CurMethodDecl instead of CurFunctionDecl.
...
llvm-svn: 52719
2008-06-25 14:24:09 +00:00
Chris Lattner
5696e7badf
Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
...
Patch by David Chisnall!
llvm-svn: 52422
2008-06-17 18:05:57 +00:00
Steve Naroff
946166f4e9
Second half of "fix" for <rdar://problem/5986085> clang on xcode: error: redefinition of 'XCElementToggler' as different kind of symbol
...
llvm-svn: 52024
2008-06-05 22:57:10 +00:00
Steve Naroff
31e1d41338
Fixed a recent test regression from last night (r51976).
...
llvm-svn: 52006
2008-06-05 15:03:27 +00:00
Steve Naroff
25449a5221
Fix <rdar://problem/5986833> clang on xcode: incompatible type returning 'void', expected 'int'.
...
- Changed Sema::ObjCActOnStartOfMethodDef() to more accurately type "self" in factory methods.
- Changed Sema::ActOnInstanceMessage() to use the new type to restrict the lookup.
llvm-svn: 52005
2008-06-05 14:49:39 +00:00
Steve Naroff
d1c3d1130b
Fix trivial crasher and downgrade an error to warning (to match GCC).
...
llvm-svn: 51976
2008-06-05 04:33:44 +00:00
Steve Naroff
4c290c7c0b
Make sure the source location for @property points the the @-sign (not the decl spec).
...
Also added a FIXME related to how we represent @properties in the ObjCInterfaceDecl AST.
llvm-svn: 51450
2008-05-22 23:24:08 +00:00
Fariborz Jahanian
8983f17ba0
Synthesized getter/setter method declarations need not have
...
an implementation. This fixes couple of failing prperty tests
caused by my previous patch.
llvm-svn: 50830
2008-05-07 20:53:44 +00:00
Fariborz Jahanian
ec6e4c8096
This patch introduces declaration of getter methods for ObjC2's
...
properties. Couple of property tests will fail with this patch.
Will fix them next.
llvm-svn: 50818
2008-05-07 17:43:59 +00:00
Fariborz Jahanian
09367d68ff
Patch to refactor setter/getter names of property attributes into Selector
...
(was IdentifierInfo * before). This will make method declartations whole
lot easier.
llvm-svn: 50747
2008-05-06 18:09:04 +00:00
Fariborz Jahanian
8d91686b0d
percolate @optional/@required protocols down to ASTs for
...
properties declared in the protocol.
llvm-svn: 50662
2008-05-05 18:51:55 +00:00
Fariborz Jahanian
98a6c4fa77
This patch is about merging ObjC2's properties declared in class
...
protocols into class's property list and performing semantics
on them for while doing so.
llvm-svn: 50587
2008-05-02 19:17:30 +00:00
Fariborz Jahanian
f303bdabdf
Patch to match and issue diagnostics on property type mismatch.
...
llvm-svn: 50532
2008-05-01 18:05:01 +00:00
Fariborz Jahanian
7cf18862c2
More ObjC2 property semantics work. Work in progress.
...
llvm-svn: 50508
2008-05-01 00:03:38 +00:00
Argyrios Kyrtzidis
ed1eec4812
Use PushOnScopeChains to introduce a decl into scope.
...
llvm-svn: 50320
2008-04-27 13:30:35 +00:00
Fariborz Jahanian
0a070ff570
Patch to diagnose inconsistancies between properties declared in current and
...
its super class. This patch is incomplete.
llvm-svn: 50228
2008-04-24 19:58:34 +00:00
Fariborz Jahanian
6efdf1ddab
Patch to build AST for property implementation declarations and
...
to print declaration from its AST.
llvm-svn: 50117
2008-04-23 00:06:01 +00:00
Fariborz Jahanian
c6bec7b6dc
More semantics checks of properties. Property implementation can implicitly use
...
ivar of same name.
Better diagnostics to bring home this point.
llvm-svn: 50065
2008-04-21 21:57:36 +00:00
Fariborz Jahanian
f2a7d7c949
Support for @dynamic AST build.
...
More property semantics checking.
First test case for ObjC2's property implementation.
llvm-svn: 50057
2008-04-21 21:05:54 +00:00
Fariborz Jahanian
a054e99fa8
Continuation of work on ObjC2's properties.
...
Added iterators, methods to find property and categories.
Use them in doing semantic analysis on property implementation
declarations. Fixed typos.
llvm-svn: 50050
2008-04-21 19:04:53 +00:00
Fariborz Jahanian
d83bdd3841
Fixed a bug in categories and properties.
...
llvm-svn: 49883
2008-04-18 00:30:47 +00:00
Fariborz Jahanian
ffe97a3925
Initial work for property implementation declarations.
...
Mostly semantic checking in this patch. This is on going
and incomplete.
llvm-svn: 49882
2008-04-18 00:19:30 +00:00
Fariborz Jahanian
8e36cddde0
Added property decl support for protocols.
...
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.
llvm-svn: 49862
2008-04-17 18:25:18 +00:00
Fariborz Jahanian
9d981eb9ae
This patch adds support for declaraing properties in categories,
...
just as they are declared in objc classes.
llvm-svn: 49817
2008-04-16 21:08:45 +00:00
Fariborz Jahanian
0152a1a5db
New AST representation for each objc2's property declaration.
...
llvm-svn: 49699
2008-04-14 23:36:35 +00:00
Fariborz Jahanian
4572b45574
AST generation for objc2's property declarations.
...
llvm-svn: 49565
2008-04-11 23:40:25 +00:00
Steve Naroff
5a4611cdda
Add class and super class location info to ObjCInterfaceDecl...
...
llvm-svn: 49553
2008-04-11 19:35:35 +00:00
Chris Lattner
c5c95b52a8
Switch sema to maintaining its own scope chain information for variable
...
shadowing, instead of threading it through the AST. This patch contributed
by Argiris Kirtzidis!
llvm-svn: 49520
2008-04-11 07:00:53 +00:00
Chris Lattner
58258246ec
Several improvements from Doug Gregor related to default
...
argument handling. I'll fix up the c89 (void) thing next.
llvm-svn: 49459
2008-04-10 02:22:51 +00:00