summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-171/+155
| | | | | | class. llvm-svn: 203643
* Objective-C IRGen. Fixes several regressions caused by changes madeFariborz Jahanian2014-03-111-5/+31
| | | | | | to setting of ObjC linkages. //rdar://16206443 llvm-svn: 203521
* Reverting llvm::distance changes to use std::distance with iterators ↵Aaron Ballman2014-03-101-4/+2
| | | | | | | | instead, per post-commit review feedback. Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach. llvm-svn: 203461
* [C++11] Replacing RecordDecl iterators field_begin() and field_end() with ↵Aaron Ballman2014-03-081-6/+2
| | | | | | iterator_range fields(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203355
* [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() ↵Aaron Ballman2014-03-071-6/+2
| | | | | | with iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203255
* Use llvm.compiler.used instead of llvm.used for objc symbols.Rafael Espindola2014-03-061-17/+17
| | | | | | | | | | | | | LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the ones that the clang's objc codegen is producing. The net result, is that it is equivalent to llvm.compiler.used. The need for putting the private symbol in llvm.compiler.used should be clear (the objc runtime uses them). The reason for also putting the weak symbols in it is for LTO: ld64 will not ask us to preserve the it. llvm-svn: 203172
OpenPOWER on IntegriCloud