summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
Commit message (Collapse)AuthorAgeFilesLines
* Correctly generate IR for casted "builtin" functions, whereJohn McCall2011-09-131-0/+7
| | | | | | | the builtin is really just a predefined declaration. These are totally valid to cast. llvm-svn: 139657
* Turn off the generation of unaligned atomic load/store; I'm going to ↵Eli Friedman2011-09-131-2/+4
| | | | | | explicitly error out on such cases in the backend, at least for the moment. llvm-svn: 139640
* A strong property of block type has "copy" setter semantics, not "retain".John McCall2011-09-131-0/+20
| | | | | | | | | This is consistent with the behavior of assigning into a __strong l-value, and it's also necessary for ensuring that the ivar doesn't end up a dangling reference. We decided not to change the behavior of "retain" properties, but just to make them warnings/errors when of block type. llvm-svn: 139619
* Don't use native atomics on ivars whose size is not a power of two,John McCall2011-09-131-0/+29
| | | | | | | | even on architectures that support unaligned access (which is the only way this is otherwise legal, given that ivars apparently do not honor alignment attributes). llvm-svn: 139590
* This test seems pretty low-value.John McCall2011-09-131-50/+0
| | | | llvm-svn: 139589
* Always emit bitfield properties using expression behavior, even if they'reJohn McCall2011-09-131-0/+9
| | | | | | atomic. This is probably something we should warn about. llvm-svn: 139584
* Unify the decision of how to emit property getters and setters into aJohn McCall2011-09-131-4/+17
| | | | | | | | single code path. Use atomic loads and stores where necessary. Load and store anything of the appropriate size and alignment with primitive operations instead of going through the call. llvm-svn: 139580
* When converting a block pointer to an Objective-C pointer type, extendJohn McCall2011-09-101-0/+37
| | | | | | | | | | | the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
* Allow C++0x enumerations with a fixed underlying type inDouglas Gregor2011-09-081-1/+6
| | | | | | | Objective-C. The @encode'ing of such an enumeration type is the same as its underlying type. <rdar://problem/5276348>. llvm-svn: 139297
* objc-gc: Adds support for "weak" property attribute under GC.Fariborz Jahanian2011-09-061-0/+28
| | | | | | // rdar://10073896 llvm-svn: 139203
* Remove XFAIL/XTARGET since this is passing on the other bots.Eric Christopher2011-08-201-2/+0
| | | | llvm-svn: 138182
* Migrate, update and FileCheckize:Eric Christopher2011-08-204-0/+90
| | | | | | | | | | | 2010-02-01-utf16-with-null.m 2010-02-23-DbgInheritance.m 2010-03-17-StructRef.m 2011-03-08-IVarLookup.m from llvm/test/FrontendObjC. llvm-svn: 138180
* Migrate, update and FileCheckize:Eric Christopher2011-08-204-0/+51
| | | | | | | | | | | 2008-11-25-Blocks.m 2009-01-26-WriteBarrier-2.m 2009-02-05-VolatileProp.m 2009-08-05-utf16.m from llvm/test/FrontendObjC. llvm-svn: 138175
* Migrate, FileCheckize and update:Eric Christopher2011-08-207-0/+154
| | | | | | | | | | | | | | 2007-04-03-ObjcEH.m 2007-05-02-Strong.m 2007-10-18-ProDescriptor.m 2007-10-23-GC-WriteBarrier.m 2008-10-3-EhValue.m 2008-11-12-Metadata.m 2008-11-24-ConstCFStrings.m from llvm/test/FrontendObjC. llvm-svn: 138172
* Add new test.Devang Patel2011-08-191-15/+0
| | | | | | Remove one outdated test. llvm-svn: 138144
* objc-arc: @property definitions should default to (strong) when notFariborz Jahanian2011-08-191-0/+16
| | | | | | specified. // rdar://9971982 llvm-svn: 138062
* The continue label in an ARC for-in loop should not involveJohn McCall2011-08-051-0/+21
| | | | | | releasing the collection. llvm-svn: 136949
* This test still hangs on win32, despite XFAIL it. Remove XFAIL.Ted Kremenek2011-08-041-1/+0
| | | | llvm-svn: 136864
* XFAIL arc.m codegen test on win32 because it is currently hanging. Need to ↵Ted Kremenek2011-08-041-0/+1
| | | | | | investigate. llvm-svn: 136850
* Use the general conditional-cleanup framework instead of rolling ourJohn McCall2011-08-031-3/+52
| | | | | | own, incorrectly, for releasing objects at the end of a full-expression. llvm-svn: 136823
* In ARC, don't try to reclaim the result of a call to performSelectorJohn McCall2011-08-031-0/+36
| | | | | | unless done in a context where the value is used retained. llvm-svn: 136769
* Fix a couple of problems with initialization and assignment toJohn McCall2011-07-281-0/+70
| | | | | | | | | | | __block variables where the act of initialization/assignment itself causes the __block variable to be copied to the heap because the variable is of block type and is being assigned a block literal which captures the variable. rdar://problem/9814099 llvm-svn: 136337
* The lock operand to an @synchronized statement is also John McCall2011-07-271-0/+18
| | | | | | | supposed to be a full-expression; make it so. In ARC, make sure we retain the lock for the entire protected block. llvm-svn: 136271
* Clean up the analysis of the collection operand to ObjCJohn McCall2011-07-271-3/+81
| | | | | | | | | | | for-in statements; specifically, make sure to close over any temporaries or cleanups it might require. In ARC, this has implications for the lifetime of the collection, so emit it with a retain and release it upon exit from the loop. rdar://problem/9817306 llvm-svn: 136204
* Document the existing objc_precise_lifetime attribute.John McCall2011-07-221-0/+50
| | | | | | | | | Introduce and document a new objc_returns_inner_pointer attribute, and consume it by performing a retain+autorelease on message receivers when they're not immediately loaded from an object with precise lifetime. llvm-svn: 135764
* In ARC, non-atomic getters do not need to retain and autoreleaseJohn McCall2011-07-221-0/+38
| | | | | | | their loaded values, although it still worth doing this for __weak properties to get the autoreleased-return-value optimization. llvm-svn: 135747
* In Objective-C, pull arbitrary attributes from overriddenJohn McCall2011-07-221-0/+26
| | | | | | | | | | | | | | | methods, including indirectly overridden methods like those declared in protocols and categories. There are mismatches that we would like to diagnose but aren't yet, but this is fine for now. I looked at approaches that avoided doing this lookup unless we needed it, but the infer-related-result-type checks were doing it anyway, so I left it with the same fast-path check for no previous declartions of that selector. llvm-svn: 135743
* Removes a comment.Fariborz Jahanian2011-07-201-1/+0
| | | | llvm-svn: 135640
* objc-arc: Fixes a crash @throw'ing an objc message.Fariborz Jahanian2011-07-201-0/+16
| | | | | | // pr10411 llvm-svn: 135638
* Don't crash if defining -dealloc in a category.John McCall2011-07-131-0/+10
| | | | llvm-svn: 135054
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-131-2/+4
| | | | | | them, too. llvm-svn: 135038
* In ARC mode, consider Objective-C lifetime types (object pointers andDouglas Gregor2011-07-121-0/+14
| | | | | | | | | | | | | | block pointers) that don't have any qualification to be POD types. We were previously considering them to be non-POD types, because this was convenient in C++ for is_pod-like traits. However, we now end up inferring lifetime in such cases (template arguments infer __strong), so it is not necessary. Moreover, we want rvalues of object type (which have their lifetime stripped) to be PODs to allow, e.g., va_arg(arglist, id) to function properly. Fixes <rdar://problem/9758798>. llvm-svn: 134993
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-121-5/+4
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* keep track of whether being in a RS_StructPointer stateChris Lattner2011-07-102-6/+6
| | | | | | | | | | caused us to skip layout out a function accurately. If so, flush the type cache for both the function and struct case to ensure that any pointers to the functions get recomputed. This is overconservative, but with this patch clang can build itself again. llvm-svn: 134863
* Fix the clang bootstrap and Jay's testcase from llvm-dev by being completelyChris Lattner2011-07-102-7/+7
| | | | | | | | | | conservative when converting a functiontype to IR when in a "pointer within a struct" context. This has the unfortunate sideeffect of compiling all function pointers inside of structs into "{}*" which, though correct, is ugly. This has the positive side effect of being correct, and it is pretty straight-forward to improve on this. llvm-svn: 134861
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-095-22/+22
| | | | llvm-svn: 134831
* A number of array-related IR-gen cleanups.John McCall2011-07-091-22/+16
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* In ARC, reclaim all return values of retainable type, not just thoseJohn McCall2011-07-071-15/+36
| | | | | | | | | | | | where we have an immediate need of a retained value. As an exception, don't do this when the call is made as the immediate operand of a __bridge retain. This is more in the way of a workaround than an actual guarantee, so it's acceptable to be brittle here. rdar://problem/9504800 llvm-svn: 134605
* Call objc_terminate() instead of abort() when a cleanup throws anJohn McCall2011-07-061-0/+29
| | | | | | | exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. llvm-svn: 134456
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-068-10/+10
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* objc-arc: fix a IRGen crash when checking forFariborz Jahanian2011-06-291-0/+29
| | | | | | | accessibility of an initializer which is a compound statement. // rdar://9694706 llvm-svn: 134091
* Test case for r133840, neglectfully uncommitted.John McCall2011-06-241-0/+14
| | | | llvm-svn: 133841
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-241-17/+20
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* Emit @finally blocks completely lazily instead of forcing theirJohn McCall2011-06-221-1/+15
| | | | | | | | | | | | | existence by always threading an edge from the catchall. Not doing this was previously causing a crash in the very extreme case where neither the normal cleanup nor the EH catchall was actually reachable: we would delete the catchall entry block, which would cause us to delete the entry block of the finally cleanup as well because the cleanup logic would merge the blocks, which in turn triggered an assert because later blocks in the finally would still be using values from the entry. Laziness turns out to be the most elegant solution to the problem. llvm-svn: 133601
* objc-arc: Add support for unbridged cast of Fariborz Jahanian2011-06-211-0/+10
| | | | | | | | __builtin___CFStringMakeConstantString and CF typed function calls with explicit cf_returns_retained/cf_returns_not_retained attributes. // rdar://9544832 llvm-svn: 133535
* objc-arc: CodeGen part of unbridged cast of CF types.Fariborz Jahanian2011-06-211-0/+27
| | | | | | // rdar://9474349 llvm-svn: 133525
* Objective-C fast enumeration loop variables are not retained in ARC, butJohn McCall2011-06-171-18/+63
| | | | | | | | | | | | they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. llvm-svn: 133243
* For the purpose of @encode'ing, accept 'void' typeFariborz Jahanian2011-06-161-0/+4
| | | | | | | (even though it is incomplete type) because gcc says so. // rdar://9622422 llvm-svn: 133208
* Automatic Reference Counting.John McCall2011-06-1515-4/+2039
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Remote this unreliable test case because it did not do its job.Devang Patel2011-06-131-20/+0
| | | | llvm-svn: 132948
OpenPOWER on IntegriCloud