summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Update for llvm change.Rafael Espindola2015-11-181-1/+1
| | | | llvm-svn: 253440
* Watch and TV OS: wire up basic ABI choicesTim Northover2015-10-301-2/+4
| | | | | | | This sets the mostly expected Darwin default ABI options for these two platforms. Active changes from these defaults for watchOS are in a later patch. llvm-svn: 251708
* Initialize @catch variables correctly in fragile-runtime ARC.John McCall2015-10-301-2/+2
| | | | llvm-svn: 251677
* Fix the emission of ARC ivar layouts in the non-fragile Mac runtime.John McCall2015-10-291-6/+11
| | | | | | | My previous change in this area accidentally broke the rule when InstanceBegin was not a multiple of the word size. llvm-svn: 251666
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-221-18/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* Enable ARC on the fragile runtime.John McCall2015-10-211-2/+7
| | | | | | | | | | | | | | | | This is almost entirely a matter of just flipping a switch. 99% of the runtime support is available all the way back to when it was implemented in the non-fragile runtime, i.e. in Lion. However, fragile runtimes do not recognize ARC-style ivar layout strings, which means that accessing __strong or __weak ivars reflectively (e.g. via object_setIvar) will end up accessing the ivar as if it were __unsafe_unretained. Therefore, when using reflective technologies like KVC, be sure that your paths always refer to a property. rdar://23209307 llvm-svn: 250955
* Fix and stylize the emission of GC/ARC ivar and GC block layout strings.John McCall2015-10-211-397/+405
| | | | | | | | | | | | | | | Specifically, handle under-aligned object references (by explicitly ignoring them, because this just isn't representable in the format; yes, this means that GC silently ignores such references), descend into anonymous structs and unions, stop classifying fields of pointer-to-strong/weak type as strong/weak in ARC mode, and emit skips to cover the entirety of block layouts in GC mode. As a cleanup, extract this code into a helper class, avoid a number of unnecessary copies and layout queries, generate skips implicitly instead of explicitly tracking them, and clarify the bitmap-creation logic. llvm-svn: 250919
* [CodeGen] Remove dead code. NFC.Benjamin Kramer2015-10-151-3/+0
| | | | llvm-svn: 250418
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-2/+1
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* Don't nil check non-nil class receiver of AArch64 stret calls.Ahmed Bougacha2015-10-021-1/+1
| | | | | | | | | | | I randomly came across this difference between AArch64 and other targets: on the latter, we don't emit nil checks for known non-nil class method calls thanks to r247350, but we still do for AArch64 stret calls. They use different code paths, because those are special, as they go through the regular msgSend, not the msgSend*_stret variants. llvm-svn: 249205
* Support noreturn in limited contexts on Objective-C message sends.John McCall2015-09-101-11/+60
| | | | | | rdar://6198039 llvm-svn: 247350
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-081-175/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* Devirtualize EHScopeStack::Cleanup's dtor because it's never destroyed ↵David Blaikie2015-08-181-1/+1
| | | | | | polymorphically llvm-svn: 245378
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Remove empty non-virtual destructors or mark them =default when non-publicBenjamin Kramer2015-04-111-3/+0
| | | | | | These add no value but can make a class non-trivially copyable. NFC. llvm-svn: 234689
* [opaque pointer type] More GEP API migrationsDavid Blaikie2015-04-051-15/+18
| | | | | | | Looks like the VTable code in particular will need some work to pass around the pointee type explicitly. llvm-svn: 234128
* [opaque pointer type] Explicitly specify type to CreateGEPDavid Blaikie2015-04-031-2/+2
| | | | llvm-svn: 234032
* [opaque pointer type] Update for GEP API changes in LLVMDavid Blaikie2015-04-021-7/+6
| | | | | | | | | | Now the GEP constant utility functions require the type to be explicitly passed (since eventually the pointer type will be opaque and not convey the required type information). For now callers can still pass nullptr (though none were needed here in Clang, which is nice) if convenienc/necessary, but eventually that will be disallowed as well. llvm-svn: 233937
* [Objective-C metadata patch]. Patch to allocate one more space for Fariborz Jahanian2015-03-311-1/+7
| | | | | | Protocol objects in OBJC2. rdar://20286356 llvm-svn: 233766
* Wrap to 80 columns. No behavior change.Nico Weber2015-02-261-3/+4
| | | | llvm-svn: 230682
* Implement the __builtin_call_with_static_chain GNU extension.Peter Collingbourne2014-12-121-20/+16
| | | | | | | | | | | | | | | | The extension has the following syntax: __builtin_call_with_static_chain(Call, Chain) where Call must be a function call expression and Chain must be of pointer type This extension performs a function call Call with a static chain pointer Chain passed to the callee in a designated register. This is useful for calling foreign language functions whose ABI uses static chain pointers (e.g. to implement closures). Differential Revision: http://reviews.llvm.org/D6332 llvm-svn: 224167
* IR: Update clang for Metadata/Value split in r223802Duncan P. N. Exon Smith2014-12-091-5/+4
| | | | | | Match LLVM API changes from r223802. llvm-svn: 223803
* Use nullptr to silence -Wsentinel when self-hosting on WindowsReid Kleckner2014-12-011-29/+29
| | | | | | | | | | | Richard rejected my Sema change to interpret an integer literal zero in a varargs context as a null pointer, so -Wsentinel sees an integer literal zero and fires off a warning. Only CodeGen currently knows that it promotes integer literal zeroes in this context to pointer size on Windows. I didn't want to teach -Wsentinel about that compatibility hack. Therefore, I'm migrating to C++11 nullptr. llvm-svn: 223079
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-191-1/+1
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* Don't manually insert L prefixes.Rafael Espindola2014-11-061-180/+122
| | | | | | Simply marking the symbol private conveys the desire to hide them to LLVM. llvm-svn: 221451
* Allow protocols to be just declared.Rafael Espindola2014-09-121-3/+3
| | | | llvm-svn: 217704
* Objective-C IRGen. Fixes an assertion crash caused by inconsistentFariborz Jahanian2014-08-281-2/+1
| | | | | | | | linkage related to generation of OBJC_SELECTOR_REFERENCES symbol needed in generation of call to 'super' in a class method. // rdar://18150301 llvm-svn: 216676
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-271-3/+2
| | | | | | just letting them be implicitly created. llvm-svn: 216528
* AArch64: update Clang for merged arm64/aarch64 triples.Tim Northover2014-07-231-2/+1
| | | | | | | | | | | | | | The main subtlety here is that the Darwin tools still need to be given "-arch arm64" rather than "-arch aarch64". Fortunately this already goes via a custom function to handle weird edge-cases in other architectures, and it tested. I removed a few arm64_be tests because that really isn't an interesting thing to worry about. No-one using big-endian is also referring to the target as arm64 (at least as far as toolchains go). Mostly they date from when arm64 was a separate target and we *did* need a parallel name simply to test it at all. Now aarch64_be is sufficient. llvm-svn: 213744
* Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))Fariborz Jahanian2014-07-161-112/+144
| | | | | | | | | to be applied to class or protocols. This will direct IRGen for Objective-C metadata to use the new name in various places where class and protocol names are needed. rdar:// 17631257 llvm-svn: 213167
* Objective-C IRGen. Fixes an inconsistant linkage ofFariborz Jahanian2014-07-151-7/+4
| | | | | | | ObC's metaclass metadata with its class metadata which results in an assert. rdar://17633301 llvm-svn: 213076
* Don't assume StringRef.data() is null-terminatedBen Langmuir2014-07-111-1/+1
| | | | llvm-svn: 212790
* Objective-C IRGen. Patch to generate a weak symbol reference whenFariborz Jahanian2014-06-101-4/+7
| | | | | | | | 'super' dispatches a class method in category for OBJC_METACLASS. This is when class is a weak_import class. // rdar://16529125 llvm-svn: 210547
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-071-32/+24
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. llvm-svn: 210403
* AArch64/ARM64: rename ARM64 components to AArch64Tim Northover2014-05-241-1/+2
| | | | | | This keeps Clang consistent with backend naming conventions. llvm-svn: 209579
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-211-70/+76
| | | | llvm-svn: 209272
* Simplify the code a bit by using linkage predicates.Rafael Espindola2014-05-091-4/+4
| | | | llvm-svn: 208382
* ARM64: parametrise IVar offset type (long on ARM64, int elsewhere).Tim Northover2014-03-291-22/+33
| | | | | | | This is part of the ARM64 patch, but can only be tested properly when the full codegen gets committed. llvm-svn: 205098
* ObjC: allow targets to decide when to use stret for blocks.Tim Northover2014-03-291-2/+6
| | | | | | | This was originally part of the ARM64 patch, but seems semantically separate. llvm-svn: 205097
* Don't produce a L symbol in __DATA,__data.Rafael Espindola2014-03-271-1/+1
| | | | | | The section __DATA,__data is atomized by the linker and cannot have L symbols. llvm-svn: 204879
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-141-10/+8
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203958
* [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and ↵Aaron Ballman2014-03-141-8/+2
| | | | | | propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203930
* [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-141-4/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203922
* [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and ↵Aaron Ballman2014-03-131-3/+2
| | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203863
* [C++11] Replacing ObjCInterfaceDecl iterators ↵Aaron Ballman2014-03-131-5/+2
| | | | | | all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203848
* [C++11] Replacing ObjCContainerDecl iterators classmeth_begin() and ↵Aaron Ballman2014-03-131-22/+10
| | | | | | classmeth_end() with iterator_range class_methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203840
* [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and ↵Aaron Ballman2014-03-131-22/+13
| | | | | | instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203839
* Renaming the recently-created (r203830) props() range API to properties() ↵Aaron Ballman2014-03-131-2/+2
| | | | | | for clarity. llvm-svn: 203835
* [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() ↵Aaron Ballman2014-03-131-10/+6
| | | | | | with iterator_range props(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203830
OpenPOWER on IntegriCloud