summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add invariant.load metadata to loads from selector references. Allows these ↵Pete Cooper2011-11-101-1/+6
| | | | | | loads to later be moved/combined in the optimizer. Fixes <rdar://problem/6027699> llvm-svn: 144318
* In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson2011-10-311-0/+27
| | | | | | double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350
* Objective-c: fix an ir-gen crash where objc messag returns a _ComplexFariborz Jahanian2011-10-261-8/+24
| | | | | | | value and ABI requires return slot to be passed as first argument to message sent. // rdar://10331109 llvm-svn: 143053
* Replace vectors with arrays.Benjamin Kramer2011-10-151-64/+70
| | | | llvm-svn: 142072
* Constant expression evaluation refactoring:Richard Smith2011-10-101-3/+2
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* When performing an @throw in ARC, retain + autoreleaseJohn McCall2011-10-011-2/+2
| | | | | | | the pointer, being sure to do so before running cleanups associated with that full-expression. rdar://10042689 llvm-svn: 140945
* de-tmpify clang.Benjamin Kramer2011-09-271-15/+13
| | | | llvm-svn: 140637
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-6/+6
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Clean up our handling of Objective-C definitions in AST files. RatherDouglas Gregor2011-09-101-7/+0
| | | | | | | | | than having CodeGen check whether a declaration comes from an AST file (which it shouldn't know or care about), make sure that the AST writer and reader pass along "interesting" declarations that CodeGen needs to know about. llvm-svn: 139441
* Introduce a new predicate Decl::isFromASTFile() to determine whether aDouglas Gregor2011-09-091-1/+1
| | | | | | | | declaration was deserialized from an AST file. Use this instead of Decl::getPCHLevel() wherever possible. This is a simple step toward killing off Decl::getPCHLevel(). llvm-svn: 139427
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-4/+4
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* switch clang to use the new-new way of creating llvm::StructType's.Chris Lattner2011-08-121-96/+68
| | | | llvm-svn: 137472
* Encapsulate the Objective-C id/Class/SEL "redefinition" types inDouglas Gregor2011-08-111-2/+2
| | | | | | | | | ASTContext with accessors/mutators. The only functional change is that the AST writer won't bother writing the id/Class/SEL redefinition type if it hasn't been explicitly set; previously, it ended up being written as a synonym for the built-in id/Class/SEL. llvm-svn: 137349
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-1/+0
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-25/+25
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-221-1/+1
| | | | | | ArrayRef. llvm-svn: 135761
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-221-21/+18
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-211-2/+2
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-26/+26
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-8/+4
| | | | llvm-svn: 135265
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-1/+1
| | | | | | of flags. No functionality change. llvm-svn: 134997
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-254/+235
| | | | llvm-svn: 134831
* Eliminate most uses of ShallowCollectObjCIvars which requiresFariborz Jahanian2011-06-281-20/+19
| | | | | | | a vector for collection. Use iterators where needed instead. // rdar://6817577 llvm-svn: 134015
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-5/+13
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Alloa catching Objective-C id's being thrown with C++ throwFariborz Jahanian2011-06-221-8/+14
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
* Replace the existing forms of ConstantArray::get() with a single formJay Foad2011-06-221-1/+1
| | | | | | that takes an ArrayRef. llvm-svn: 133615
* Update to match mainline ConstantStruct::get API change. Also, use Chris Lattner2011-06-201-35/+29
| | | | | | | | | | | ConvertType on InitListExprs as they are being converted. This is needed for a forthcoming patch, and improves the IR generated anyway (see additional type names in testcases). This patch also converts a bunch of std::vector's in CGObjCMac to use C arrays. There are a ton more that should be converted as well. llvm-svn: 133413
* 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
OpenPOWER on IntegriCloud