Chris Lattner
5b36ddb1ad
fill in temporary smallvectors instead of vectors for performance.
...
Fix BuildAggrIvarLayout to not access vectors out of range.
llvm-svn: 68101
2009-03-31 08:48:01 +00:00
Chris Lattner
06ae0e2c3b
small cleanups.
...
llvm-svn: 68095
2009-03-31 08:33:16 +00:00
Fariborz Jahanian
dac14a7159
- 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.
llvm-svn: 67766
2009-03-26 19:10:36 +00:00
Fariborz Jahanian
f909f92799
More for for objc2's ivar layout map (currently
...
is not in use).
llvm-svn: 67713
2009-03-25 22:36:49 +00:00
Fariborz Jahanian
aedcfa49b9
Must allow for strong cast of floats as well (objc2 gc).
...
llvm-svn: 67551
2009-03-23 19:10:40 +00:00
Chris Lattner
d480892445
pull "runtime globals" into the same framework as other functions/global variables.
...
No intended functionality change.
llvm-svn: 67478
2009-03-22 21:03:39 +00:00
Fariborz Jahanian
07038f9785
Fix a crash during meta-data generation of objc2's nonfragile abi.
...
llvm-svn: 67402
2009-03-20 20:48:19 +00:00
Daniel Dunbar
64895a0703
Remove a FIXME.
...
llvm-svn: 67022
2009-03-15 06:05:20 +00:00
Fariborz Jahanian
1b074a3eb7
Fixed an ir-gen bug related to strong-cast generation of
...
source being a non-pointer.
llvm-svn: 66854
2009-03-13 00:42:52 +00:00
Fariborz Jahanian
1bf7288529
More objc2's ivar layout bitmap.
...
bitmap generation for basic ivars seem to
work now. This is work in progress.
llvm-svn: 66836
2009-03-12 22:50:49 +00:00
Fariborz Jahanian
99bee42be2
Code refactoring. No change in functionality.
...
llvm-svn: 66710
2009-03-11 21:42:00 +00:00
Fariborz Jahanian
cbaf73cd26
More of objc2's ivar layout bitmap (Next: specific).
...
Work in progress.
llvm-svn: 66707
2009-03-11 20:59:05 +00:00
Fariborz Jahanian
3b0f886c3f
More Next objc2's gc ivar layout bitmap work.
...
Work in progress.
llvm-svn: 66615
2009-03-11 00:07:04 +00:00
Fariborz Jahanian
524bb20b4b
More objc2's gc meta-data work related to ivar layout bitmap.
...
Work in progress.
llvm-svn: 66546
2009-03-10 16:22:08 +00:00
Daniel Dunbar
ae3338429f
NeXT: Set alignment on a number of ObjC metadata variables (matching llvm-gcc).
...
llvm-svn: 66481
2009-03-09 22:18:41 +00:00
Daniel Dunbar
c2d4b62046
NeXT: Move some routines over to CreateMetadataVar.
...
- No intended functionality change.
llvm-svn: 66473
2009-03-09 21:49:58 +00:00
Daniel Dunbar
463cc8ade5
Tweak CreateMetadataVar, take the exact alignment instead of relying
...
on LLVM TargetData.
llvm-svn: 66455
2009-03-09 20:50:13 +00:00
Fariborz Jahanian
de2f33373b
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.
llvm-svn: 66448
2009-03-09 20:44:22 +00:00
Daniel Dunbar
91b000f771
Fix typo in pref commit.
...
llvm-svn: 66433
2009-03-09 20:16:39 +00:00
Daniel Dunbar
30c653655d
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.
llvm-svn: 66432
2009-03-09 20:09:19 +00:00
Fariborz Jahanian
6772621acf
Code refactoring. No functional change.
...
llvm-svn: 66391
2009-03-08 20:18:37 +00:00
Fariborz Jahanian
03676f557c
correct bitfield ivar offset in ivar meta-data.
...
(objc abi specific).
llvm-svn: 66345
2009-03-07 19:43:20 +00:00
Mike Stump
a6ca334389
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.
llvm-svn: 66342
2009-03-07 16:33:28 +00:00
Eli Friedman
a374b68b5a
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.
llvm-svn: 66321
2009-03-07 03:57:15 +00:00
Daniel Dunbar
9676015e86
Cleanup EH a bit given changes to ObjCCatchStmt.
...
- No functionality change.
llvm-svn: 66218
2009-03-06 00:01:21 +00:00
Fariborz Jahanian
c559f3f175
More function stop for objc2's ivar layout bit map.
...
llvm-svn: 66209
2009-03-05 22:39:55 +00:00
Fariborz Jahanian
01dff426c8
Adds a template for a function for objc2's gc's ivar layout
...
bitmap.
llvm-svn: 66175
2009-03-05 19:17:31 +00:00
Devang Patel
4b6e4bb25d
Refactor code.
...
llvm-svn: 66043
2009-03-04 18:21:39 +00:00
Steve Naroff
371b8fb4c3
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
llvm-svn: 65964
2009-03-03 19:52:17 +00:00
Daniel Dunbar
76b7acc49f
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.
llvm-svn: 65809
2009-03-02 06:08:11 +00:00
Daniel Dunbar
7a38ce4f88
Make sure to invoke (not call) to objc_exception_throw if necessary.
...
llvm-svn: 65808
2009-03-02 05:20:36 +00:00
Daniel Dunbar
a646834214
Fix completely broken thinko in GetClassGlobal.
...
llvm-svn: 65807
2009-03-02 05:18:14 +00:00
Daniel Dunbar
88367f2768
Obj-C non fragile ABI: Use GetClassGlobal in one more instance I missed.
...
llvm-svn: 65762
2009-03-01 04:51:18 +00:00
Daniel Dunbar
b1559a4499
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.
llvm-svn: 65761
2009-03-01 04:46:24 +00:00
Daniel Dunbar
c6928bbe29
NeXT: Unify code for creating a class global.
...
- No functionality change.
llvm-svn: 65760
2009-03-01 04:40:10 +00:00
Daniel Dunbar
947bca2cc9
ObjCAtCatchStmt's ParamStmt is always a DeclStmt.
...
llvm-svn: 65759
2009-03-01 04:28:32 +00:00
Fariborz Jahanian
bac73acc24
Obscure code gen bug related to sending
...
message to 'super' in a class method declared in
cateogy (darwin specific).
llvm-svn: 65709
2009-02-28 20:07:56 +00:00
Fariborz Jahanian
cd073cc2e9
Alignment of pointers in __objc_classlist must be on their
...
natural alignment. Otherwise, the excess hole confuses the
objc2 runtime (this is darwin specific).
llvm-svn: 65666
2009-02-28 00:54:00 +00:00
Fariborz Jahanian
ec3385733a
Couple of meta-data segments were wrong. This patch fixes them.
...
llvm-svn: 65578
2009-02-26 22:30:39 +00:00
Fariborz Jahanian
03b300b734
Fix an inconsistance in objc2's meta-data related to
...
the symbol for the root meta-data.
llvm-svn: 65548
2009-02-26 18:23:47 +00:00
Fariborz Jahanian
240f2b7851
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.
llvm-svn: 65413
2009-02-24 23:34:44 +00:00
Fariborz Jahanian
6fe4306195
Set flag for -fobjc-gc in IMAGE_INFO variable.
...
llvm-svn: 65387
2009-02-24 21:08:09 +00:00
Daniel Dunbar
0b0dcd987d
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.
llvm-svn: 65378
2009-02-24 07:47:38 +00:00
Daniel Dunbar
94ceb61574
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.
llvm-svn: 65362
2009-02-24 01:43:46 +00:00
Fariborz Jahanian
0f466c746f
More objc's gc ir-gen stuff.
...
llvm-svn: 65077
2009-02-19 23:36:06 +00:00
Anders Carlsson
9ab53d120e
Add support for throwing exceptions to the nonfragile ABI
...
llvm-svn: 64692
2009-02-16 22:59:18 +00:00
Fariborz Jahanian
06292955d0
Added implementation of objc2's gc API calls for
...
nonfragile abi.
llvm-svn: 64690
2009-02-16 22:52:32 +00:00
Daniel Dunbar
d73ea816af
assert/ErrorUnsupported in unimplemented stub functions instead of
...
miscompiling.
llvm-svn: 64647
2009-02-16 18:48:45 +00:00
Daniel Dunbar
8de90f0a92
Obj-C non-fragile ABI: Fix types of a few globals; these were not
...
creating valid LLVM structures (although they work fined).
llvm-svn: 64580
2009-02-15 07:36:20 +00:00
Fariborz Jahanian
35afdfc36e
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.
llvm-svn: 64569
2009-02-14 21:25:36 +00:00
Fariborz Jahanian
99bed6fd21
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).
llvm-svn: 64563
2009-02-14 20:13:28 +00:00
Fariborz Jahanian
d8fc1053ab
Fixed a 64bit code gen bug of a cateogory
...
implementation with no category declaration!
llvm-svn: 64470
2009-02-13 17:52:22 +00:00
Fariborz Jahanian
c335c40a4b
Fix a bug whereby, an ivar used to synthesize a property belongs
...
to a base class (nonfragile abi ir gen bug).
llvm-svn: 64391
2009-02-12 18:51:23 +00:00
Steve Naroff
b76051534c
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).
llvm-svn: 64385
2009-02-12 17:52:19 +00:00
Fariborz Jahanian
74b7722c2c
ir-gen for objc's @selector expression in nonfragile abi mode.
...
llvm-svn: 64323
2009-02-11 20:51:17 +00:00
Fariborz Jahanian
d7264430e6
This patch is all it takes to pass all objc2's fast-enumeration
...
tests in the dejagnu test suite in the nonfragile abi mode.
llvm-svn: 64251
2009-02-10 22:46:12 +00:00
Fariborz Jahanian
4e7ae06b00
Generate ir for ivar offset. This will pass
...
type-nsobject-attribute.m in the dejagnu test suite
in the nonfragile abi mode.
llvm-svn: 64233
2009-02-10 20:21:06 +00:00
Fariborz Jahanian
21fc74c15a
Some refactoring of Ivar offset code gen.
...
in preparation for nonfragile ivar offset work.
llvm-svn: 64225
2009-02-10 19:02:04 +00:00
Anders Carlsson
33c1b6528f
Remove the last remnants of the Obj-C EH stack code.
...
llvm-svn: 64205
2009-02-10 06:07:49 +00:00
Anders Carlsson
bfee7e921b
Use the new cleanup infrastructure for @try/@finally
...
llvm-svn: 64160
2009-02-09 20:38:58 +00:00
Anders Carlsson
dcb149cbef
Add a simplified EmitJumpThroughFinally and use it in CGObjC in preparation of making it use the cleanup stack.
...
llvm-svn: 64098
2009-02-08 22:25:30 +00:00
Anders Carlsson
bf8a1be33c
Split the exception object out into its own stack.
...
llvm-svn: 64032
2009-02-07 21:37:21 +00:00
Anders Carlsson
da0e4560a1
Simplify the Objective-C exception handling.
...
llvm-svn: 64031
2009-02-07 21:26:04 +00:00
Fariborz Jahanian
c76e741622
Fixed an objc2 nonfragile-abi code gen bug.
...
Now we can say 'hello world' objective-c style
in the nonfragile abi.
llvm-svn: 63981
2009-02-06 23:46:26 +00:00
Fariborz Jahanian
6b7cd6e5f4
objc2's nonfragile abi API for messages sent to 'super'.
...
llvm-svn: 63959
2009-02-06 20:09:23 +00:00
Fariborz Jahanian
33f66e640a
objc2's nonfragile-abi - API selection for when receiver is a class
...
llvm-svn: 63881
2009-02-05 20:41:40 +00:00
Fariborz Jahanian
4f9d349e07
More objc2's API chanes.
...
llvm-svn: 63878
2009-02-05 19:35:43 +00:00
Fariborz Jahanian
9065541262
#ifdef'out out objc2 API selection which is not done in gcc (unlike
...
the documentation to the contrary).
llvm-svn: 63871
2009-02-05 18:00:27 +00:00
Fariborz Jahanian
4e87c834d3
This patch generates messaging code for objc2's non-fragile abi.
...
llvm-svn: 63810
2009-02-05 01:13:09 +00:00
Fariborz Jahanian
e4dc35deb9
Some early code for objc2's nonfragile abi messaging.
...
llvm-svn: 63770
2009-02-04 20:42:28 +00:00
Daniel Dunbar
4d22e4975a
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.
llvm-svn: 63695
2009-02-04 00:44:42 +00:00
Fariborz Jahanian
3d9296e6f5
Some function stub added for new abi messaging.
...
llvm-svn: 63691
2009-02-04 00:22:57 +00:00
Fariborz Jahanian
82c72e1ee4
Several new declarations for objc2 nonfragile
...
abi messaging.
llvm-svn: 63684
2009-02-03 23:49:23 +00:00
Fariborz Jahanian
712bfa6478
ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).
...
llvm-svn: 63644
2009-02-03 19:03:09 +00:00
Fariborz Jahanian
ebc4c9d2a3
Minor objc2 bug fix.
...
llvm-svn: 63635
2009-02-03 17:34:34 +00:00
Fariborz Jahanian
c88a70d885
objc2's ir-gen for nonfragile ivar access.
...
llvm-svn: 63578
2009-02-03 00:09:52 +00:00
Daniel Dunbar
bf8c24ad89
Thread CGFunctionInfo construction through CodeGenTypes.
...
- Inefficient & leaks memory currently, will be cleaned up subsequently.
llvm-svn: 63567
2009-02-02 23:23:47 +00:00
Daniel Dunbar
d931a87f90
More ABI API cleanup.
...
- Lift CGFunctionInfo creation above ReturnTypeUsesSret and
EmitFunction{Epi,Pro}log.
llvm-svn: 63553
2009-02-02 22:03:45 +00:00
Daniel Dunbar
7633cbf005
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.
llvm-svn: 63550
2009-02-02 21:43:58 +00:00
Fariborz Jahanian
9f84b78ac1
Refactored code gen for ivar access in preparation for
...
objc2 nonfragile ivar access code gen.
llvm-svn: 63541
2009-02-02 20:02:29 +00:00
Fariborz Jahanian
c22f236e81
Use target alignment API to set objc2's meta-data
...
alignment.
llvm-svn: 63470
2009-01-31 02:43:27 +00:00
Daniel Dunbar
3cd20632ff
Kill off CGCallInfo, always use CGFunctionInfo for encapsulating
...
function/call info.
llvm-svn: 63466
2009-01-31 02:19:00 +00:00
Fariborz Jahanian
0408723269
class meta-data belong to __objc_data section (in objc2
...
nonfragile abi).
llvm-svn: 63461
2009-01-31 01:07:39 +00:00
Fariborz Jahanian
822082517f
Recognize class's visibility attribute and set its linkage
...
to private extern (in objc2 nonfragile abi).
llvm-svn: 63460
2009-01-31 00:59:10 +00:00
Fariborz Jahanian
75e0351adb
Missed another mis-alignment of an objc2 meta-data.
...
llvm-svn: 63453
2009-01-30 23:51:52 +00:00
Fariborz Jahanian
e46e284efd
Setting correct alignent for objc2 meta-data.
...
llvm-svn: 63445
2009-01-30 23:15:42 +00:00
Fariborz Jahanian
fa57e8e7ab
add imag_info section and data (for objc2 nonfragile abi).
...
llvm-svn: 63430
2009-01-30 22:07:48 +00:00
Fariborz Jahanian
279abd31a9
Generate list of implemented classes and categories in their
...
own sections (related to objc2 nonfragile abi).
llvm-svn: 63418
2009-01-30 20:55:31 +00:00
Fariborz Jahanian
097feda5e0
Code gen. for @protocol expression in the new nonfragile abi.
...
llvm-svn: 63408
2009-01-30 18:58:59 +00:00
Fariborz Jahanian
d9c28b808b
Bug fixing involving method-list in protocol meta-data
...
(objc2 nonfragile-abi).
llvm-svn: 63351
2009-01-30 00:46:37 +00:00
Fariborz Jahanian
34fe880648
Random bug fix related to protocl metadata in categories in
...
non-fragile abi.
llvm-svn: 63343
2009-01-29 23:23:06 +00:00
Fariborz Jahanian
61cd4b56c3
Set protocol linkage and visibility correctly and
...
build protocol translation table meta-data (objc2
non-fragile abi).
llvm-svn: 63329
2009-01-29 20:10:59 +00:00
Fariborz Jahanian
56b3b77c7d
Protocol meta-data for objc2's non-fragile abi.
...
Lot more to do in this area.
llvm-svn: 63326
2009-01-29 19:24:30 +00:00
Fariborz Jahanian
d27a820ae2
Add setter/getter methods to the list of methods
...
of class's meta-data (related to objc2 nonfragile abi).
llvm-svn: 63251
2009-01-28 22:46:49 +00:00
Fariborz Jahanian
066347ec7b
property metadata for objc2's nonfragile abi
...
llvm-svn: 63246
2009-01-28 22:18:42 +00:00
Fariborz Jahanian
b042a59230
Some refactoring of common code. No change in functionality.
...
llvm-svn: 63218
2009-01-28 19:12:34 +00:00
Fariborz Jahanian
3d3426f321
Set visibility of ivar offset symbols according to
...
accessibility of the ivar (related to objc2's
non-fragile abi).
llvm-svn: 63166
2009-01-28 01:36:42 +00:00
Fariborz Jahanian
40a4bcd49b
Generation of ivar-offset symbols in objc2's non-fragile abi.
...
Changed section names for meta-data (to match current gcc).
llvm-svn: 63163
2009-01-28 01:05:23 +00:00
Fariborz Jahanian
e19a1f15ae
After talking to our runtime guru, I added a comment.
...
llvm-svn: 63141
2009-01-27 22:27:56 +00:00
Fariborz Jahanian
7415caa3d4
ivar meta-data generation for nonfragile-abi.
...
Still more work to do in this area.
llvm-svn: 63126
2009-01-27 19:38:51 +00:00
Fariborz Jahanian
d0e8e85afc
Added a FIXME.
...
llvm-svn: 63071
2009-01-26 23:49:05 +00:00
Fariborz Jahanian
2612e149ef
Build method-description-list for category meta-data
...
as well (for nonfragile-abi).
llvm-svn: 63062
2009-01-26 22:58:07 +00:00
Fariborz Jahanian
99113fd577
Method decription meta-data and its setting in class_ro_t
...
meta-data.
llvm-svn: 63043
2009-01-26 21:38:32 +00:00
Fariborz Jahanian
0c8d060715
Meta-data for nonfragile-abi's categories
...
llvm-svn: 63020
2009-01-26 18:32:24 +00:00
Fariborz Jahanian
a887e63434
Compute instaceStart/instanceSize fields of the class_ro_t meta-data
...
for objc2's non-fragile abi.
llvm-svn: 62945
2009-01-24 23:43:01 +00:00
Fariborz Jahanian
4723fb70a9
Patch to build class meta-data for each implementation
...
of class in objc2's nonfragile abi.
llvm-svn: 62935
2009-01-24 21:21:53 +00:00
Fariborz Jahanian
9e3ad5220d
This patch builds the meta-class object for each
...
implemented class in objc2's nonfrigile abi.
llvm-svn: 62929
2009-01-24 20:21:50 +00:00
Fariborz Jahanian
71394045e4
Some very early work for new objc's
...
meta-data generation.
llvm-svn: 62894
2009-01-23 23:53:38 +00:00
Fariborz Jahanian
7fa50496f6
Checked in an oops!
...
llvm-svn: 62853
2009-01-23 17:48:29 +00:00
Fariborz Jahanian
5a63e4cd53
Another missing LLVM type for objc2's new abi defined.
...
llvm-svn: 62852
2009-01-23 17:41:22 +00:00
Fariborz Jahanian
0232c0569f
Define LLVM types for nonfragile abi metadata.
...
llvm-svn: 62830
2009-01-23 01:46:23 +00:00
Fariborz Jahanian
b15a3d5969
Use NonFragileABI as name of new Next abi. More comments
...
for the new meta-data.
llvm-svn: 62806
2009-01-22 23:02:58 +00:00
Fariborz Jahanian
eee54df5b6
More refactoring of common API to the common class for
...
the two Next's objc runtimes. More comments.
llvm-svn: 62735
2009-01-22 00:37:21 +00:00
Fariborz Jahanian
0b1ccdce88
Moved whole bunch of common APIs to the common class.
...
No change in functionality.
llvm-svn: 62729
2009-01-21 23:34:32 +00:00
Fariborz Jahanian
279eda6275
Refactoring ObjC Next's runtime classes in preparation for
...
the new ObjC's abi.
llvm-svn: 62721
2009-01-21 22:04:16 +00:00
Fariborz Jahanian
4b4c826999
Commented objective-c's metadata types. Minor clean up.
...
No change in functionality.
llvm-svn: 62646
2009-01-21 00:39:53 +00:00
Douglas Gregor
6e6ad602e5
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.
llvm-svn: 62562
2009-01-20 01:17:11 +00:00
Fariborz Jahanian
705c6d9cdd
Patch to re-implement ivar-list meta-data generation to fix
...
cases of unnamed ivar bitfields.
llvm-svn: 62429
2009-01-17 19:36:33 +00:00
Douglas Gregor
b3730b50c7
Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak
...
llvm-svn: 62122
2009-01-12 23:27:07 +00:00
Daniel Dunbar
62db95e891
(LLVM up) Match TargetData API change in LLVM TOT.
...
llvm-svn: 62101
2009-01-12 21:08:18 +00:00
Steve Naroff
ba3dc38840
Convert property implementation to DeclContext::addDecl().
...
This completes the ObjCContainerDecl AST cleanup (for now).
llvm-svn: 62037
2009-01-11 12:47:58 +00:00
Fariborz Jahanian
0196a1cd2b
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.
llvm-svn: 62030
2009-01-10 21:06:09 +00:00
Douglas Gregor
ffca3a21f1
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.
llvm-svn: 61994
2009-01-09 17:18:27 +00:00
Steve Naroff
b3a8798253
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.
llvm-svn: 61988
2009-01-09 15:36:25 +00:00
Fariborz Jahanian
475831bd6e
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.
llvm-svn: 61880
2009-01-07 20:11:22 +00:00
Fariborz Jahanian
1d35f12e6b
More encoding support. This time for
...
@encode of classes and bitfields.
llvm-svn: 61268
2008-12-19 23:34:38 +00:00
Fariborz Jahanian
b517e90662
Code gen. for ivar references; including bitfield
...
ivars.
llvm-svn: 61043
2008-12-15 20:35:07 +00:00
Douglas Gregor
91f84216f7
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).
llvm-svn: 60878
2008-12-11 16:49:14 +00:00
Anders Carlsson
a726c1763a
Append an extra newline to the module inline asm if it's not empty.
...
llvm-svn: 60827
2008-12-10 02:21:04 +00:00
Chris Lattner
f3d3faeca6
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.
llvm-svn: 59947
2008-11-24 05:29:24 +00:00
Chris Lattner
86d7d91366
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.
llvm-svn: 59936
2008-11-24 03:54:41 +00:00
Chris Lattner
e4b95698df
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.
llvm-svn: 59933
2008-11-24 03:33:13 +00:00
Fariborz Jahanian
e2caaaa13c
Fixed bugzilla bug# 3095 related to code gen. for @synchronized.
...
llvm-svn: 59838
2008-11-21 19:21:53 +00:00
Fariborz Jahanian
c2ad6dc3b4
Consolidated @try and @synchronize into a single
...
code gen. method.
llvm-svn: 59767
2008-11-21 00:49:24 +00:00
Fariborz Jahanian
e881b536e8
Introducing objc_assign_ivar to clang.
...
llvm-svn: 59740
2008-11-20 19:23:36 +00:00
Fariborz Jahanian
50a1270d87
Few more changes due to Daniel's feedback.
...
llvm-svn: 59645
2008-11-19 17:34:06 +00:00
Fariborz Jahanian
d7db964495
Generate strong write barriers for __strong objects.
...
Also, took care of Daniel's commments.
llvm-svn: 59575
2008-11-19 00:59:10 +00:00
Fariborz Jahanian
83f45b55f8
Patch for generation of weak write barriers for objc
...
__weak objects.
llvm-svn: 59560
2008-11-18 22:37:34 +00:00
Fariborz Jahanian
f5125d19e7
Generate objc_read_weak for __weak objc loads.
...
llvm-svn: 59553
2008-11-18 21:45:40 +00:00
Fariborz Jahanian
406b117eea
Some basic support toward objective-c's GC code gen.
...
llvm-svn: 59543
2008-11-18 20:18:11 +00:00
Douglas Gregor
77324f3854
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.
llvm-svn: 59441
2008-11-17 14:58:09 +00:00
Chris Lattner
e132e2432a
Start implementing support for @synchonized with the darwin ObjC API.
...
Patch by Fariborz!
llvm-svn: 59377
2008-11-15 21:26:17 +00:00
Daniel Dunbar
5c7e3935f1
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!
llvm-svn: 59089
2008-11-11 23:11:34 +00:00
Daniel Dunbar
c56e67644f
Add CodeGenFunction::EmitBranch.
...
- Emits an unconditional branch, with extra logic to avoid generating
spurious branches out of dummy blocks.
llvm-svn: 59037
2008-11-11 09:41:28 +00:00
Daniel Dunbar
29ac59f25c
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).
llvm-svn: 59022
2008-11-11 04:34:23 +00:00
Daniel Dunbar
75283ff38a
Centralize basic block creation in CodeGenFunction::createBasicBlock.
...
- No functionality change.
llvm-svn: 59017
2008-11-11 02:29:29 +00:00
Daniel Dunbar
cb4638599c
Move IRBuilder type definition to common file.
...
- No functionality change.
llvm-svn: 58546
2008-11-01 01:53:16 +00:00
Daniel Dunbar
c475d4224b
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.
llvm-svn: 58400
2008-10-29 22:36:39 +00:00
Daniel Dunbar
fc1066db81
Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.
...
llvm-svn: 57716
2008-10-17 20:21:44 +00:00
Daniel Dunbar
ff3c6747ef
More Obj-C type encoding improvements.
...
- Encode unions and bit-fields correctly.
- Accept option to name record fields (used for NeXT runtime).
llvm-svn: 57685
2008-10-17 16:17:37 +00:00