summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* update for api change.Chris Lattner2011-06-181-67/+29
| | | | llvm-svn: 133365
* Automatic Reference Counting.John McCall2011-06-151-37/+92
| | | | | | | | | | 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
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-4/+4
| | | | llvm-svn: 132878
* Objective-C doesn't consider the use of incomplete types as methodDouglas Gregor2011-05-271-2/+23
| | | | | | | | | | | | | | parameter types to be ill-formed. However, it relies on the completeness of method parameter types when producing metadata, e.g., for a protocol, leading IR generating to crash in such cases. Since there's no real way to tighten down the semantics of Objective-C here without breaking existing code, do something safe but lame: suppress the generation of metadata when this happens. Fixes <rdar://problem/9123036>. llvm-svn: 132171
* Patch to fix IR-gen crash generating structure ABI which implementsFariborz Jahanian2011-05-171-2/+9
| | | | | | | user specified string class via -fconstant-string-class option. pr9914. llvm-svn: 131496
* Use arrays and SmallVectors instead of std::vectors when building functionJohn McCall2011-05-151-150/+111
| | | | | | | types. Also, cache a translation of 'void' in CGM and provide a ptrdiff_t alias. No functionality change. llvm-svn: 131373
* Only perform the null-initialization of an aggregate result of a messageJohn McCall2011-05-141-16/+50
| | | | | | | | | send if the receiver is null. Normally it's not worthwhile to check this, but avoiding the null-initialization is nice, and this also avoids nasty problems where the null-initialization is visible within the call because we use an aliased result buffer. rdar://problem/9402992 llvm-svn: 131366
* Objective-C vtables are not taking the world by storm; call themJohn McCall2011-05-141-121/+139
| | | | | | | | | out as "v-table" message sends and stop calling normal messages "legacy" message sends. Also, fix some comments to reveal the true state of affairs. llvm-svn: 131335
* Reorganize this method to avoid multiple calls for computing CGFunctionInfoJohn McCall2011-05-131-77/+109
| | | | | | and to decrease the amount of effort in appending strings. llvm-svn: 131323
* type of last arg of objc_assign_ivar is ptrdiff_t. Fariborz Jahanian2011-05-051-1/+5
| | | | | | // rdar://9362887 llvm-svn: 130956
* Pack ivar offsets together.Bill Wendling2011-05-041-1/+1
| | | | | | | | | | Ivar offsets for synthesized ivars are wrong, which could end up with a large number of dirty pages because of ivar fixups at runtime. When we pack all of the synthesized ivars into the same section, it limits the number of dirty pages created. Place them in the "__DATA,__objc_ivar" section. <rdar://problem/9374905> llvm-svn: 130870
* Simplify code a bit by using CallArgList::add. No intended functionality ↵Eli Friedman2011-05-021-6/+4
| | | | | | change. llvm-svn: 130699
* Fixes an instance method meta-data generation bug inFariborz Jahanian2011-04-221-0/+8
| | | | | | | | | | | ObjC NeXt runtime where method pointer registered in metadata belongs to an unrelated method. Ast part of this fix, I turned at @end missing warning (for class implementations) into an error as we can never be sure that meta-data being generated is correct. // rdar://9072317 llvm-svn: 130019
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Replace a couple of divisions-by-'8' with divisions-by-charwidth. No changeKen Dyck2011-04-141-2/+2
| | | | | | in functionality intended. llvm-svn: 129491
* Obj-C/NeXT: Update and reapply 108847, now that changes are more baked.Daniel Dunbar2011-03-251-5/+15
| | | | llvm-svn: 128300
* Refactor CGObjCMac to use the shared code for EH stuff.David Chisnall2011-03-251-154/+7
| | | | | | Sanity checked by John McCall. llvm-svn: 128287
* Continuing work on ObjC tidyup:David Chisnall2011-03-251-109/+0
| | | | | | | | | | | | | | | | - Moved the CGObjCRuntime functions out of CGObjCMac.cpp into CGObjCRuntime.cpp - Added generic functions in CGObjCRuntime for emitting @try and @synchronize blocks, usable by any runtime that uses DWARF exceptions. - Made the GNU runtimes use these functions. It should now be possible to replace the equivalent functions in CGObjCNonFragileABIMac with simple calls to these two functions, providing the runtime functions as arguments. I'll post a diff to the list for review before making any changes to the Mac runtime stuff. llvm-svn: 128274
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Simplify Mac runtime selection - it's the factory function's job to select ↵David Chisnall2011-03-221-5/+2
| | | | | | which class to produce, not CodeGenModule's. llvm-svn: 128109
* Make the property accessor functions that take a ptrdiff_t actually take a ↵David Chisnall2011-03-221-2/+2
| | | | | | ptrdiff_t instead of a long (should have no impact on any sane platforms, but win64 is not sane). llvm-svn: 128104
* Fixed InnerLocStart.Abramo Bagnara2011-03-091-2/+2
| | | | llvm-svn: 127330
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-4/+4
| | | | llvm-svn: 127225
* Access ivars with inbounds GEPs, even in -fwrapv. It's unlikely thatJohn McCall2011-03-041-1/+1
| | | | | | | this can have any optimization effect, given the opacity of objects pointers, but you never know. llvm-svn: 126990
* Let's do super message sends with static allocas instead of dynamic ones.John McCall2011-03-041-2/+2
| | | | llvm-svn: 126989
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-03-011-5/+8
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126754
* Revert r126678.Fariborz Jahanian2011-02-281-13/+13
| | | | llvm-svn: 126685
* objc IRGen for Next runtime message API.Fariborz Jahanian2011-02-281-13/+13
| | | | | | | | | | The prototype for objc_msgSend() is technically variadic - `id objc_msgSend(id, SEL, ...)`. But all method calls should use a prototype that matches the method, not the prototype for objc_msgSend itself(). // rdar://9048030 llvm-svn: 126678
* Don't assume that whoever is asking for a message send is goingJohn McCall2011-02-261-2/+11
| | | | | | to give us a non-null return slot. llvm-svn: 126544
* Zero-initialize the struct-return slot of an Objective-C messageJohn McCall2011-02-261-0/+2
| | | | | | send before making the call. Fixes rdar://problem/7854674 llvm-svn: 126543
* Convert RecordLayout::DataSize to CharUnits from bits, eliminating twoKen Dyck2011-02-111-1/+1
| | | | | | | unnecessary calls to RoundUpToAlignment. No changes to functionality intended. llvm-svn: 125356
* Add a helper function, ASTContext::toBits(), that converts sizes inKen Dyck2011-02-111-2/+1
| | | | | | | CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
* Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck2011-02-091-2/+3
| | | | | | functionality intended. llvm-svn: 125156
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-0/+1
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-39/+53
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Move all the cleanups framework code into a single file.John McCall2011-01-281-1/+1
| | | | | | Pure motion. llvm-svn: 124484
* Consider zero-length array of structs whenFariborz Jahanian2011-01-031-1/+1
| | | | | | | computing ivar layouts for objc-gc. Fixes // rdar://8800513 llvm-svn: 122762
* Add support for GNU runtime property set / get structure functions. Minor ↵David Chisnall2010-12-261-3/+10
| | | | | | refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point). llvm-svn: 122569
* Some fixes for synthesized ivar metadata (GNU runtime).David Chisnall2010-11-031-0/+1
| | | | llvm-svn: 118172
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-5/+5
| | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. llvm-svn: 117147
* This patch implements Next's IRGen for -fconstant-string-class=class-name.Fariborz Jahanian2010-10-191-1/+1
| | | | | | PR6056, //rdar: //8564463 llvm-svn: 116819
* Coding by inspection has its problems.John McCall2010-10-161-0/+2
| | | | llvm-svn: 116672
* objc_exception_rethrow does not take an exception argument.John McCall2010-10-161-23/+9
| | | | | | rdar://problem/8535238 llvm-svn: 116663
* Revert r116656, "IRgen/Obj-C/NeXT: Fix the IR signature forDaniel Dunbar2010-10-161-1/+1
| | | | | | | | objc_exception_rethrow, so we don't...", since something is actually trying to call this with the wrong signature (!). Unfortunately I don't understand the new EH infrastructure well enough to fix it immediately. llvm-svn: 116660
* IRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don'tDaniel Dunbar2010-10-161-1/+1
| | | | | | generate unnecessary %al clear on x86_64. llvm-svn: 116656
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-3/+3
| | | | | | ambiguous context. llvm-svn: 116567
* In the fragile ObjC ABI, save the caught exception to the side if there areJohn McCall2010-10-041-6/+33
| | | | | | | both @catches and a @finally, because the second call to @objc_exception_try_enter will clobber the exception slot. Fixes rdar://problem/8440970. llvm-svn: 115575
* Block description for trivial block literals haveFariborz Jahanian2010-09-131-2/+1
| | | | | | their 'isa' field scanned regardless. llvm-svn: 113749
* Fixes an obscure bug in importd block variable layoutFariborz Jahanian2010-09-111-5/+8
| | | | | | | | information when imported variable is used more than once. Originally though to be a bug in importing block varibles. Fixes radar 8417746. llvm-svn: 113675
* Block ivar layout must assume that the 'isa'Fariborz Jahanian2010-09-091-0/+3
| | | | | | | | field of the block descriptor is GC'able (scanned) as this what the runtime expects (one can send it messages). Radar 8394947. llvm-svn: 113454
OpenPOWER on IntegriCloud