Commit Graph

812 Commits

Author SHA1 Message Date
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
Chris Lattner f169085834 fill in temporary smallvectors instead of vectors for performance.
Fix BuildAggrIvarLayout to not access vectors out of range.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 08:48:01 +00:00
Chris Lattner cd0ee14a3b small cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 08:33:16 +00:00
Fariborz Jahanian dbf15cb570 - Minor change to dump of ivar layout map.
- Temporarily undef'ed __OBJC2__ in nonfragile objc abi mode
  as it was forcing ivar synthesis in a certain project which clang
  does not yet support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-26 19:10:36 +00:00
Fariborz Jahanian 667423a545 More for for objc2's ivar layout map (currently
is not in use).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-25 22:36:49 +00:00
Fariborz Jahanian 0a855d0bad Must allow for strong cast of floats as well (objc2 gc).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 19:10:40 +00:00
Chris Lattner 74391b48b4 pull "runtime globals" into the same framework as other functions/global variables.
No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22 21:03:39 +00:00
Fariborz Jahanian ebf9ed3193 Fix a crash during meta-data generation of objc2's nonfragile abi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 20:48:19 +00:00
Daniel Dunbar 73f697f1f9 Remove a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15 06:05:20 +00:00
Fariborz Jahanian 3b8a652d60 Fixed an ir-gen bug related to strong-cast generation of
source being a non-pointer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 00:42:52 +00:00
Fariborz Jahanian c8ce9c8c0b More objc2's ivar layout bitmap.
bitmap generation for basic ivars seem to
work now. This is work in progress.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 22:50:49 +00:00
Fariborz Jahanian 21e6f17601 Code refactoring. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11 21:42:00 +00:00
Fariborz Jahanian 9397e1dd41 More of objc2's ivar layout bitmap (Next: specific).
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11 20:59:05 +00:00
Fariborz Jahanian 820e020307 More Next objc2's gc ivar layout bitmap work.
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11 00:07:04 +00:00
Fariborz Jahanian a5a10c37a0 More objc2's gc meta-data work related to ivar layout bitmap.
Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 16:22:08 +00:00
Daniel Dunbar 58a2912800 NeXT: Set alignment on a number of ObjC metadata variables (matching llvm-gcc).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 22:18:41 +00:00
Daniel Dunbar 63c5b50d80 NeXT: Move some routines over to CreateMetadataVar.
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 21:49:58 +00:00
Daniel Dunbar 35bd763b94 Tweak CreateMetadataVar, take the exact alignment instead of relying
on LLVM TargetData.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:50:13 +00:00
Fariborz Jahanian a6681ae9bb More fix for bitfield ivar meta-data and code gen accessing it.
Now, we can actually execute dejagnu test with bitfield ivars
in non-fragile abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:44:22 +00:00
Daniel Dunbar d6e941d37d Fix typo in pref commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:16:39 +00:00
Daniel Dunbar fd65d370b1 NeXT: Add CreateMetadataVar utility method to encapsulate creation of
Obj-C metadata variables (which generally should be handled the same,
although they aren't currently).
 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:09:19 +00:00
Fariborz Jahanian b21f07e056 Code refactoring. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 20:18:37 +00:00
Fariborz Jahanian 11894a4ad6 correct bitfield ivar offset in ivar meta-data.
(objc abi specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 19:43:20 +00:00
Mike Stump 286acbdbe0 Fixup our uses of various linkages to match how llvm now works. I think they are all
correct, but an extra set of ObjC eyes would be good.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 16:33:28 +00:00
Eli Friedman 8339b35ca0 Back out the patch in r66302, and re-fix it properly. We assume for
performance that the type of the returned llvm::Value for an expression 
matches the converted type of the clang::Expr; mismatches will cause all
sorts of errors and silent miscompilations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 03:57:15 +00:00
Daniel Dunbar ede8de95eb Cleanup EH a bit given changes to ObjCCatchStmt.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 00:01:21 +00:00
Fariborz Jahanian d61a50a84d More function stop for objc2's ivar layout bit map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05 22:39:55 +00:00
Fariborz Jahanian d80d81b53c Adds a template for a function for objc2's gc's ivar layout
bitmap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05 19:17:31 +00:00
Devang Patel 7794bb8271 Refactor code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 18:21:39 +00:00
Steve Naroff 7ba138abd3 Fix <rdar://problem/6640991> Exception handling executes wrong clause (Daniel, please verify).
Also necessary to fix:

<rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements
<rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:52:17 +00:00
Daniel Dunbar 4ff36847f4 First cut at zero-cost EH support.
- Still manually generates the EH code; the parts related to cleanup
   need to be integrated into the cleanup stack (for proper
   interaction with VLAs, etc.).

 - Some differences vs gcc in corner cases; I believe our behavior is
   correct but need to verify/file bugs vs gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 06:08:11 +00:00
Daniel Dunbar cec4c77bf4 Make sure to invoke (not call) to objc_exception_throw if necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 05:20:36 +00:00
Daniel Dunbar dfff23060b Fix completely broken thinko in GetClassGlobal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 05:18:14 +00:00
Daniel Dunbar 8def799ef5 Obj-C non fragile ABI: Use GetClassGlobal in one more instance I missed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 04:51:18 +00:00
Daniel Dunbar e588b9924f Obj-C non fragile ABI: Add GetInterfaceEHType for getting the Obj-C
exception typeinfo metadata, and a few other EH related types/functions.
 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 04:46:24 +00:00
Daniel Dunbar 5a7379a0d7 NeXT: Unify code for creating a class global.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 04:40:10 +00:00
Daniel Dunbar 93b2bdb866 ObjCAtCatchStmt's ParamStmt is always a DeclStmt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 04:28:32 +00:00
Fariborz Jahanian 7ce77920a3 Obscure code gen bug related to sending
message to 'super' in a class method declared in
cateogy (darwin specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 20:07:56 +00:00
Fariborz Jahanian 5a1edf6c0d Alignment of pointers in __objc_classlist must be on their
natural alignment. Otherwise, the excess hole confuses the
objc2 runtime (this is darwin specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28 00:54:00 +00:00
Fariborz Jahanian 21228b7753 Couple of meta-data segments were wrong. This patch fixes them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 22:30:39 +00:00
Fariborz Jahanian fab98c4e24 Fix an inconsistance in objc2's meta-data related to
the symbol for the root meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 18:23:47 +00:00
Fariborz Jahanian 66a5c2c0da patch for two things.
make sure objc2's nonfragile abi is enacted for Leopard too.
add -fobjc-gc-only flag to the image_info symbol.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:34:44 +00:00
Fariborz Jahanian 067986e534 Set flag for -fobjc-gc in IMAGE_INFO variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 21:08:09 +00:00
Daniel Dunbar 8ecbaf25c1 Some initial Obj-C zero cost EH support.
- Only handles cases with @try with no @catch blocks, and there are a
   number of problems with the implementation. Nevertheless, this is
   good enough to handled @synchronized correctly, and some other
   basic uses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 07:47:38 +00:00
Daniel Dunbar 1c56667feb Fix two @synchronized bugs found by inspection: the expression to sychronize on should only be evaluated once, and it is evaluated outside the cleanup scope.
Also, lift SyncEnter and SyncExit up in nervous anticipation of x86-64
zero cost EH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 01:43:46 +00:00
Fariborz Jahanian a223cca775 More objc's gc ir-gen stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 23:36:06 +00:00
Anders Carlsson f57c5b2ef7 Add support for throwing exceptions to the nonfragile ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 22:59:18 +00:00
Fariborz Jahanian 6948aea366 Added implementation of objc2's gc API calls for
nonfragile abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 22:52:32 +00:00
Daniel Dunbar 28ed084748 assert/ErrorUnsupported in unimplemented stub functions instead of
miscompiling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 18:48:45 +00:00
Daniel Dunbar 948e258950 Obj-C non-fragile ABI: Fix types of a few globals; these were not
creating valid LLVM structures (although they work fined).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 07:36:20 +00:00
Fariborz Jahanian 3ab75bde6d Fixed a bad ir-gen bug which caused a dejagnu test to fail.
Now we are pretty close to be in sync with objc's classic 
abi when it comes to passing dejagnu objc executable tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 21:25:36 +00:00
Fariborz Jahanian f3710babc1 Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 20:13:28 +00:00
Fariborz Jahanian 943ed6ff5f Fixed a 64bit code gen bug of a cateogory
implementation with no category declaration!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 17:52:22 +00:00
Fariborz Jahanian 01a0c3624a Fix a bug whereby, an ivar used to synthesize a property belongs
to a base class (nonfragile abi ir gen bug).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 18:51:23 +00:00
Steve Naroff 389bf46ae4 Several cleanups:
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 17:52:19 +00:00
Fariborz Jahanian 26cc89ffb1 ir-gen for objc's @selector expression in nonfragile abi mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:51:17 +00:00
Fariborz Jahanian 3afdfd7061 This patch is all it takes to pass all objc2's fast-enumeration
tests in the dejagnu test suite in the nonfragile abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 22:46:12 +00:00
Fariborz Jahanian ed157d3952 Generate ir for ivar offset. This will pass
type-nsobject-attribute.m in the dejagnu test suite
in the nonfragile abi mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 20:21:06 +00:00
Fariborz Jahanian f63aa3fd42 Some refactoring of Ivar offset code gen.
in preparation for nonfragile ivar offset work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 19:02:04 +00:00
Anders Carlsson fa1f756f88 Remove the last remnants of the Obj-C EH stack code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 06:07:49 +00:00
Anders Carlsson f3a79a96ee Use the new cleanup infrastructure for @try/@finally
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64160 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 20:38:58 +00:00
Anders Carlsson 48de1012a2 Add a simplified EmitJumpThroughFinally and use it in CGObjC in preparation of making it use the cleanup stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 22:25:30 +00:00
Anders Carlsson 273558fbd8 Split the exception object out into its own stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 21:37:21 +00:00
Anders Carlsson 190d00e139 Simplify the Objective-C exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 21:26:04 +00:00
Fariborz Jahanian 169c7f8fa6 Fixed an objc2 nonfragile-abi code gen bug.
Now we can say 'hello world' objective-c style
in the nonfragile abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 23:46:26 +00:00
Fariborz Jahanian 7a06aae468 objc2's nonfragile abi API for messages sent to 'super'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06 20:09:23 +00:00
Fariborz Jahanian 0e81f4b58d objc2's nonfragile-abi - API selection for when receiver is a class
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 20:41:40 +00:00
Fariborz Jahanian 1a6b3686bf More objc2's API chanes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 19:35:43 +00:00
Fariborz Jahanian c170852db6 #ifdef'out out objc2 API selection which is not done in gcc (unlike
the documentation to the contrary).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 18:00:27 +00:00
Fariborz Jahanian ef163782d2 This patch generates messaging code for objc2's non-fragile abi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 01:13:09 +00:00
Fariborz Jahanian 83a8a7534c Some early code for objc2's nonfragile abi messaging.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 20:42:28 +00:00
Daniel Dunbar 34c94a2bab Change construction of common ObjC functions to use CGCall
infrastructure to construct function type.
 - For consistencty, we should probably always use this to construct
   function types, but these are absolutely necessary to ensure that
   we can emit calls to these functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 00:44:42 +00:00
Fariborz Jahanian 4655112d1c Some function stub added for new abi messaging.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 00:22:57 +00:00
Fariborz Jahanian 2e4672b531 Several new declarations for objc2 nonfragile
abi messaging.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 23:49:23 +00:00
Fariborz Jahanian 598d3f61b6 ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63644 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 19:03:09 +00:00
Fariborz Jahanian 07da367ca2 Minor objc2 bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 17:34:34 +00:00
Fariborz Jahanian 45012a7ef5 objc2's ir-gen for nonfragile ivar access.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 00:09:52 +00:00
Daniel Dunbar 541b63b1a9 Thread CGFunctionInfo construction through CodeGenTypes.
- Inefficient & leaks memory currently, will be cleaned up subsequently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 23:23:47 +00:00
Daniel Dunbar 88b5396b08 More ABI API cleanup.
- Lift CGFunctionInfo creation above ReturnTypeUsesSret and
   EmitFunction{Epi,Pro}log.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 22:03:45 +00:00
Daniel Dunbar bb36d331f4 ABI handling API changes.
- Lift CGFunctionInfo creation up to callers of EmitCall.

 - Move isVariadic bit out of CGFunctionInfo, take as argument to
   GetFunctionType instead.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 21:43:58 +00:00
Fariborz Jahanian 0bb20361a3 Refactored code gen for ivar access in preparation for
objc2 nonfragile ivar access code gen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 20:02:29 +00:00
Fariborz Jahanian 09796d6a23 Use target alignment API to set objc2's meta-data
alignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 02:43:27 +00:00
Daniel Dunbar 725ad31086 Kill off CGCallInfo, always use CGFunctionInfo for encapsulating
function/call info.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 02:19:00 +00:00
Fariborz Jahanian dd0db2a60b class meta-data belong to __objc_data section (in objc2
nonfragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 01:07:39 +00:00
Fariborz Jahanian cf55516a2f Recognize class's visibility attribute and set its linkage
to private extern (in objc2 nonfragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31 00:59:10 +00:00
Fariborz Jahanian fdbe11db00 Missed another mis-alignment of an objc2 meta-data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 23:51:52 +00:00
Fariborz Jahanian 014858b69f Setting correct alignent for objc2 meta-data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 23:15:42 +00:00
Fariborz Jahanian 0f6610e417 add imag_info section and data (for objc2 nonfragile abi).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 22:07:48 +00:00
Fariborz Jahanian f87a0ccb05 Generate list of implemented classes and categories in their
own sections (related to objc2 nonfragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63418 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 20:55:31 +00:00
Fariborz Jahanian 8cfd397d5f Code gen. for @protocol expression in the new nonfragile abi.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 18:58:59 +00:00
Fariborz Jahanian 3819a0bf47 Bug fixing involving method-list in protocol meta-data
(objc2 nonfragile-abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 00:46:37 +00:00
Fariborz Jahanian eb73213150 Random bug fix related to protocl metadata in categories in
non-fragile abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 23:23:06 +00:00
Fariborz Jahanian 8448c2cdab Set protocol linkage and visibility correctly and
build protocol translation table meta-data (objc2
non-fragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 20:10:59 +00:00
Fariborz Jahanian da3200986d Protocol meta-data for objc2's non-fragile abi.
Lot more to do in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 19:24:30 +00:00
Fariborz Jahanian 939abced90 Add setter/getter methods to the list of methods
of class's meta-data (related to objc2 nonfragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:46:49 +00:00
Fariborz Jahanian 5de14dc879 property metadata for objc2's nonfragile abi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:18:42 +00:00
Fariborz Jahanian 46b86c610e Some refactoring of common code. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 19:12:34 +00:00
Fariborz Jahanian 2fa5a27f38 Set visibility of ivar offset symbols according to
accessibility of the ivar (related to objc2's
non-fragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63166 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 01:36:42 +00:00
Fariborz Jahanian 1bf0afbb08 Generation of ivar-offset symbols in objc2's non-fragile abi.
Changed section names for meta-data (to match current gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 01:05:23 +00:00
Fariborz Jahanian 07236ba8d3 After talking to our runtime guru, I added a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63141 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 22:27:56 +00:00
Fariborz Jahanian 98abf4bd35 ivar meta-data generation for nonfragile-abi.
Still more work to do in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 19:38:51 +00:00
Fariborz Jahanian 5284733354 Added a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 23:49:05 +00:00
Fariborz Jahanian f6317dd7da Build method-description-list for category meta-data
as well (for nonfragile-abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 22:58:07 +00:00
Fariborz Jahanian 493dab7fe5 Method decription meta-data and its setting in class_ro_t
meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 21:38:32 +00:00
Fariborz Jahanian eb062d922f Meta-data for nonfragile-abi's categories
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 18:32:24 +00:00
Fariborz Jahanian f6a077edbb Compute instaceStart/instanceSize fields of the class_ro_t meta-data
for objc2's non-fragile abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 23:43:01 +00:00
Fariborz Jahanian 84394a50e3 Patch to build class meta-data for each implementation
of class in objc2's nonfragile abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62935 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 21:21:53 +00:00
Fariborz Jahanian 058a1b7f9d This patch builds the meta-class object for each
implemented class in objc2's nonfrigile abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 20:21:50 +00:00
Fariborz Jahanian aa23b570b0 Some very early work for new objc's
meta-data generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 23:53:38 +00:00
Fariborz Jahanian f31c7293ff Checked in an oops!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 17:48:29 +00:00
Fariborz Jahanian 45c2ba0c13 Another missing LLVM type for objc2's new abi defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 17:41:22 +00:00
Fariborz Jahanian d55b6fc5f3 Define LLVM types for nonfragile abi metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 01:46:23 +00:00
Fariborz Jahanian 30bc57187b Use NonFragileABI as name of new Next abi. More comments
for the new meta-data.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 23:02:58 +00:00
Fariborz Jahanian db2868616b More refactoring of common API to the common class for
the two Next's objc runtimes. More comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22 00:37:21 +00:00
Fariborz Jahanian 56210f780b Moved whole bunch of common APIs to the common class.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 23:34:32 +00:00
Fariborz Jahanian ee0af74d1e Refactoring ObjC Next's runtime classes in preparation for
the new ObjC's abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 22:04:16 +00:00
Fariborz Jahanian 10a4231e73 Commented objective-c's metadata types. Minor clean up.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21 00:39:53 +00:00
Douglas Gregor 4afa39deaa Remove ScopedDecl, collapsing all of its functionality into Decl, so
that every declaration lives inside a DeclContext.

Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.

The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 01:17:11 +00:00
Fariborz Jahanian f54b19497c Patch to re-implement ivar-list meta-data generation to fix
cases of unnamed ivar bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 19:36:33 +00:00
Douglas Gregor 482b77d1cb Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 23:27:07 +00:00
Daniel Dunbar 491c7b77cd (LLVM up) Match TargetData API change in LLVM TOT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 21:08:18 +00:00
Steve Naroff 93983f8fa1 Convert property implementation to DeclContext::addDecl().
This completes the ObjCContainerDecl AST cleanup (for now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-11 12:47:58 +00:00
Fariborz Jahanian 679a502d46 This patch fixes the code gen failures which was a fallout from
not merging protocol properties into the classes which
use those protocols. With this patch, all my exceutable
test pass again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62030 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-10 21:06:09 +00:00
Douglas Gregor f8d49f64ef Provide a new kind of iterator, the specific_decl_iterator, that
filters the decls seen by decl_iterator with two criteria: the dynamic
type of the declaration and a run-time predicate described by a member
function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl
considerably. It has no measurable performance impact.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 17:18:27 +00:00
Steve Naroff 09c4719788 Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).
Add isa/cast/dyncast support for ObjCContainerDecl.
Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing).
More simplifications to Sema::ActOnAtEnd()...
Added/changed some FIXME's as a result of the above work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 15:36:25 +00:00
Fariborz Jahanian b0d27943e1 Another nasty code gen. bug with trivial fix. Calling class
method on 'super' receiver in a category implementation.
Other simpler cases were working by accident.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 20:11:22 +00:00
Fariborz Jahanian 43822eaedd More encoding support. This time for
@encode of classes and bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 23:34:38 +00:00
Fariborz Jahanian fd64bb635d Code gen. for ivar references; including bitfield
ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61043 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 20:35:07 +00:00
Douglas Gregor 44b4321fea Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
  * Make DeclContext the central data structure for storing and
    looking up declarations within existing declarations, e.g., members
    of structs/unions/classes, enumerators in C++0x enums, members of
    C++ namespaces, and (later) members of Objective-C
    interfaces/implementations. DeclContext uses a lazily-constructed
    data structure optimized for fast lookup (array for small contexts,
    hash table for larger contexts). 

  * Implement C++ qualified name lookup in terms of lookup into
    DeclContext.

  * Implement C++ unqualified name lookup in terms of
    qualified+unqualified name lookup (since unqualified lookup is not
    purely lexical in C++!)

  * Limit the use of the chains of declarations stored in
    IdentifierInfo to those names declared lexically.

  * Eliminate CXXFieldDecl, collapsing its behavior into
    FieldDecl. (FieldDecl is now a ScopedDecl).

  * Make RecordDecl into a DeclContext and eliminates its
    Members/NumMembers fields (since one can just iterate through the
    DeclContext to get the fields).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-11 16:49:14 +00:00
Anders Carlsson 565c99f45e Append an extra newline to the module inline asm if it's not empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 02:21:04 +00:00
Chris Lattner d9d22dd9c9 Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:29:24 +00:00
Chris Lattner 8ec03f58c3 Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:54:41 +00:00
Chris Lattner 077bf5e2f4 Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector 
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:33:13 +00:00
Fariborz Jahanian f2878e5dff Fixed bugzilla bug# 3095 related to code gen. for @synchronized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:21:53 +00:00
Fariborz Jahanian bd71be4683 Consolidated @try and @synchronize into a single
code gen. method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59767 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 00:49:24 +00:00
Fariborz Jahanian 7eda8367cf Introducing objc_assign_ivar to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 19:23:36 +00:00
Fariborz Jahanian dbd32c20c5 Few more changes due to Daniel's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 17:34:06 +00:00
Fariborz Jahanian 5862650052 Generate strong write barriers for __strong objects.
Also, took care of Daniel's commments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 00:59:10 +00:00
Fariborz Jahanian 3e283e3445 Patch for generation of weak write barriers for objc
__weak objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 22:37:34 +00:00
Fariborz Jahanian 6dc2317b59 Generate objc_read_weak for __weak objc loads.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 21:45:40 +00:00
Fariborz Jahanian 6d657c4809 Some basic support toward objective-c's GC code gen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 20:18:11 +00:00
Douglas Gregor 2e1cd4264d Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 14:58:09 +00:00
Chris Lattner 10cac6f711 Start implementing support for @synchonized with the darwin ObjC API.
Patch by Fariborz!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-15 21:26:17 +00:00
Daniel Dunbar a448fb2da0 Rework IRgen invariant w.r.t. current insert point.
- EmitStmt is no longer required to finish with a current insertion
   point defined (i.e. it does not need to make dummy
   blocks). Instead, it can clear the insertion point in the builder
   which indicates that the current insertion point is unreachable.
 - CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
   which respectively test if there is an insert point and ensure an
   insertion point exists (by making a dummy block).
 - Clearly mark functions in CodeGenFunction which can be called with
   no insertion point defined. Currently this is a limited set, and
   EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.

Remove EmitDummyBlock, which is no longer needed. Clients who haven't
already cleared the insertion point (typically via EmitBranch) can do
so by hand.

Remove isDummyBlock, which has effectively been renamed to
HaveInsertPoint.

The main thrust of this change is that we no longer have create dummy
blocks just to destroy them a short time later in EmitBlock in the
common case that there is no unreachable code following something like
a goto. 

Additionally, this means that we are not using the hokey condition in
isDummyBlock that a block without a name is a dummy block. Guess how
well that works when we never emit block names!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:11:34 +00:00
Daniel Dunbar d57a871339 Add CodeGenFunction::EmitBranch.
- Emits an unconditional branch, with extra logic to avoid generating
   spurious branches out of dummy blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 09:41:28 +00:00
Daniel Dunbar 824e3bd76b Add CodeGenFunction::EmitDummyBlock for marking places where we make
"dummy" blocks (blocks just used to make sure we have a place to dump
code to).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 04:34:23 +00:00
Daniel Dunbar 55e874299f Centralize basic block creation in CodeGenFunction::createBasicBlock.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 02:29:29 +00:00
Daniel Dunbar 45d196b838 Move IRBuilder type definition to common file.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-01 01:53:16 +00:00
Daniel Dunbar 0c0e7a6521 NeXT: Emit protocol objects lazily.
- That is, the metadata for a protocol is only emitted if that
   protocol is actually used in the translation unit. This is
   important because Objective-C headers frequently contain a large
   number of protocol definitions, only a few of which will be used in
   any given file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 22:36:39 +00:00
Daniel Dunbar 0d504c1da8 Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 20:21:44 +00:00
Daniel Dunbar d96b35bc6b More Obj-C type encoding improvements.
- Encode unions and bit-fields correctly.
 - Accept option to name record fields (used for NeXT runtime).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 16:17:37 +00:00
Daniel Dunbar 5669e57b4a NeXT: Use objc_msgSend_fpret for calling functions which return
floating point. This is only correct for x86-32 at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 03:24:53 +00:00
Ted Kremenek de3b8fb02b Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of a @catch statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-06 20:58:56 +00:00
Daniel Dunbar 91cd320ea2 (LLVM up) Rename IRBuilder::IsNonNull -> IsNotNull.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 17:05:36 +00:00
Daniel Dunbar ad2dc71a6f NeXT: Update to use CreateRuntimeFunction for the routines it imports.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 01:06:06 +00:00
Daniel Dunbar 898d508d4c Add infrastructure for proper @finally support.
- Provides a basic primitive to jump to an arbitrary basic block,
   through the finally code.

 - Only used for return statements and rethrow currently. Still need
   to handle break, continue and goto.

 - Code still needs to be shuffled around to live elsewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-30 01:06:03 +00:00
Daniel Dunbar 18ccc7776a Add support for implicit rethrows in @catch blocks.
Comment exception-handling code generation strategy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-28 01:03:14 +00:00
Daniel Dunbar e4b5ee0615 (Update LLVM) Clean up obj-c exception generation to be a bit more
readable and to generate more readable IR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 23:30:04 +00:00
Daniel Dunbar 97f61d14c8 Bug fix, codegen @catch(id<X> ...) acceptably.
- This should be rejected by sema (IMHO) but that needs some
   investigation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 22:21:14 +00:00
Daniel Dunbar 129271a429 Simplify generate code for exceptions:
- There is no need to branch on the rethrow variable to determine if
   we need to call objc_exception_try_exit. We know whether an
   exception was thrown, so just branch to a different target if we
   want to skip the try_exit. 

   This is a slight semantic departure from gcc, but only for throwing
   nil, which is undefined (and for which gcc emits broken code).

 - Also fixes a bug in current code which was calling try_exit too
   many times when an exception was uncaught (but there were some
   handlers).

Fix bug introduced in prev. commit, the type of the @catch parameter
was uninitialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 07:36:24 +00:00
Daniel Dunbar 55e40721e7 Bug fix, make sure to initialize exception object (to rethrow) even
when there are no @catch blocks.

Also, eliminated unneeded alloca for the rethrow object.

Also, avoid generating code to rethrow exception if the exception will
trivially always be caught.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56751 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 07:03:52 +00:00
Daniel Dunbar 10004916db Easy fix for nasty bug, exception data buffer had wrong type == wrong
(smaller) size == garbage on stack == heisenbugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 06:32:25 +00:00
Daniel Dunbar 86957eb200 Implement Obj-C synthesized setters for copy / retain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 06:32:09 +00:00
Daniel Dunbar 49f6602707 Add Obj-C runtime methods to get runtime specific functions for
implementing property access.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 03:38:44 +00:00
Anders Carlsson dde0a94120 Make sure to store the exception in the catch parameter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-11 09:15:33 +00:00
Anders Carlsson 1452f5599d Make sure to emit the catch parameter as well as the catch body.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-11 08:21:54 +00:00
Anders Carlsson 4b7ff6ebd7 Fix stupid mistake I made in the exception handling code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-11 06:35:14 +00:00
Daniel Dunbar 62d5c1b503 Add CodeGenTypes::GetFunctionType overload for getting the effective
type of a call.

Change NeXT runtime to use this instead of trying to bitcasting
internally (which doesn't respect the ABI).

Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is
bad inside GetFunctionType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-10 07:00:50 +00:00
Daniel Dunbar 45c25ba11c Move FunctionType conversion into CGCall.cpp:
- Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
 - Updated Obj-C runtimes to use this instead of rolling the
   llvm::FunctionType by hand.
 - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.

Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
 - Will move to target sometime soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56047 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-10 04:01:49 +00:00
Daniel Dunbar b768807c49 Tweak CGCall functions again:
- Realized these functions will eventually need access to more data,
   moved to CodeGenModule. Eventually they should probably live
   together in some other helper class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-10 00:41:16 +00:00
Daniel Dunbar 3913f184c8 Add CodeGenFunction::ReturnTypeUsesSret
- Hook so NeXT runtime doesn't depend on ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 23:48:28 +00:00
Anders Carlsson 80f2567e30 Check in half-assed implementation of @try/@catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 17:59:25 +00:00
Anders Carlsson 2b1e311009 Simple @throw support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 16:16:55 +00:00
Anders Carlsson 124526b72f Add types and functions related to exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 10:10:21 +00:00
Anders Carlsson 64d5d6c590 Move handling of @try and @throw to the runtime class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 10:04:29 +00:00
Daniel Dunbar 46f45b9bec Change CodeGen to emit calls using (RValue,Type) list:
- Add CodeGenFunction::EmitAnyExprToTemp
   o Like EmitAnyExpr, but emits aggregates to a temporary location if
     none is available. Seems like this should be simpler (even aside
     from using first class aggregates).

 - Killed CodeGenFunction::EmitCallArg (just append the pair)

 - Conversion of RValues to actual call arguments is now isolated in
   CodeGenFunction::EmitCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 01:06:48 +00:00
Ted Kremenek 4b7c98378a Change struct forward declarations and definitions to use unique RecordDecls, as opposed to creating a single RecordDecl and reusing it.
This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).

The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.

- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
  addition of DeclGroups.

Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
  referenced by the AST.  For example:

    typedef struct { ... } x;  

  The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
  refer to it.  This will be solved with DeclGroups.
  
- This patch also (temporarily) breaks CodeGen.  More below.

High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it.  When
  a struct/union/class is first referenced, a RecordType and RecordDecl are
  created for it, and the RecordType refers to that RecordDecl.  Later, if
  a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
  updated to point to the RecordDecl that defines the struct/union/class.

- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
  TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
  enum/struct/class/union. This is useful from going from a RecordDecl* that
  defines a forward declaration to the RecordDecl* that provides the actual
  definition. Note that this also works for EnumDecls, except that in this case
  there is no distinction between forward declarations and definitions (yet).

- Clients should no longer assume that 'isDefinition()' returns true from a
  RecordDecl if the corresponding struct/union/class has been defined.
  isDefinition() only returns true if a particular RecordDecl is the defining
  Decl. Use 'getDefinition()' instead to determine if a struct has been defined.

- The main changes to Sema happen in ActOnTag. To make the changes more
  incremental, I split off the processing of enums and structs et al into two
  code paths. Enums use the original code path (which is in ActOnTag) and
  structs use the ActOnTagStruct. Eventually the two code paths will be merged,
  but the idea was to preserve the original logic both for comparison and not to
  change the logic for both enums and structs all at once.

- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
  that correspond to the same type simply have a pointer to that type. If we
  need to figure out what are all the RecordDecls for a given type we can build
  a backmap.

- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
  changes to RecordDecl. For some reason 'svn' marks the entire file as changed.

Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
  RecordType*. This was true before because we only created one RecordDecl* for
  a given RecordType*, but it is no longer true. I believe this shouldn't be too
  hard to change, but the patch was big enough as it is.
  
I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).  


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55839 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 17:16:31 +00:00
Ted Kremenek df042e6c2b Remove "NextDecl" from RecordDecl. This change touches many files that where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.
The motivation behind this change is that chaining the RecordDecls is simply unnecessary.  Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-05 01:34:33 +00:00
Daniel Dunbar c67876d688 NeXT: Emit lazy reference to Protocol class for forward protocol
references (to match gcc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-04 04:33:15 +00:00
Daniel Dunbar e66f4e3e3a Fix ObjCPropertRefExpr to be able to encode all the information for
uses which refer to methods not properties.
 - Not yet wired in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55681 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 00:27:26 +00:00
Anders Carlsson 2abd89c039 Handle mutation while enumerating correctly. Fix some bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-31 04:05:03 +00:00
Daniel Dunbar 7f8ea5c5b3 Add Objective-C property setter support.
- Change Obj-C runtime message API, drop the ObjCMessageExpr arg in
   favor of just result type and selector. Necessary so it can be
   reused in situations where we don't want to cons up an
   ObjCMessageExpr.
 - Update aggregate binary assignment to know about special property
   ref lvalues.
 - Add CodeGenFunction::EmitCallArg overload which takes an already
   emitted rvalue.

Add CodeGenFunction::StoreComplexIntoAddr.

Disabled logic in Sema for parsing Objective-C dot-syntax that
accesses methods. This code does not search in the correct order and
the AST node has no way of properly representing its results.

Updated StmtDumper to print a bit more information about
ObjCPropertyRefExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-30 05:35:15 +00:00
Daniel Dunbar 19cd87eb5f Refactor handling of calls:
- Added CodeGenFunction::EmitCall which just takes the callee, return
   type, and a list of (Value*,QualType) pairs.
 - Added CodeGenFunction::EmitCallArg which handles emitting code for
   a call argument and turning it into an appropriate
   (Value*,QualType) pair.
 - Changed Objective-C runtime interface so that the actual emission
   of arguments for message sends is (once again) done in the code to
   emit a message send.

No intended functionality change, this is prep work for better ABI
support and for Objective-C property setter support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-30 03:02:31 +00:00
Daniel Dunbar 662174c82e Downgrade a number of FIXME asserts to ErrorUnsupported.
- Notably VLAs


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-29 17:28:43 +00:00
Daniel Dunbar c56f34a1c1 NeXT: Emit mostly-correct property type encoding.
- Added ASTContext::getObjCEncodingForPropertyDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-28 04:38:10 +00:00
Daniel Dunbar ae226fa114 NeXT: Refactor protocol method metadata emission.
Also, fix category protocol list metadata.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 02:31:56 +00:00
Daniel Dunbar 86e2f40071 NeXT: Emit correct properties for category.
- Was emitting duplicates of class properties instead of the category
   properties.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55395 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26 23:03:11 +00:00
Daniel Dunbar c45ef600ed NeXT: Emit metadata for synthetsized properties.
Also, fix method lookup to not use LLVM module symbol table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26 21:51:14 +00:00
Daniel Dunbar af05bb9073 Objective-C @synthesize support.
- Only supports simple assignment and atomic semantics are ignored.
 - Not quite usable yet because the methods do not actually get added
   to the class metadata.
 - Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain).
 - Rearrange CodeGenFunction so synthesis can reuse function prolog /
   epilog code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55365 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-26 08:29:31 +00:00
Daniel Dunbar f56f1913e9 Fix Obj-C super sends inside class methods.
- NeXT loads the super class at runtime; this required changing the
   runtime interface to pass more information down.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55307 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-25 08:19:24 +00:00
Daniel Dunbar 242d4dce3a NeXT: Emit symbols used to manage linking of Obj-C classes.
- This ensures that references to undefined classes cause link
   errors.
 - NOTE: This relies on platform specific asm directives currently,
   this should be factored out.

Also, don't emit a SYMBOLS metadata entry if there are no symbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-25 06:02:07 +00:00
Daniel Dunbar 3e9df9920d NeXT: Clean up constant CFString handling.
- Use CodeGenModule::GetAddrOfConstantCFString

Some tweaks of CodeGenModule::GetAddrOfConstantCFString


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55243 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 18:37:06 +00:00
Daniel Dunbar 14c80b7ed6 NeXT: Fix message sends which return structures.
- Simplify the sending code a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55232 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 09:25:55 +00:00
Daniel Dunbar e8b470d40c NeXT: Implement super message sends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 04:28:29 +00:00
Daniel Dunbar 8f2926b73e Trim CGObjCRuntime::GenerateMessageSend[Super]
- Returns an RValue.
 - Reduced to only taking the CodeGenFunction, Expr, and Receiver.
 - Becomes responsible for emitting the arguments.

Add CodeGenFunction::EmitCallExprExt
 - Takes optional extra arguments to insert at the head of the call.
 - This allows the Obj-C runtimes to call into this and isolates the
   argument and call instruction generation code to one place. Upshot
   is that we now pass structures (more) correctly.

Also, fix one aspect of generating methods which take structure
arguments (for NeXT). This probably needs to be merged with the
SetFunctionAttributes code in CodeGenModule.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 03:46:30 +00:00
Daniel Dunbar c8ef551615 NeXT: Emit property metadata (classes, protocols, categories).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 00:19:03 +00:00
Daniel Dunbar 86e253a0cb NeXT: Emit category metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55197 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 20:34:54 +00:00
Daniel Dunbar dbc933701d NeXT: Emit [meta]class protocol references.
Updated ObjCProtocolDecl::protocol_iterator to match that of
ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 21:57:41 +00:00
Daniel Dunbar 27f9d77b61 Preliminary support for Obj-C classes in NeXT runtime.
- Functional for simple cases but there are some glaring omissions
   (protocols, properties, and other language extensions).
 - The code needs a fair bit of cleaning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 04:36:09 +00:00
Daniel Dunbar b7ec246872 Add NeXT runtime support for generating methods.
Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an
  ImplicitParamDecl.

Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in
  CodeGenFunction).

Change the Objective-C method generation to use EmitParmDecl for
  implicit parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 03:19:19 +00:00
Daniel Dunbar ddb2a3d55a Change ObjCRuntime::LookupClass -> GetClass, and now takes the
ObjCInterfaceDecl.

Change ObjCRuntime::GenerateMessageSendSuper to take the
  ObjCInterfaceDecl for the super class, instead of just its name.

Change EmitObjCMessageExpr to make the right runtime calls for super
  sends in class methods (i.e. a super send with the class object as
  the receiver).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 00:25:02 +00:00
Daniel Dunbar 7ded7f4983 Change CGObjCRuntime methods to take appropriate clang Decls.
- This is in prep for implementation class support for the NeXT
   runtime, for which the existing methods don't provide enough
   information (and additionally make too many assumptions about how
   things should be emitted).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 22:20:32 +00:00
Daniel Dunbar 6efc0c559b Implement Obj-C protocol metadata generation for NeXT.
- Near complete, only properties are missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 03:21:16 +00:00
Daniel Dunbar af2f62ce32 Change ObjCRuntime GenerateProtocol[Ref] methods to take
ObjCProtocolDecl directly.

Implement CodeGen support for forward protocol decls (no-ops are so
    nice to implement).

Also moved CGObjCRuntime.h out of CodeGenModule.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 00:59:25 +00:00
Daniel Dunbar 4e2d7d03b2 Emit OBJC_MODULE_INFO and OBJC_SYMBOLS metadata
- Matches llvm-gcc and seem to be expected by otool.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54669 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 06:48:42 +00:00
Daniel Dunbar 2bedbf8549 Drop Sender from GenerateMessageSend*
- Was unused and generated a unnecessary load of self

Update NeXT runtime to get proper object & selector types from
       ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 05:28:47 +00:00
Daniel Dunbar 259d93d1e1 Add NeXT support for (simple) message sends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 03:39:23 +00:00
Daniel Dunbar bbce49b9e5 Add ObjC constant string support for NeXT.
Changed CGObjCRuntime::GenerateConstantString interface to take
       std::string instead of char* and size.

Change ObjC functions which call on GenerateConstantString to bitcast
       result to appropriate type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 00:12:39 +00:00
Daniel Dunbar f77ac86f4e Add LangOptions::NeXTRuntime.
- Wired to -fnext-runtime and -fgnu-runtime options.
 - Defaults to GNU, no autoselection for NeXT.

Emit NeXT OBJC_IMAGE_INFO marker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 21:35:06 +00:00
Daniel Dunbar acc5f3e423 More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 06:23:49 +00:00
Daniel Dunbar e91593ef08 More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 04:54:23 +00:00
Daniel Dunbar c17a4d3b16 Add dummy Mac Objective-C runtime interface.
- Not currently accessible and completely non-functional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54624 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 02:45:11 +00:00