aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
AgeCommit message (Collapse)Author
2009-06-23Patch fixes an obscure bug when 'used' attribute is applied toFariborz Jahanian
variables in ObjC's Next runtime mode. Next runtime also implicitly applies 'used' attribute on some of its meta-data. This results in two 'llvm.used' arrays to be generated, and one of them is renamed to 'llvm.used1'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14Test modification.Fariborz Jahanian
Patch by Jean-Daniel Dupas git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13Don't include system headers when overriding triple.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13Force Obj-C runtime version for this testDaniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-10Support complex properties, ivars and message expressions.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05As an optimization, we maintain a cache of generatedMike Stump
___Block_byref_id_object_dispose and ___Block_byref_id_object_copy functions so that we can simply reuse instead of creating a new one. Additionally, add an assert to ensure no one yet tries to align a __block variable beyond the alignment of a pointer as the codegen is incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03Place the GC attribute on the same relative pointerFariborz Jahanian
position to make it consistant and to match gcc's behavior, by placing it at the inner-most pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-01A corner case of objc2 gc's write-barrier generationFariborz Jahanian
for the Next runtime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-01Fixed a test case which I am to blame for making itFariborz Jahanian
not runaable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-27No write-barrier for initializations.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-23Test for David Chisnall's -fobjc-sender-dependent-dispatch patch.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72330 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-23Initialize Obj-C GC attributes when emitting BlockDeclRefExprs.Daniel Dunbar
- Otherwise we may incorrectly miss generation of some write barriers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18Debug info: Initialize runtime language field correctly for Objective-CDaniel Dunbar
interface types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18Improve test case a wee bitDaniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15Classes with "+load" methods need to go in the non-lazy class list (orDaniel Dunbar
else the method will not be found by the runtime at class load time). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14Skip the asm prefix when storing the name in block info.Daniel Dunbar
- Otherwise we emit internal names with embedded '\01' characters, which confuses some tools. - Ideally all the code which wants to get a "display name" for the given function should follow one code path, but this should be a monotonic improvement for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14We need to specify the "linkage name" to the subprogram now that weDaniel Dunbar
emit the correct "display name". I suspect we need more work here, see FIXME for example. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13Make sure not to include the LLVM asm prefix in function names forDaniel Dunbar
debug info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12Patch to implement ivar synthesis of properties declared in protocolsFariborz Jahanian
only and used in class imllementations (objc2 Nonfragile ABI specific). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11Patch to allow Nonfragile ABI to use 32-bit style legacyFariborz Jahanian
message dispage API for all but a few messages. This is a runtime performance improvement and there is not meant to be a functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07Remove -fobjc-tight-layout, seems to work!Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05Fixes a bug for objc2's gc in the presense of type-casts.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04Provide basic support for generation of objc2's Fariborz Jahanian
objc_assign_global API when assigning to global objective-c object pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04Fix the field count in interface record layout (it was incorrectlyDaniel Dunbar
compensating for super classes). This was making the reported class sizes for empty classes very, very wrong. - Also, we now report the size info for an empty class like gcc (as the offset of the start, not as 0, 0). - Add a few more test cases we were mishandling before (padding bit field at end of struct, for example). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04Adding more test to ivar-layout-64.m.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04Compute interface instanceStart and instanceSize using the recordDaniel Dunbar
layout. - This is much simpler / more efficient. - This also properly computes the size in the presence of bit-fields. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04Don't allow clients to traverse into superclass synthesized propertiesDaniel Dunbar
via CollectObjCIvars. - In places where we need them, we should have the implementation and access the properties through it. This is a fairly substantial functionality change: 1. @encode no longer encodes synthesized ivars, ever. 2. The ivar layout bitmap no longer encodes information for synthesized ivars in superclasses. Well, actually I had already broken that, but it is intentional now. We are now differing substantially from llvm-gcc and gcc here. However, in my opinion this fundamentally *must* work if non-fragile classes are to work. Without this change, the result of @encode and the ivar layout depend on the order that the implementation is seen in a file (if it is in the same file with its superclass). Since both scenarios should work the same, our behavior is now consistent with gcc behavior as if an implementation is never seen following an implementation of its superclass. Note that #2 is only a functionality change when (A) an implementation appears in the same translation unit with the implementation of its superclass, and (B) the superclass has synthesized ivars. My belief is that this situation does not occur in practice. I am not yet sure of the role/semantics of @encode when synthesized ivars are present... it's use is fairly unsound in a non-fragile world. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03Use the implementation decl for looking up offset while building theDaniel Dunbar
ivar layout. - The layout needs access to synthesized ivars. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03Rename test caseDaniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30API for message dispatch of methods returning floatsFariborz Jahanian
to match gcc's closely. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30only support int128_t on 64-bit and larger targets. 32-bit targets don'tChris Lattner
have support for __divti3 and friends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30initial support for __[u]int128_t, which should be basicallyChris Lattner
compatible with VC++ and GCC. The codegen/mangling angle hasn't been fully ironed out yet. Note that we accept int128_t even in 32-bit mode, unlike gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29Export lazy references of .objc_class_name of class namesFariborz Jahanian
referenced in a category implementation meta-data (Next objc 32bit abi). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27rdar://6827200 - [sema] reject statically allocated arrays of interface typesChris Lattner
Upgrade "array of interface" warning to an error. In addition to being a terrible idea, this crashes codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25Fix pointer addressing and array subscripting of Objective-C interfaceDaniel Dunbar
types. - I broke this in the switch to representing interfaces with opaque types. - <rdar://problem/6822660> clang crashes on subscript of interface in 32-bit mode git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24Add a test case for a somewhat obscure scenario.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Add implicit definition of objc_msgSend.Daniel Dunbar
- As with malloc and friends, this is important where the return type on a 64-bit platform would otherwise end up discarding the upper 32-bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22Reapply r69771, with updates & fixes:Daniel Dunbar
Rework the shadow struct that is layed out for Objective-C classes. - Superclasses are now always laid out in their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields were incorrect (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal (for example, ivar are looked up recursively, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22Make sure this test runs on all 3 Objective-C implementations.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22Revert r69771, I missed some (obvious) details. :/Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22Rework the shadow struct that is layed out for Objective-C classes.Daniel Dunbar
- Superclasses are now always laid out their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields weren't packed correctly (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Revert 69646, that was the precise inverse of what I wanted to commit.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Kill ASTContext::[gs]etFieldForDecl, instead we just lookup thingsDaniel Dunbar
when we need them -- which is exactly what some code was already doing! - No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Fixup codegen for write barriers for block variables. Radar 6786715Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20Set a bit in IMAGE_INFO to indicate that we don't contain anyDaniel Dunbar
@synthesized ivars for superclasses. - <rdar://problem/6806371> [clang] Mark code without miscompiled @synthesized properties git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69581 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20Don't emit ivar offsets for unnamed bit fields.Daniel Dunbar
Also, added assertion that the field matches what would be looked up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19Fix rdar://6804402 - crash on objc implementations declared withChris Lattner
@class but no implementation. This was broken in all 3 runtime impls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19Fix bug in computation of ivar offsets for (adjacent) bitfields.Daniel Dunbar
- The confusing IRgen bitfield interface is partly to blame here; fixing the functional error for now, cleanups to the interface to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Test case would allow clang to fail.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Fix test to output LLVM to a temporary file, which we grep as part of the testDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69448 91177308-0d34-0410-b5e6-96231b3b80d8