aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
AgeCommit message (Collapse)Author
2011-12-06Fix an extremely stupid bug causing terrible miscompilationsJohn McCall
of &= on pseudo-objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29Make sure that forward declarations are marked as such in the debug infoEric Christopher
for the structure type. rdar://10499337 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145461 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-15The optimizers figured out how to make this store 6.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-14In ARC, don't reclaim objects of Class type.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144561 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10Add invariant.load metadata to loads from selector references. Allows these ↵Pete Cooper
loads to later be moved/combined in the optimizer. Fixes <rdar://problem/6027699> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144318 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10Whenever explicitly activating or deactivating a cleanup, weJohn McCall
need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10Fix a subtle bug with cleanups: when activatingJohn McCall
a previously-inactive cleanup, not only do we need a flag variable, but we should also force the cleanup to query the flag variable. However, we only need to do this when we're activating in a context that's conditionally executed; otherwise, we may safely assume that the cleanup is dominated by the activation point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10Enter the cleanups for a block outside the enclosingJohn McCall
full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09Emit the copy and dipose helpers for ARC __strongJohn McCall
block-typed __block variables using objc_retainBlock and objc_dispose. Previously we were using _Block_object_assign and _Block_object_destroy with BLOCK_BYREF_CALLER, which causes the runtime to completely ignore the retain and release. In most cases this doesn't cause catastrophe because the retain/release are balanced and because the block in the variable was copied upon assignment there. However, the stack copy of the variable will be released when it goes out of scope, which is a problem if that value was released due to an assignment to the heap copy. Similarly, a leak can occur if the variable is assigned after the copy to the heap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144162 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09Extract the blocks-related ARC tests into their own file.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144158 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08Bind function "r-values" as l-values when emitting them asJohn McCall
opaque values. Silly C type system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson
double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143350 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-28Fix test for LLVM change r143186.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27objc: fix an ir-gen crash caused by recent Fariborz Jahanian
property refactoring. // rdar://10327068 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143139 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-27Move these test from checking assembly to checking LLVM IR. Should fix falloutNick Lewycky
from r143097. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143098 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-26Objective-c: fix an ir-gen crash where objc messag returns a _ComplexFariborz Jahanian
value and ABI requires return slot to be passed as first argument to message sent. // rdar://10331109 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143053 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19Add block information for ObjC @catch blocks.Eric Christopher
Fixes rdar://10282889 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142467 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17Strip qualifiers off the type of an implicit property defined byJohn McCall
only a setter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06When constructing debug information for synthesized variables for theEric Christopher
non-fragile ABI we may not be able to lay out the type and the debugger would ignore us even if we did put in the offset. Go ahead and just put any value there and don't look up the offset since it may not exist. rdar://10210157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04Mark calls to objc_retainBlock that don't result from castsJohn McCall
to id so that we can still optimize them appropriately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141064 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall
increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01When performing an @throw in ARC, retain + autoreleaseJohn McCall
the pointer, being sure to do so before running cleanups associated with that full-expression. rdar://10042689 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01Parse attributes written in an ObjC method parameter type asJohn McCall
attributes on the parameter declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01Allow the results of cf_returns_not_retained functionJohn McCall
calls, or calls to audited functions without an explicit return attribute, to be casted without a bridge cast. Tie this mechanism in with the existing exceptions to the cast restrictions. State those restrictions more correctly and generalize. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30objc gc: assigning to an objc object struct member through an ivar Fariborz Jahanian
pointer to this struct must go through the none ivar writer barrier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23objc-gc: Fix a corner case where clang fails to generate GC Fariborz Jahanian
write barrier with captured pointer to object. // rdar://10150823 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140399 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19Throw the switch to convert clang to the new exception handling model!Bill Wendling
This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140049 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19Tighten check to match an ivar with corresponding property by using ↵Devang Patel
ObjCImplementationDecl. Radar 10139522 - Part 1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140038 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13Correctly generate IR for casted "builtin" functions, whereJohn McCall
the builtin is really just a predefined declaration. These are totally valid to cast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13Turn off the generation of unaligned atomic load/store; I'm going to ↵Eli Friedman
explicitly error out on such cases in the backend, at least for the moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139640 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13A strong property of block type has "copy" setter semantics, not "retain".John McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13Don't use native atomics on ivars whose size is not a power of two,John McCall
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13This test seems pretty low-value.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139589 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13Always emit bitfield properties using expression behavior, even if they'reJohn McCall
atomic. This is probably something we should warn about. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139584 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-13Unify the decision of how to emit property getters and setters into aJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139580 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10When converting a block pointer to an Objective-C pointer type, extendJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-08Allow C++0x enumerations with a fixed underlying type inDouglas Gregor
Objective-C. The @encode'ing of such an enumeration type is the same as its underlying type. <rdar://problem/5276348>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139297 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06objc-gc: Adds support for "weak" property attribute under GC.Fariborz Jahanian
// rdar://10073896 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Remove XFAIL/XTARGET since this is passing on the other bots.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138182 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Migrate, update and FileCheckize:Eric Christopher
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138180 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Migrate, update and FileCheckize:Eric Christopher
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138175 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Migrate, FileCheckize and update:Eric Christopher
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19Add new test.Devang Patel
Remove one outdated test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19objc-arc: @property definitions should default to (strong) when notFariborz Jahanian
specified. // rdar://9971982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138062 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-05The continue label in an ARC for-in loop should not involveJohn McCall
releasing the collection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136949 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04This test still hangs on win32, despite XFAIL it. Remove XFAIL.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04XFAIL arc.m codegen test on win32 because it is currently hanging. Need to ↵Ted Kremenek
investigate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136850 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Use the general conditional-cleanup framework instead of rolling ourJohn McCall
own, incorrectly, for releasing objects at the end of a full-expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136823 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03In ARC, don't try to reclaim the result of a call to performSelectorJohn McCall
unless done in a context where the value is used retained. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136769 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-28Fix a couple of problems with initialization and assignment toJohn McCall
__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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136337 91177308-0d34-0410-b5e6-96231b3b80d8