Devang Patel
ef2d838fef
Stay within 80 columns.
...
llvm-svn: 43843
2007-11-07 21:04:59 +00:00
Hartmut Kaiser
abcbb0493a
Updated VC++ build system
...
llvm-svn: 43838
2007-11-07 19:34:40 +00:00
Ted Kremenek
d68db575f3
Implemented serialization of StringLiteral.
...
llvm-svn: 43834
2007-11-07 19:08:19 +00:00
Ted Kremenek
f9062be688
Implemented serialization of ImaginaryLiteral.
...
llvm-svn: 43833
2007-11-07 18:53:02 +00:00
Ted Kremenek
569725f827
Implemented serialization of FloatingLiteral.
...
llvm-svn: 43832
2007-11-07 18:45:55 +00:00
Steve Naroff
1601858de5
Finishing touches on code generation for @try and friends.
...
- declare functions we use.
- cast arguments to objc_exception_match().
- don't take the & of _stack.buf.
llvm-svn: 43831
2007-11-07 18:43:40 +00:00
Fariborz Jahanian
1299a92327
Emit objective-c's meta-data at the end of rewriting to stdout.
...
llvm-svn: 43830
2007-11-07 18:40:28 +00:00
Steve Naroff
b7a032eb20
Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead, return false if the declarations aren't in scope. This was a hold over from when 'id' and 'Class' were initialized lazily.
...
llvm-svn: 43827
2007-11-07 18:07:59 +00:00
Fariborz Jahanian
8a348705a8
Fixed an array overflow bug.
...
llvm-svn: 43826
2007-11-07 17:43:16 +00:00
Fariborz Jahanian
e044087b56
Fixed typo.
...
llvm-svn: 43825
2007-11-07 17:29:15 +00:00
Ted Kremenek
c874c6a959
Implemented serialization of CharacterLiteral.
...
llvm-svn: 43824
2007-11-07 17:15:49 +00:00
Ted Kremenek
3c58662411
Implemented serialiation of PreDefinedExpr.
...
llvm-svn: 43823
2007-11-07 17:11:58 +00:00
Ted Kremenek
d47c8125a1
Implemented serialization of ContinueStmt.
...
llvm-svn: 43822
2007-11-07 17:05:07 +00:00
Ted Kremenek
3b4c08deae
Implemented serialization of IndirectGotoStmt.
...
Added "FIXME" regarding the lack of source location information for IndirectGotoStmt.
llvm-svn: 43821
2007-11-07 17:02:32 +00:00
Steve Naroff
a733c7ffe4
Implement rewrite for @throw.
...
llvm-svn: 43820
2007-11-07 15:32:26 +00:00
Ted Kremenek
5fd3040c57
Implemented serialization of GotoStmt.
...
llvm-svn: 43818
2007-11-07 08:07:46 +00:00
Ted Kremenek
35e20410aa
Implemented serialization for ForStmt.
...
llvm-svn: 43817
2007-11-07 08:02:55 +00:00
Ted Kremenek
83e96b8d5a
Implemented serialization of DoStmt.
...
llvm-svn: 43816
2007-11-07 07:53:55 +00:00
Ted Kremenek
f6d8ce1052
Implemented serialization for WhileStmt.
...
llvm-svn: 43815
2007-11-07 07:50:10 +00:00
Ted Kremenek
154c790538
Implemented serialization of IfStmt.
...
Fixed declarations of several "directEmit" methods of classes that subclass
Stmt that were missing a "virtual" keyword.
llvm-svn: 43814
2007-11-07 07:19:30 +00:00
Steve Naroff
4d7b367652
Teach ASTContext::tagTypesAreCompatible() about the built-in ObjC types (Class and id), removing a bogus warning.
...
llvm-svn: 43809
2007-11-07 06:03:51 +00:00
Ted Kremenek
acb9bcf22a
Implemented serialization of SwitchStmt, CaseStmt, BreakStmt, DefaultStmt,
...
and ParenExpr.
llvm-svn: 43806
2007-11-07 05:25:31 +00:00
Steve Naroff
bf478ece48
Rewrite ObjC @try/@catch/@finally. Some minor tweaks to the AST nodes...
...
Still need to rewrite @throw (and do more testing)...
llvm-svn: 43803
2007-11-07 04:08:17 +00:00
Fariborz Jahanian
adfbbc3330
AST for objective-c's @throw statement and its pretty-printing.
...
llvm-svn: 43802
2007-11-07 02:00:49 +00:00
Devang Patel
b1ecfc6e25
Start struct bit field laout work.
...
This is far from complete.
llvm-svn: 43801
2007-11-07 01:57:13 +00:00
Ted Kremenek
a8cdf31aa0
Implemented serialization of LabelStmts.
...
llvm-svn: 43800
2007-11-07 00:48:04 +00:00
Fariborz Jahanian
defbf9a86c
Fixed a pretty-printer bug whereby a @try statement with no @finally seg faulted.
...
llvm-svn: 43798
2007-11-07 00:46:42 +00:00
Ted Kremenek
ad1bc400d7
Added serialization/deserialization of NullStmts.
...
llvm-svn: 43797
2007-11-07 00:40:53 +00:00
Ted Kremenek
80fe8904e1
Added serialization/deserialization of DeclStmts.
...
Reordered stmt serialization method implementations to be in alphabetical order.
llvm-svn: 43796
2007-11-07 00:37:40 +00:00
Ted Kremenek
148aa5edbc
Overhauled serialization of statements. We no longer use specialized SerializeTrait<> classes,
...
but methods in Stmt (like other objects we are serializing). Full serialization of all statements
is not yet complete.
llvm-svn: 43793
2007-11-07 00:17:35 +00:00
Ted Kremenek
abcfe90802
Added static inline method "ReadVal" to QualType for more succinct
...
deserialization code of objects containing QualTypes.
llvm-svn: 43792
2007-11-07 00:13:45 +00:00
Fariborz Jahanian
e8a3016ac7
Rewrite for properties.
...
llvm-svn: 43791
2007-11-07 00:09:37 +00:00
Ted Kremenek
fa2bf434cc
Fixed typo in the name of "ReadPreamble".
...
llvm-svn: 43790
2007-11-06 23:52:19 +00:00
Fariborz Jahanian
bcce2f8d54
Fix an inverted conditional,
...
--chris
llvm-svn: 43789
2007-11-06 23:06:16 +00:00
Ted Kremenek
453ab7d126
Started work on new serialization approach within ASTContext to
...
serialize Type objects in the order they are serialized in the Types
vector. We also now rely on the methods within ASTContext to unique
Type objects and handle the actual creation of Type objects (these are
now called by the deserialization code). This approach solves some
hairy issues with ownership of objects and allows us to naturally
handle recursive types.
llvm-svn: 43787
2007-11-06 22:26:16 +00:00
Ted Kremenek
7c91ccae88
QualType deserialization now requires that the underlying pointer type
...
must be deserialized without requiring backpatching.
llvm-svn: 43786
2007-11-06 22:23:53 +00:00
Ted Kremenek
93d446f535
Bug fix: inverted test condition to see if a serialized AST-bitcode
...
file had the correct preamble.
llvm-svn: 43785
2007-11-06 22:23:03 +00:00
Fariborz Jahanian
f76f2b0c1c
Patch for objc2's property ASTs, as well as pretty-priting the ASTs.
...
llvm-svn: 43778
2007-11-06 22:01:00 +00:00
Ted Kremenek
77068e17d4
Misc. serialization changes to ASTContext and Decls. Serialization
...
for ASTContext is still rapidly evolving.
llvm-svn: 43774
2007-11-06 19:51:47 +00:00
Ted Kremenek
3a68de993a
Revampled Serialization Tester to serialize and deserialize out an entire ASTContext and top-level decls.
...
llvm-svn: 43773
2007-11-06 19:50:53 +00:00
Steve Naroff
2d8aaa7d74
Fix a "basic" bug that resulted in a bogus SourceLocation.
...
Off hand, I don't know why this change makes a difference (I thought the two constructor idioms were equivalent).
llvm-svn: 43770
2007-11-06 19:37:09 +00:00
Chris Lattner
45d561ad99
improve decl merging logic to be more correct with
...
functions. Patch contributed by Nuno Lopes, thanks!
llvm-svn: 43757
2007-11-06 06:07:26 +00:00
Chris Lattner
3209725c68
Add better validation for array types when merging decls. Patch
...
contributed by Oliver Hunt, thanks!
llvm-svn: 43750
2007-11-06 04:28:31 +00:00
Ted Kremenek
f7f7ddfd7e
Added registration to deserialization engine of IdentifierInfo* as
...
IdentifierInfos are deserialized.
llvm-svn: 43741
2007-11-05 22:42:32 +00:00
Ted Kremenek
72f073acd4
Implemented serialization of TypedefDecls.
...
Fixed infinite recursion in VarDecl::InternalRead.
llvm-svn: 43739
2007-11-05 21:49:34 +00:00
Ted Kremenek
15f50ba755
In driver code implemented serialization of ASTContext. Working on serialization of simple ASTs.
...
llvm-svn: 43738
2007-11-05 21:39:35 +00:00
Ted Kremenek
7f6e70c5c2
Added skeleton for dispatch of Decl serialization.
...
llvm-svn: 43737
2007-11-05 21:38:00 +00:00
Ted Kremenek
58473ab478
For serialization of ASTContext, added special-casing of serialization
...
of type sets when emitting complex types and pointer types that are
also considered builtins. These types are automatically created in
the ctor of ASTContext, and thus should not be serialized (was
producing an error during deserialization).
llvm-svn: 43733
2007-11-05 20:49:23 +00:00
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
Steve Naroff
aaba027717
Implement ObjC built-in types in MinimalAction.
...
This fixes the recent regression with selector-1.m and -parse-noop.
llvm-svn: 43575
2007-10-31 20:55:39 +00:00
Ted Kremenek
b681c68a7e
Implemented short-circuited version of Builtin::Info::operator!=.
...
llvm-svn: 43574
2007-10-31 20:55:27 +00:00