aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenObjC
AgeCommit message (Collapse)Author
2013-02-13objective-C: Make order of ivars which are synthesizedFariborz Jahanian
in the course of property synthesis deterministic (ordered by their type size), instead of having hashtable order (as it is currently). // rdar://13192366 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175100 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12Properly assemble PHIs after a null-checked invoke of objc_msgSend.John McCall
rdar://12046763 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12In ARC, emit non-peepholed +1s within the full-expression insteadJohn McCall
of immediately afterwards. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174922 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12Split a couple of tests out into their own file.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05Changed CGObjCMac.cpp to add the marker externally_initialized to ↵Michael Gottesman
SELECTOR_REFERENCES in both the fragile and non-fragile API. This is to ensure that GlobalOpt in LLVM does not attempt to look through a selector reference to a method var name at compile time. I also added a test/updated old tests that need to recognize the new keyword. rdar://12580965. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174461 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02On platforms which do not support ARC natively, do not mark ↵Michael Gottesman
objc_retain/objc_release as "nonlazybind". rdar://13108298. rdar://13129783. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174253 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02Generalize DebugInfo tests by avoiding explicit metadata numbersDavid Blaikie
This addresses several (not all) debug info tests that use explicit metadata numbers. Wherever the same number appeared more than once in a test I used a named match to ensure the same number appeared in all those cases (this may still be overly constraining test cases as they may not have actually cared about that relationship). For one-off numbers I just replaced them with an unnamed regex. This may underconstrain poorly written test cases that were interested in checking that certain metadata nodes were related but didn't actually match on all the related nodes numbers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174247 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28Tests: remove disabled llvm-gcc invocationsDmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26PR14566: Debug Info: avoid top level lexical blocks in functionsDavid Blaikie
One of the gotchas (see changes to CodeGenFunction) was due to the fix in r139416 (for PR10829). This only worked previously because the top level lexical block would set the location to the end of the function, the debug location would be updated (as per r139416), the location would be set to the end of the function again (but that would no-op, since it was the same as the previous location), then the return instruction would be emitted using the debug location. Once the top level lexical block was no longer emitted, the end-of-function location change was causing the debug loc to be updated, regressing that bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17objC block layout: Patch reorders block layout to Fariborz Jahanian
produce more inline layout metadata. // rdar://12752901 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172683 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11Enable the new (more C++-like, less broken) EH model when targeting the GNUstepDavid Chisnall
Objective-C runtime 1.7 or greater. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172207 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05In my last patch initialize the destination to null (with a simple store) ↵Fariborz Jahanian
before doing a storeStrong to it. // rdar://12530881 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171572 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05Fix testing case for Release build (r171493)Manman Ren
rdar://11562117 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171564 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04objective-C arc: in copy helper function for Fariborz Jahanian
__strong __block variables, perform objc_storeStrong on source and destination instead of direct move. This is done with -O0 and to improve some analysis. // rdar://12530881 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04Debug Info: fix the line location for cleanup code of a block functionManman Ren
The line information was changed when emitting debug information for all the DeclRefExprs and we should change it back to get ready for PopClenupBlocks called from FinishFunction. rdar://11562117 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171493 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28Change this to an IR test instead of an assembly test (as per comment in ↵David Blaikie
r171134). This makes the test not dependent on LLVM & won't vary/break based on LLVM codegen related changes. Appropriately testing at the Clang level what was fixed at the Clang level originally (in r124210). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171175 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27Update test for backend change.Eric Christopher
TODO: This test should be moved to the backend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171134 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20Robustify the @encode code and add support for _Atomic.John McCall
Fixes PR14628. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170639 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-17Reapply r170344, this time without forgetting to commit the header changes.David Chisnall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170354 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-17Revert "Added support for new property helpers (GNUstep runtime)."Benjamin Kramer
This reverts commit r170344. Doesn't even compile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170351 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-17Added support for new property helpers (GNUstep runtime).David Chisnall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170344 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12Marking the objc_autoreleaseReturnValue and objc_retainAutoreleaseReturnValue Chad Rosier
call sites as tail calls unconditionally. While it's theoretically true that this is just an optimization, it's an optimization that we very much want to happen even at -O0, or else ARC applications become substantially harder to debug. See r169796 for the llvm/fast-isel side of things. rdar://12553082 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11objective-C blocks: Check for record type when deciding if Fariborz Jahanian
byref variable requires extended layout info. to prevent a crash involving arrays declared __block. // rdar://12787751 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07Fix the required args count for variadic blocks.John McCall
We were emitting calls to blocks as if all arguments were required --- i.e. with signature (A,B,C,D,...) rather than (A,B,...). This patch fixes that and accounts for the implicit block-context argument as a required argument. In addition, this patch changes the function type under which we call unprototyped functions on platforms like x86-64 that guarantee compatibility of variadic functions with unprototyped function types; previously we would always call such functions under the LLVM type T (...)*, but now we will call them under the type T (A,B,C,D,...)*. This last change should have no material effect except for making the type conventions more explicit; it was a side-effect of the most convenient implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169588 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07clang/test: Remove "REQUIRES:LP64" in two tests. Each of them have explicit ↵NAKAMURA Takumi
triple. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169587 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06Rework the bitfield access IR generation to address PR13619 andChandler Carruth
generally support the C++11 memory model requirements for bitfield accesses by relying more heavily on LLVM's memory model. The primary change this introduces is to move from a manually aligned and strided access pattern across the bits of the bitfield to a much simpler lump access of all bits in the bitfield followed by math to extract the bits relevant for the particular field. This simplifies the code significantly, but relies on LLVM to intelligently lowering these integers. I have tested LLVM's lowering both synthetically and in benchmarks. The lowering appears to be functional, and there are no really significant performance regressions. Different code patterns accessing bitfields will vary in how this impacts them. The only real regressions I'm seeing are a few patterns where the LLVM code generation for loads that feed directly into a mask operation don't take advantage of the x86 ability to do a smaller load and a cheap zero-extension. This doesn't regress any benchmark in the nightly test suite on my box past the noise threshold, but my box is quite noisy. I'll be watching the LNT numbers, and will look into further improvements to the LLVM lowering as needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169489 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04objective-c blocks: Consider padding due to alignmentFariborz Jahanian
after the fixed size block header when generating captured block variable info. // rdar://12773256 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28objective-C blocks: Make sure that identical logic is usedFariborz Jahanian
in deciding a copy/dispose field is needed in a byref structure and when generating the copy/dispose helpers. In certain cases, these fields were being added but no copy/dispose was being generated. This was uncovered in ARC, but not in MRR. // rdar://12759433 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27objective-C arc: load of a __weak object happens via call toFariborz Jahanian
objc_loadWeak. This retains and autorelease the weakly-refereced object. This hidden autorelease sometimes makes __weak variable alive even after the weak reference is erased, because the object is still referenced by an autorelease pool. This patch overcomes this behavior by loading a weak object via call to objc_loadWeakRetained(), followng it by objc_release at appropriate place, thereby removing the hidden autorelease. // rdar://10849570 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168740 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15block extended signatur option. Change previous optionFariborz Jahanian
to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15objective-C blocks: make cc1 flag -encode-extended-block-signatureFariborz Jahanian
the default. // rdar://12109031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14objective-C blocks: under cc1 flag -encode-extended-block-signature,Fariborz Jahanian
generate expanded signature encoding to include types as we already do this for protocol method lists. // rdar://12109031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167997 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14objective-C blocks: Provide layout map for byrefFariborz Jahanian
variables captured in a block. // rdar://12184410 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-10objective-C blocks: Change BLOCK_HAS_EXTENDED_LAYOUT to be 1<<31.Fariborz Jahanian
lower 24bit is currently being used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-07Fix the Objective-C exception rethrow from cleanups (GNU runtimes). Note thatDavid Chisnall
a bug in the inliner still causes the wrong thing to happen at -O2 and above (PR14116). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167534 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Put something sane in the DWARF offset field for bitfield ObjC ivars.Eli Friedman
This is useful because unnamed bitfields can have effects on the offsets which are not otherwise reflected in the DWARF information. <rdar://problem/12629719> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167503 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Fix a silly mistake in r167437.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167487 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06Minor fix to ObjC layout bitmap metadata. Found while I was trying toEli Friedman
refactor the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167436 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05Tests for 32bit version of block ivar layout metadata.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167387 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-04Fixes liftime of captured block variables in mrr mode, per John's feedback, asFariborz Jahanian
well as couple of tests which were not being excercised because of TYPOs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167374 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-03Simplify these tests again, now that we're past the version skew.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167346 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02Avoid version skew by making ObjC strict metadata tests resilient to new field.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02objective-C mrr block. Block variable layout metadata inFariborz Jahanian
mrr mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01Update the front end to use minsize attributeQuentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167266 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01objective-C block meta-data. This patch completes meta-dataFariborz Jahanian
generation for captured block variables in arc mode. This includes inlined version of the meta-data when it can be done. It also includes severat tests. This is wip. // rdar://12184410. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167241 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Don't crash synthesizing an ObjC property with an empty struct type. ↵Eli Friedman
<rdar://problem/12547611>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Correct test inovocations to use %clang_cc1 rather than direct invocation ↵David Tweed
(so that it can have additional options set when trying to debug issues causing regressions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166681 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24A number of test cases assume that an "int" parameter or return valueUlrich Weigand
will be represented in the IR as a plain "i32" type. This causes the tests to spuriously fail on platforms where int is not a 32-bit type, or where the ABI requires attributes like "signext" or "zeroext" to be used. This patch adds -triple or -target parameters to force those tests to use the i386-unknown-unknown target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Revert r166541, "clang/test: Add appropriate requirements as REQUIRES, ↵NAKAMURA Takumi
corresponding to r166532." According to r166543, it is not needed for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24clang/test: Add appropriate requirements as REQUIRES, corresponding to r166532.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166541 91177308-0d34-0410-b5e6-96231b3b80d8