Commit Graph

2483 Commits

Author SHA1 Message Date
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