Граф коммитов

129 Коммитов

Автор SHA1 Сообщение Дата
Owen Anderson 4a28d5deeb Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:12:58 +00:00
Daniel Dunbar 309a4368cd Fix declaration of obc_enumerationMutation function, for GNU runtime.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 07:40:24 +00:00
Anders Carlsson 19cc4abea0 Revert r75641.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 19:43:29 +00:00
Chris Lattner ad64e024bd fix objc codegen to not have its own list of things that eventually get into llvm.used, just
populate CGM's list directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 23:57:13 +00:00
Owen Anderson a1cf15f468 Update for LLVM API change, and contextify a bunch of related stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 23:10:40 +00:00
Anders Carlsson 3d598a5ab3 Rename RecordLayout.h to ASTRecordLayout.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 17:29:11 +00:00
Owen Anderson 69243825cb Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-13 04:10:07 +00:00
Steve Naroff 14108da7f7 This patch includes a conceptually simple, but very intrusive/pervasive change.
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. 

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10 23:34:53 +00:00
Owen Anderson aac8705c04 Update for IRBuilder API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 20:52:20 +00:00
Owen Anderson 1c431b323d Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 19:05:04 +00:00
Owen Anderson c14f0d2302 Update for LLVM API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 01:29:18 +00:00
Fariborz Jahanian 082b02e840 Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 01:18:33 +00:00
Fariborz Jahanian c51db23f58 This fixes the case where the wrong symbol is emitted leading to linking errors when you reference a class before defining it (GNU runtime).
Patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-03 15:10:14 +00:00
Chris Lattner b59761b253 use new and simplified LLVM APIs. Patch by Jay Foad!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 04:13:52 +00:00
Argyrios Kyrtzidis 17945a0f64 De-ASTContext-ify DeclContext.
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 02:36:12 +00:00
Fariborz Jahanian c38e9affd4 Patch fixes an obscure bug when 'used' attribute is applied to
variables in ObjC's Next runtime mode. Next runtime also implicitly applies
'used' attribute on some of its meta-data. This results in two 
'llvm.used' arrays to be generated, and one of them is renamed to
'llvm.used1'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-23 21:47:46 +00:00
Chris Lattner 2a8e4e1d85 "GCC emits an __objc_class_name_{classname} symbol for every class, and a corresponding reference to this symbol for every compilation unit that references the class. This causes linker errors when you try linking a program which references some classes but doesn't define them. The attached patch implements this support in clang, so you can compile a class with clang, reference it in a file compiled with GCC, and have it all work correctly."
Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 01:09:11 +00:00
Fariborz Jahanian 8e6ac1d800 Cleanup/Refactoring of ivar collection. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 01:19:09 +00:00
Fariborz Jahanian 34e65770ad This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
compiled with -fobjc-sender-dependent-dispatch.  This is used in AOP, COP, implementing object 
planes, and a few other things.
Patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 20:17:16 +00:00
Fariborz Jahanian 9cd96ff7df This patch provides preliminary support for non-fragile instance variables on the GNU runtime.
It currently requires a patches to GNU libobjc (and so is not enabled by default) which are currently 
being tested and reviewed by GNUstep before being pushed upstream.
This patch does not allow support for synthesized ivars, but does provide the infrastructure 
needed for supporting them.
Patch by David Chisnall



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 18:41:51 +00:00
Fariborz Jahanian cb9dad0393 This patch allows clang to generate code for declared properties on the GNU runtime. As with @synchronized, this requires some extra functions that are included with other libraries (not with the GNU runtime itself) and so will cause linker errors when these are not present.
Patch by David Chisnall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-19 00:28:43 +00:00
Fariborz Jahanian 1e64a9531b This patch fixes two bugs in the GNU Objective-C runtime implementation. One is a case in rethrowing exceptions where the C types don't match correctly (I already sent this patch to Daniel Dunbar, who found the bug, so it may have already been committed). The other fixes the case properties so that the methods generated as property accessors are added to the class structure correctly.
Patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-17 16:49:27 +00:00
Chris Lattner d6a9907cef More improvements for GNU runtime objc EH, patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:16:28 +00:00
Chris Lattner bb422ad4f4 further improvements to gnu objc EH stuff, patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 17:36:08 +00:00
Chris Lattner 48e6e7e810 "This patch fixes message sends to super in categories for the GNU runtime. This used to work, but I broke it when I modified the code to emit the same thing as GCC for message sends to super in classes."
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 15:39:58 +00:00
Chris Lattner 5dc0867af1 initial support for ObjC exceptions with the GNU runtime:
"This patch is a first pass at adding support for exceptions for the GNU runtime.  There are a few limitations at present:

