aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
AgeCommit message (Collapse)Author
2007-11-07Rewrite ObjC @try/@catch/@finally. Some minor tweaks to the AST nodes...Steve Naroff
Still need to rewrite @throw (and do more testing)... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07Rewrite for properties.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05Misc. fixes. 1) Resurrect meta-data generation turned off by a previous patch.Fariborz Jahanian
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43716 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05Declare objc_selector outside the prototype for objc_msgSend(), removing a ↵Steve Naroff
silly warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05Rewrite @selector(sel).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05- change the synthesized typedef (for classes) to be of type "objc_object".Steve Naroff
- fix a couple bugs in RewriteObjCStringLiteral. - convert "Class" -> "id" in RewriteMessageExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05Remove HandleObjcMetaDataEmission(), I inadvertantly resurrected it.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-04Two additions...Steve Naroff
- 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43685 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03Implement rewrite rules for ObjC string constants.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03Fix ownership model of ParseAST to allow the dtor of Chris Lattner
ASTConsumer to process the AST before it is destroyed. This allows elimination of HandleObjcMetaDataEmission. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01- Remove _interface_ prefix for the synthesized tag names.Steve Naroff
- Also removed a tab from the generated struct (minor). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43616 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01Implement rewrite rule for commenting out protocol references. For example:Steve Naroff
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); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43612 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01Tweak RewriteInterfaceDecl() to generate a typedef (if one hasn't already ↵Steve Naroff
been generated). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-311) More additions for objective-c's qualifier type.Fariborz Jahanian
2) Fixed a test failure (which should have failed all along!). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Fixed a bug exposed by fixing the assert in previous patch (one of the tests ↵Fariborz Jahanian
asserted). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43586 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Changed direction of assert. Added more comments.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Fix two rewriter bugs:Steve Naroff
- 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; }; {} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43582 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Rewriteing of ivars changed to just copy directly from the source.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Checking in some code that is still under construction.Steve Naroff
I need to (finally) change the way Class/id/SEL/IMP are built-in...the current approach of doing it in the preprocessor is "broken". The other problem is Sema::GetObjcIdType/GetObjcSelType/GetObjcClassType, the hooks that initialize ASTContext lazily. These built-in types need to be done up front... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43557 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Add some plumbing to help cope with rewriting "id<p>", "Class<p>*".Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43543 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I ↵Steve Naroff
generate these declaration on the fly when rewriting a message expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Rewrite protocols.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30- Add location info to category/protocol AST'sSteve Naroff
- Rewrite categories. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Remove a couple FIXME's for rewriting ObjC interfaces (which are now being ↵Steve Naroff
rewritten properly). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30More support for rewriting ObjC intefaces. Still some edge cases to handle...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29Encoding for objectiive-c methods.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29Do the encoding of ivar types in the ivar metadata.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29Add (partial) support for @encode.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26Path to synthesize 'instance' size field of _objc_class metadata.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26Start rewriting ObjC interfaces. As a start, we comment out all the methods. ↵Steve Naroff
This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43404 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26Patch to synthesize computation of Ivar offset in rewritten c file.Fariborz Jahanian
Thanks to Steve N. to point out using of offsetof for this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43391 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25Refactored several meta data for reusability.Fariborz Jahanian
Changed the entire rewrite of metadata to write to std::string object instead of stdout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43360 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25Convert one type of metadata to use std::string instead ofChris Lattner
printf as an example. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25Refactored RewriteObjcMethodsMetaData to better rewrite Fariborz Jahanian
instance/class methods metadata. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43320 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24More work on translating message expressions. Steve Naroff
Still to do: - Chris will fix a bug in the rewriting engine for nested stmts. For example, the following: NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; tranlates to: NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init]; ...which is correct, except there is garbage after sel_getUid("init"). This is because the rewriter isn't updating the extent of the containing message expression. - Do the crazy cast thang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43316 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Remove explicit use of size of known structs in metadata generation.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43313 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Couple of minor changes. 1) Metaclass metadata also has a reference toFariborz Jahanian
protocol meta-data (unlike what documentation says). 2) Include objc.h so, we can compile the generated metadata with both gcc and clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Refactord instance and class metadata emission. Refactored protocols ↵Fariborz Jahanian
metadata emission. Implemented emission of category metadata, git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Fix some long lines, move code around into logical groups.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Use Ted's new mutable child iterators to update the tree as we rewrite it.Chris Lattner
This will make nested subexprs work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43296 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Incorporate some feedback from Chris...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23Add some plumbing to rewrite message expressions (still under construction).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23- Add rewrite rule for @class.Steve Naroff
- Add setter/getter to ObjcClassDecl. - Predefined key runtime functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23Patch to complete metadata generation for each implemented class.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23Patch for initialization of class's Meta-class metadata.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22This patch generates protocol metadata and all its sub-metadata.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19rewrite of metadata for implemented instance methods.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18Patch to rewrite ivar tables metadata for classes defined.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18First patch toward rewriting of objective-c's meta data.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17Add new API to rewrite one stmt/expr with another.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43101 91177308-0d34-0410-b5e6-96231b3b80d8