summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)Mehdi Amini2016-10-101-1/+1
| | | | llvm-svn: 283815
* CodeGen: honour dllstorage on ObjC typesSaleem Abdulrasool2016-07-171-3/+57
| | | | | | | | Add support for ObjC types to respect the DLLImport/DLLExport storage annotations. This only effects COFF output. This would allow usage with clang/C2, but not with clang/LLVM due to hard coded section names. llvm-svn: 275737
* CodeGen: whitespace, formatting cleanups, NFCSaleem Abdulrasool2016-07-171-31/+28
| | | | | | | Format some code which was oddly formatted. Use a bit of auto to make the code more legible. NFC. llvm-svn: 275736
* Use arrays or initializer lists to feed ArrayRefs instead of SmallVector ↵Benjamin Kramer2016-07-021-55/+34
| | | | | | | | where possible. No functionality change intended llvm-svn: 274432
* Restructure the propagation of -fPIC/-fPIE.Rafael Espindola2016-06-231-1/+1
| | | | | | | | | | | | | The PIC and PIE levels are not independent. In fact, if PIE is defined it is always the same as PIC. This is clear in the driver where ParsePICArgs returns a PIC level and a IsPIE boolean. Unfortunately that is currently lost and we pass two redundant levels down the pipeline. This patch keeps a bool and a PIC level all the way down to codegen. llvm-svn: 273566
* Reduce the number of implicit StringRef->std::string conversions by ↵Benjamin Kramer2016-02-131-1/+1
| | | | | | | | threading StringRef through more APIs. No functionality change intended. llvm-svn: 260815
* Fix some Clang-tidy readability-redundant-control-flow warnings; other minor ↵Eugene Zelenko2016-02-101-26/+56
| | | | | | | | fixes. Differential revision: http://reviews.llvm.org/D17060 llvm-svn: 260414
* Use instance_properties instead of properties. NFC.Manman Ren2016-01-261-1/+1
| | | | | | | | | | | All current properties are instance properties. This is the second patch in a series of patches to support class properties in addition to instance properties in objective-c. rdar://23891898 llvm-svn: 258824
* Preserve exceptions information during calls code generation.Samuel Antao2015-11-231-4/+4
| | | | | | | | | | | This patch changes the generation of CGFunctionInfo to contain the FunctionProtoType if it is available. This enables the code generation for call instructions to look into this type for exception information and therefore generate better quality IR - it will not create invoke instructions for functions that are know not to throw. llvm-svn: 253926
* Watch and TV OS: wire up basic ABI choicesTim Northover2015-10-301-0/+1
| | | | | | | 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
* Revert "[opaque pointer type] update for LLVM API change"David Blaikie2015-09-141-3/+3
| | | | | | | | | | This was the wrong direction to take anyway (because ultimately the GlobalValue needed the pointee type again and /it/ used PointerType::getElementType eventually anyway)... let's go a different way. This reverts commit r236161. llvm-svn: 247586
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-081-104/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-4/+3
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [opaque pointer type] Pass the explicit call type when creating calls from ↵David Blaikie2015-05-191-17/+12
| | | | | | | | | | | LazyRuntimeFunctions The implicit conversion was causing issues for a helper being added that would take an llvm::Function rather than an llvm::Value to make the CallInst. Since we'll eventually need to specify the type of the call explicitly anyway, fix these up to avoid the future ambiguity. llvm-svn: 237729
* Fix indentationDavid Blaikie2015-05-181-43/+43
| | | | llvm-svn: 237631
* API update for streamlining of IRBuilder::CreateCall to just use ↵David Blaikie2015-05-181-11/+9
| | | | | | ArrayRef/initializer_list+braced init llvm-svn: 237625
* [opaque pointer type] update for LLVM API changeDavid Blaikie2015-04-291-3/+3
| | | | llvm-svn: 236161
* clang-format my last commitDavid Blaikie2015-04-051-2/+4
| | | | | | (sorry, keep forgetting that) llvm-svn: 234129
* [opaque pointer type] More GEP API migrationsDavid Blaikie2015-04-051-10/+11
| | | | | | | Looks like the VTable code in particular will need some work to pass around the pointee type explicitly. llvm-svn: 234128
* [opaque pointer type] Update for GEP API changes in LLVMDavid Blaikie2015-04-021-15/+20
| | | | | | | | | | 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
* Replace size() calls on containers with empty() calls where appropriate. NFCAlexander Kornienko2015-01-231-1/+1
| | | | | | | | http://reviews.llvm.org/D7090 Patch by Gábor Horváth! llvm-svn: 226914
* IR: Update clang for Metadata/Value split in r223802Duncan P. N. Exon Smith2014-12-091-9/+8
| | | | | | Match LLVM API changes from r223802. llvm-svn: 223803
* Use the new LLVM_END_WITH_NULL nameReid Kleckner2014-11-041-1/+1
| | | | llvm-svn: 221217
* Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper2014-08-301-6/+6
| | | | | | const from some other StringRefs since its implicitly const already. llvm-svn: 216825
* Remove the overload of GetAddrOfConstantString methodAlexey Samsonov2014-06-041-2/+1
| | | | llvm-svn: 210214
* [C++11] Use 'nullptr'. CodeGen edition.Craig Topper2014-05-211-102/+109
| | | | llvm-svn: 209272
* Update for llvm api change.Rafael Espindola2014-05-171-3/+3
| | | | llvm-svn: 209077
* Update for llvm api change.Rafael Espindola2014-05-171-10/+9
| | | | llvm-svn: 209074
* Update for llvm API change.Rafael Espindola2014-05-161-3/+3
| | | | llvm-svn: 208984
* [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and ↵Aaron Ballman2014-03-141-5/+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 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 protocol_begin() and ↵Aaron Ballman2014-03-131-6/+2
| | | | | | | | protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops. Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases. llvm-svn: 203842
* [C++11] Replacing ObjCContainerDecl iterators classmeth_begin() and ↵Aaron Ballman2014-03-131-17/+11
| | | | | | 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-16/+11
| | | | | | 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-1/+1
| | | | | | for clarity. llvm-svn: 203835
* [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() ↵Aaron Ballman2014-03-131-4/+1
| | | | | | 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-120/+97
| | | | | | class. llvm-svn: 203643
* Remove dead return and simplify code.Ted Kremenek2014-03-071-3/+1
| | | | llvm-svn: 203266
* [Modules] Update to reflect the move of CallSite into the IR library inChandler Carruth2014-03-041-1/+1
| | | | | | LLVM r202816. llvm-svn: 202817
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202625
* Refactor linkage computation in CGObjCMac.cpp.Rafael Espindola2014-02-261-2/+3
| | | | | | | | | | | | | | Before this patch the globals were created with the wrong linkage and patched afterwards. From the comments it looks like something would complain about having an internal GV with no initializer. At least in clang the verifier will only run way after we set the initializer, so that is not a problem. This patch should be a nop. It just figures out the linkage earlier and converts the old calls to setLinkage to asserts. The only case where that is not possible is when we first see a weak import that is then implemented. In that case we have to change the linkage, but that is the only setLinkage left. llvm-svn: 202305
* Use getPointerSizeInBits.Rafael Espindola2014-01-091-2/+3
| | | | | | | I introduced this bug in 198815. Thanks for Mark Lacey for noticing. Unfortunately, I have no idea how to test this code. llvm-svn: 198891
* Used the DataLayout methods instead of the Module methods.Rafael Espindola2014-01-091-4/+2
| | | | llvm-svn: 198815
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+1
| | | | llvm-svn: 196510
* Add heading and remove leftover personal email addressesAlp Toker2013-11-251-2/+1
| | | | | | | | | | | | | | clang's attribute support is mature by now so replace Sean's warning and email address with a standard LLVM copyright heading. Also remove a personal email address and credit docstring from CGObjCGNU that shouldn't have been there. This is in line with the LLVM developer policy introduced in r45410. Contributors can add themselves to CREDITS.txt while active module owners are listed in CODE_OWNERS.TXT. llvm-svn: 195587
* No functionality change. Reflow lines that could fit on one line. Break linesNick Lewycky2013-10-011-2/+1
| | | | | | that had 80-column violations. Remove spurious emacs mode markers on .cpp files. llvm-svn: 191797
* Fix GNU ObjC ABI for a message returning a struct.Eli Friedman2013-07-261-13/+38
| | | | | | | | | This allows the ObjFW runtime to correctly implement message forwarding for messages which return a struct. Patch by Jonathan Schleifer. llvm-svn: 187174
* Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector ↵Craig Topper2013-07-141-1/+1
| | | | | | size. llvm-svn: 186284
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-43/+44
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* Improve property metadata generation with the GNUstep runtime.David Chisnall2013-02-281-18/+42
| | | | llvm-svn: 176254
OpenPOWER on IntegriCloud