Fariborz Jahanian
63ac80e76a
Misc. fixes. 1) Resurrect meta-data generation turned off by a previous patch.
...
2) Fixed a regression in meta-data generation caused by removal of '_interface' prefix from synthesize class name.
3) Added stubs for @try/@catch/@finally statements.
llvm-svn: 43716
2007-11-05 17:47:33 +00:00
Ted Kremenek
a6d9f3c2cf
Made methods "Emit" and "Materialize" in ASTContext (used for serialization) public.
...
llvm-svn: 43713
2007-11-05 17:41:25 +00:00
Ted Kremenek
31b789c0d8
Added TypeSerialization.cpp and DeclSerialization.cpp to the XCode project.
...
llvm-svn: 43710
2007-11-05 17:04:40 +00:00
Steve Naroff
96d20616c4
Sema::ActOnClassMessage()...if a class method isn't found, lookup an instance method. Since all classes are also instances, this is appropriate.
...
llvm-svn: 43708
2007-11-05 15:27:52 +00:00
Steve Naroff
bd72289baa
Declare objc_selector outside the prototype for objc_msgSend(), removing a silly warning.
...
llvm-svn: 43706
2007-11-05 14:55:35 +00:00
Steve Naroff
e4f9b23458
Rewrite @selector(sel).
...
llvm-svn: 43705
2007-11-05 14:50:49 +00:00
Steve Naroff
98eb8d1275
- change the synthesized typedef (for classes) to be of type "objc_object".
...
- fix a couple bugs in RewriteObjCStringLiteral.
- convert "Class" -> "id" in RewriteMessageExpr.
llvm-svn: 43704
2007-11-05 14:36:37 +00:00
Steve Naroff
3865e4d8b4
Remove HandleObjcMetaDataEmission(), I inadvertantly resurrected it.
...
llvm-svn: 43690
2007-11-05 00:25:00 +00:00
Steve Naroff
f36987c79b
Two additions...
...
- Synthesize the funky cast for objc_msgSend(). For the basic case, it looks like...
((id (*)(id, SEL))(void *)objc_msgSend)(obj, sel);
The "void *" cast is needed to workaround a GCC "bandaid" (Chris says it has something to do with the inliner). Without the extra "void *" cast, we get spurious warnings/notes that look like...
xx.m:17: warning: function called through a non-compatible type
xx.m:17: note: if this code is reached, the program will abort
- Add prototypes for the ObjC functions we call, objc_msgSend/objc_getClass for now (don't depend on them being included).
llvm-svn: 43685
2007-11-04 22:37:50 +00:00
Steve Naroff
66697aa72f
Add a method prototype slot/getter to the ObjCMessageExpr AST.
...
llvm-svn: 43666
2007-11-03 16:37:59 +00:00
Steve Naroff
a397efd915
Implement rewrite rules for ObjC string constants.
...
llvm-svn: 43665
2007-11-03 11:27:19 +00:00
Chris Lattner
376cdaf50b
Fix ownership model of ParseAST to allow the dtor of
...
ASTConsumer to process the AST before it is destroyed.
This allows elimination of HandleObjcMetaDataEmission.
llvm-svn: 43659
2007-11-03 06:24:16 +00:00
Fariborz Jahanian
9ffbd2d648
Provide both const and non-const accessor methods for @try and @finally ASTs.
...
My previous patch did the same for @catch AST.
llvm-svn: 43654
2007-11-03 00:38:38 +00:00
Fariborz Jahanian
e21451fc0d
Provide const and none-const version of methods accessing various @catch nodes
...
llvm-svn: 43653
2007-11-03 00:34:02 +00:00
Fariborz Jahanian
8815795049
pretty-print @try/@catch/@finally from AST as the validation of AST.
...
llvm-svn: 43649
2007-11-02 18:16:07 +00:00
Ted Kremenek
dda9a56975
Added most of the boilerplate code for Decl serialization. Still a few
...
key functions to implement.
llvm-svn: 43648
2007-11-02 18:05:11 +00:00
Chris Lattner
0b271eb7af
Expose InsertText, fixing an oversight.
...
llvm-svn: 43643
2007-11-02 17:26:47 +00:00
Anders Carlsson
bfd60eedd7
Generate code for member exprs.
...
llvm-svn: 43641
2007-11-02 16:59:10 +00:00
Fariborz Jahanian
f859ef293c
AST for @try statement.
...
llvm-svn: 43640
2007-11-02 15:39:31 +00:00
Hartmut Kaiser
4a7d2d65e3
Updated VC++ build system
...
llvm-svn: 43632
2007-11-02 01:44:32 +00:00
Fariborz Jahanian
71234d8a9e
AST for @finally statement.
...
llvm-svn: 43629
2007-11-02 00:18:53 +00:00
Fariborz Jahanian
9e63b98de7
AST build for @catch clause (this is work in progress).
...
llvm-svn: 43628
2007-11-01 23:59:59 +00:00
Ted Kremenek
5e2eb261af
Simplified Serialization code for SourceLocation and SourceRange, and
...
updated it to the recently updated Serialization API.
Changed clients of SourceLocation serialization to call the
appropriate new methods.
Updated Decl serialization code to put new skeleton serialization code
in place that is much better than the older trait-specialization
approach.
llvm-svn: 43625
2007-11-01 22:25:41 +00:00
Fariborz Jahanian
65590b2504
Bunch of class declarations for objective-c's @try-catch statement.
...
llvm-svn: 43623
2007-11-01 21:12:44 +00:00
Devang Patel
e11664a0ef
Rename classes and collections that maintain record layout information.
...
Now, at AST level record info is maintained by ASTRecordLayout class.
Now, at code gen level record info is maintained by CGRecordLayout class.
llvm-svn: 43619
2007-11-01 19:11:01 +00:00
Ted Kremenek
26a7f3fd56
Implemented serialization of QualTypes within ASTContext. Clarified
...
ownership model of some type pointers. Added FIXMEs to serialization.
Added comments to ASTContext indicating which variables we are intentionally
*not* serializing.
llvm-svn: 43618
2007-11-01 18:11:32 +00:00
Fariborz Jahanian
ac73ff8868
Remaining work to collect objective-c's type qualifiers and use them to encode
...
method types.
llvm-svn: 43617
2007-11-01 17:18:37 +00:00
Steve Naroff
63006473d5
- Remove _interface_ prefix for the synthesized tag names.
...
- Also removed a tab from the generated struct (minor).
llvm-svn: 43616
2007-11-01 17:12:31 +00:00
Ted Kremenek
53155f379e
Changed serialization/deserialization of BuiltinTypes to explicitly serialize
...
each type. This ensures that the order in which the types are serialized
is clear and remains persistent.
llvm-svn: 43615
2007-11-01 17:10:34 +00:00
Ted Kremenek
baa461893b
Reverted unnecessary inlining of operator!=, since negating operator== is
...
just as efficient and much more succinct.
llvm-svn: 43614
2007-11-01 16:35:25 +00:00
Devang Patel
32714064b1
Propagate bitfield info.
...
llvm-svn: 43613
2007-11-01 16:29:56 +00:00
Steve Naroff
50d4205ff9
Implement rewrite rule for commenting out protocol references. For example:
...
extern id /*<NSObject>*/ NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
extern void NSDeallocateObject(id /*<NSObject>*/object);
extern id /*<NSObject>*/ NSCopyObject(id /*<NSObject>*/object, unsigned extraBytes, NSZone *zone);
llvm-svn: 43612
2007-11-01 13:24:47 +00:00
Chris Lattner
b338a6b9f3
add support for vector type compatibility checking. Patch by Nate Begeman.
...
llvm-svn: 43604
2007-11-01 05:03:41 +00:00
Steve Naroff
2f55b98725
Tweak RewriteInterfaceDecl() to generate a typedef (if one hasn't already been generated).
...
llvm-svn: 43600
2007-11-01 03:35:41 +00:00
Chris Lattner
c3ebf29ef6
Implement test/Sema/init.c by treating functions as constants.
...
llvm-svn: 43599
2007-11-01 02:45:17 +00:00
Anders Carlsson
41b7c6b250
Put constant CFStrings in the __DATA,__cfstring section.
...
llvm-svn: 43593
2007-11-01 00:41:52 +00:00
Anders Carlsson
1e27f9b296
Stub out codegen for __builtin_constant_p. Remove any implicit cast exprs in the call to __builtin___CFStringMakeConstantString.
...
llvm-svn: 43592
2007-11-01 00:39:26 +00:00
Devang Patel
0b59b45870
Remove unnecessary method.
...
llvm-svn: 43591
2007-11-01 00:11:37 +00:00
Devang Patel
ad175428c6
start adding pading fields.
...
llvm-svn: 43590
2007-11-01 00:07:12 +00:00
Fariborz Jahanian
7a9c47480d
1) More additions for objective-c's qualifier type.
...
2) Fixed a test failure (which should have failed all along!).
llvm-svn: 43589
2007-10-31 23:53:01 +00:00
Anders Carlsson
e89b84ab29
Fix a typo that prevented pointer-to-int conversions from working.
...
llvm-svn: 43588
2007-10-31 23:18:02 +00:00
Devang Patel
f5fcb9870a
Refactor code into a separate method.
...
llvm-svn: 43587
2007-10-31 23:17:19 +00:00
Fariborz Jahanian
c3cda76362
Fixed a bug exposed by fixing the assert in previous patch (one of the tests asserted).
...
llvm-svn: 43586
2007-10-31 23:08:24 +00:00
Fariborz Jahanian
aa9a95ca4f
Changed direction of assert. Added more comments.
...
llvm-svn: 43585
2007-10-31 22:57:04 +00:00
Ted Kremenek
6aff871a84
Implemented more of serialization/deserialization for ASTContext. We now
...
(hypothetically) read in/write out most of the types. Bugs likely exist.
llvm-svn: 43584
2007-10-31 22:44:07 +00:00
Steve Naroff
9c4fdddd0c
Fix two rewriter bugs:
...
- For @class , don't generate multiple typedefs.
- Handle the following edge case interface...
@interface NSMiddleSpecifier : NSObject {}
@end
...which was incorrectly being rewritten to...
struct _interface_NSMiddleSpecifier {
struct _interface_NSObject _NSObject;
};
{}
llvm-svn: 43582
2007-10-31 22:11:35 +00:00
Anders Carlsson
0370eb2034
Handle function calls that return aggregate expressions.
...
llvm-svn: 43581
2007-10-31 22:04:46 +00:00
Fariborz Jahanian
d822d68b74
More infrastructure to recognize objective-c's type qualifiers (in,inout, etc.)
...
llvm-svn: 43580
2007-10-31 21:59:43 +00:00
Devang Patel
cc4c2930ae
New test to verify llvm struct layout.
...
llvm-svn: 43577
2007-10-31 21:02:10 +00:00
Devang Patel
6029cbf872
Check whether next slot meets field type's alignment requirements.
...
If it does not then assert at the moment.
llvm-svn: 43576
2007-10-31 21:01:37 +00:00