- @synchronized() is not yet supported at all.  gcc currently emits calls to runtime library functions that don't exist for this directive.

- Only id @catch statements are currently working.  This is enough for NS_DURING and friends, but I need to spend more time reading the output from gcc -S to work out how it finds the class pointer to make arbitrary class type catch statements work.

- I've tested it with a few common cases[1] and the clang test suite (which doesn't test exceptions for the GNU runtime, but shows I haven't broken anything else), but there are probably a lot of cases I've missed."

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 00:11:50 +00:00
Fariborz Jahanian df9ccc6381 Patch to support Gnu runtime's typed selectors.
Patch by David Chisnall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 21:36:57 +00:00
Chris Lattner c6e2ab0dd6 "The attached diff fixes the //FIXME in message send to super. This should now be faster, and works in the presence of class posing. This is now the same approach as used in GCC (the earlier code was a quick hack to get something working)."
Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 16:56:33 +00:00
Daniel Dunbar 5efccb1ab8 Patch from David Chisnall:
The attached diff fixes the //FIXME in message send to super.  This
should now be faster, and works in the presence of class posing.  This
is now the same approach as used in GCC (the earlier code was a quick
hack to get something working).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 15:31:17 +00:00
Daniel Dunbar 2bebbf0ace Compute Objective-C metadata size information from the record layout,
not the shadow structure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 10:46:44 +00:00
Daniel Dunbar 1d7e539bbe Coalesce the ivar offset calculation further.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 08:55:17 +00:00
Chris Lattner 16f0049415 split ObjC and C++ Statements out into their own headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 01:32:48 +00:00
Chris Lattner 71238f67c5 "This fixes message sends to super in a way that both works with real code and passes the test in the test suite. It also fixes a crash when using recent versions of GNU libobjc and compiling modules that do not contain any constant strings but do contain a declaration of the constant string class and possible some other corner cases (thanks to Pete French for providing me with a test case for that one)."
Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 23:19:45 +00:00
Douglas Gregor 653f1b1bf2 Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 01:02:12 +00:00
Daniel Dunbar 84ad77a8f8 Add CGObjCRuntime::GetConcreteClassStruct to encapsulate access to the
underlying llvm::StructType for an interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 09:39:34 +00:00
Daniel Dunbar c8cbf19448 Use ComputeIvarBaseOffset instead of looking up by hand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 08:20:31 +00:00
Daniel Dunbar 9777687562 Merge ivar access amongst the three runtimes.
- For now, this means we are always doing the address computations by
   hand instead of constructing a proper GEP. Right now, however, this
   is less important than having fewer entry points to dealing with
   Objective-C interface layout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 07:32:20 +00:00
Daniel Dunbar 2a03192a02 Make ObjCInterfaceDecl's const in some more places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 05:08:15 +00:00
Daniel Dunbar 525c9b7bae Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 01:19:28 +00:00
Daniel Dunbar 6bf2ae05c7 Remove LateBoundIVars() runtime interface, it is unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 00:49:20 +00:00
Daniel Dunbar 9e6c20bae6 Assert on a few conditions that (I believe) should hold
w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to
EmitObjCValueForIvar).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 00:41:40 +00:00
Daniel Dunbar 60952f94cf Remove non-const form of lookupFieldDeclForIvar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 00:37:55 +00:00
Chris Lattner b7b58b1fcd Fix rdar://6804402 - crash on objc implementations declared with
@class but no implementation.  This was broken in all 3 runtime
impls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 06:02:28 +00:00
Chris Lattner 33b3bc9cab revert david's patch, which causes a testsuite failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 01:33:30 +00:00
Chris Lattner 39d462e231 "This patch fixes message sends to super in class methods for the GNU runtime (currently an instance method lookup is being performed)."
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 23:12:40 +00:00
Douglas Gregor 6ab3524f72 Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09 21:40:53 +00:00
Fariborz Jahanian 91a0b51438 Fixes a problem where the compiler is reporting the wrong size to the Gnu
runtime on 64-bit architectures.
Patch by David Chisnall


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 19:49:42 +00:00
Chris Lattner 09dc666048 tidy some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01 02:00:48 +00:00
Fariborz Jahanian f8c4f5469d Patch to fix proptocol reference ir-gen for GNU runtime.
Patch by David Chisnal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 18:27:22 +00:00
Steve Naroff 33fdb738a6 Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.
Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68114 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 16:53:37 +00:00