Steve Naroff
6c6a2dbb4d
Tweak RewriteInterfaceDecl() to generate a typedef (if one hasn't already been generated).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 03:35:41 +00:00
Fariborz Jahanian
f1de0ca05e
1) More additions for objective-c's qualifier type.
...
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-31 23:53:01 +00:00
Fariborz Jahanian
212b768a4b
Fixed a bug exposed by fixing the assert in previous patch (one of the tests asserted).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43586 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 23:08:24 +00:00
Fariborz Jahanian
aff56d0bff
Changed direction of assert. Added more comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 22:57:04 +00:00
Steve Naroff
8749be53f5
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;
};
{}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43582 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 22:11:35 +00:00
Steve Naroff
b4292f221f
Implement ObjC built-in types in MinimalAction.
...
This fixes the recent regression with selector-1.m and -parse-noop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43575 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 20:55:39 +00:00
Devang Patel
7a4718e813
Take 2.
...
Make target info available to clang code generator. This is far from complete but this helps clang codegen module make progress.
At the moment target triplet and target description strings are hard coded in clang::TargetInfo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43572 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 20:01:01 +00:00
Fariborz Jahanian
fdc08a0682
Rewriteing of ivars changed to just copy directly from the source.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 17:29:28 +00:00
Steve Naroff
498856cb30
Checking in some code that is still under construction.
...
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-31 16:03:04 +00:00
Chris Lattner
e03cd7b7c8
temporarily revert devang's patch to link in the llvm codegen etc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 04:53:03 +00:00
Steve Naroff
9165ad378f
Add some plumbing to help cope with rewriting "id<p>", "Class<p>*".
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43543 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 04:38:33 +00:00
Devang Patel
f767e218ee
Make target info available to clang code generator.
...
This is far from complete but this helps clang codegen module
make progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 00:59:29 +00:00
Steve Naroff
09b266eb2a
Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I 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-30 23:14:51 +00:00
Steve Naroff
752d6ef8c8
Rewrite protocols.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 16:42:30 +00:00
Steve Naroff
423cb565ab
- Add location info to category/protocol AST's
...
- Rewrite categories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 13:30:57 +00:00
Steve Naroff
2feac5e559
Remove a couple FIXME's for rewriting ObjC interfaces (which are now being rewritten properly).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 03:43:13 +00:00
Steve Naroff
f908a87299
More support for rewriting ObjC intefaces. Still some edge cases to handle...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 02:23:23 +00:00
Fariborz Jahanian
33e1d64ab5
Encoding for objectiive-c methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 22:57:28 +00:00
Fariborz Jahanian
160eb6538e
Do the encoding of ivar types in the ivar metadata.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 17:16:25 +00:00
Anders Carlsson
85f9bceab1
Add (partial) support for @encode.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:01:08 +00:00
Fariborz Jahanian
4d733d3288
Path to synthesize 'instance' size field of _objc_class metadata.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 23:09:28 +00:00
Steve Naroff
bef1185418
Start rewriting ObjC interfaces. As a start, we comment out all the methods. 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-26 20:53:56 +00:00
Fariborz Jahanian
26e4cd331c
Patch to synthesize computation of Ivar offset in rewritten c file.
...
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-26 19:46:17 +00:00
Fariborz Jahanian
edcfb42e5e
Pretty printing for ivar list of an interface block.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43382 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 16:29:12 +00:00
Fariborz Jahanian
ccd87b07a7
Refactored several meta data for reusability.
...
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-25 20:55:25 +00:00
Chris Lattner
158ecb9767
Convert one type of metadata to use std::string instead of
...
printf as an example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 17:07:24 +00:00
Fariborz Jahanian
8e991ba2e2
Refactored RewriteObjcMethodsMetaData to better rewrite
...
instance/class methods metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43320 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:14:44 +00:00
Steve Naroff
934f276cc5
More work on translating message expressions.
...
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-24 22:48:43 +00:00
Fariborz Jahanian
1a0965effc
Remove explicit use of size of known structs in metadata generation.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43313 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 21:25:12 +00:00
Fariborz Jahanian
454cb012a9
Couple of minor changes. 1) Metaclass metadata also has a reference to
...
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-24 20:54:23 +00:00
Fariborz Jahanian
2e6d935930
Refactord instance and class metadata emission. Refactored protocols 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-24 19:23:36 +00:00
Ted Kremenek
a2bfb91c55
Modified current clients of Bitcode-Object serialization to use the
...
new split-header file configuration (Serialize.h and Deserialize.h)
now in place in the core LLVM repository.
Removed unneeded SerializeTrait specializations for enums in
TokenKinds.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 19:06:02 +00:00
Chris Lattner
f04da13728
Fix some long lines, move code around into logical groups.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 17:06:59 +00:00
Chris Lattner
e64b7771dc
Use Ted's new mutable child iterators to update the tree as we rewrite it.
...
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-24 16:57:36 +00:00
Steve Naroff
c0006097e9
Incorporate some feedback from Chris...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 01:09:48 +00:00
Steve Naroff
ebf2b56bce
Add some plumbing to rewrite message expressions (still under construction).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 23:50:29 +00:00
Ted Kremenek
c637e6b7af
Implemented serialization for IdentifierInfo and IdentifierTable.
...
Updated serialization test code in the driver to test serialization of
these types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 22:18:37 +00:00
Steve Naroff
7e15891fc8
- Add rewrite rule for @class.
...
- 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-23 20:20:08 +00:00
Fariborz Jahanian
deef51838b
Patch to complete metadata generation for each implemented class.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 18:53:48 +00:00
Fariborz Jahanian
9f0a1cb8cf
Patch for initialization of class's Meta-class metadata.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 00:02:02 +00:00
Fariborz Jahanian
e887c09395
This patch generates protocol metadata and all its sub-metadata.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-22 21:41:37 +00:00
Fariborz Jahanian
776d6ff623
rewrite of metadata for implemented instance methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-19 00:36:46 +00:00
Fariborz Jahanian
f4d331dd92
Patch to rewrite ivar tables metadata for classes defined.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 22:09:03 +00:00
Fariborz Jahanian
545b9ae381
First patch toward rewriting of objective-c's meta data.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 19:23:00 +00:00
Chris Lattner
01c5748c29
Add new API to rewrite one stmt/expr with another.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43101 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:35:30 +00:00
Chris Lattner
5075477aad
Add rewriter support for @encode expressions. For example,
...
we currently turn:
c = @encode(char *)[2] + 4;
into:
c = "foo"[2] + 4;
Right now the foo string is hard coded, but you can imagine a world
where it wouldn't be :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:28:00 +00:00
Chris Lattner
9a61194376
Move token length calculation out of the diagnostics machinery into
...
the lexer, where it can be shared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:18:47 +00:00
Chris Lattner
2b65a9ddab
wean the diagnostics machinery off the preprocessor.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43085 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 20:53:57 +00:00
Hartmut Kaiser
7b66000bdf
Updated VC++ build system.
...
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43074 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 15:00:17 +00:00
Chris Lattner
338128bea1
fix problems with test/sema/Cocoa.m etc on non-apple machines.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 06:04:46 +00:00