summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-1/+1
| | | | | | ambiguous context. llvm-svn: 116567
* Fixes an obscure bug in importd block variable layoutFariborz Jahanian2010-09-111-1/+1
| | | | | | | | 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
* Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()Benjamin Kramer2010-08-171-1/+1
| | | | | | and remove getStrData(). Patch by Peter Davies (with some tweaks). llvm-svn: 111229
* Some early work for providing block layout info. Fariborz Jahanian2010-08-041-0/+4
| | | | | | for objective-c/c++ blocks (NeXt runtime). llvm-svn: 110213
* Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.John McCall2010-07-241-0/+6
| | | | | | Diagnose attempts to do this under the GNU or fragile NeXT runtimes. llvm-svn: 109298
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-7/+5
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Don't crash when sending a message inside a block with the non-fragile ABI ↵David Chisnall2010-07-211-1/+1
| | | | | | (GNU runtime). llvm-svn: 109012
* Mark the load after calling objc_msg_lookup_sender() so that it doesn't get ↵David Chisnall2010-07-211-2/+2
| | | | | | optimised away (GNU runtime). llvm-svn: 109010
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-211-3/+2
| | | | | | commits. llvm-svn: 109000
* Convert the ObjC @synchronized cleanups to laziness. This is not actuallyJohn McCall2010-07-211-7/+16
| | | | | | | a big deal, except that I want to eliminate the shared-code EH cleanups in preparation for a significant algorithmic fix. llvm-svn: 108973
* Adopt objc_assign_threadlocal() for __thread variables of GC types.Fariborz Jahanian2010-07-201-3/+9
| | | | | | Implements radar 8203301. llvm-svn: 108917
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-131-2/+1
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-214/+140
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* Objective-c++ IRGen. Support for @selector expression asFariborz Jahanian2010-06-171-3/+6
| | | | | | an lvalue. Fixes PR7390. llvm-svn: 106235
* Give Type::isIntegralType() an ASTContext parameter, so that itDouglas Gregor2010-06-161-2/+2
| | | | | | | | | | | | provides C "integer type" semantics in C and C++ "integral type" semantics in C++. Note that I still need to update isIntegerType (and possibly other predicates) using the same approach I've taken for isIntegralType(). The two should have the same meaning, but currently don't (!). llvm-svn: 106074
* Patch adds support for copying of thoseFariborz Jahanian2010-06-151-8/+3
| | | | | | | | objective-c++ class objects which have GC'able objc object pointers and need to use ObjC's objc_memmove_collectable API (radar 8070772). llvm-svn: 106061
* Push a return-value slot throughout ObjC message-send codegen. Will beJohn McCall2010-05-221-2/+6
| | | | | | | critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. llvm-svn: 104422
* Fix my inability to spell 'continue' and a case where message sends ↵David Chisnall2010-05-201-4/+7
| | | | | | returning non-pointer-sized things were generating invalid IR inside @try blocks. llvm-svn: 104222
* Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointedJohn McCall2010-05-171-4/+4
| | | | | | out. The remaining ones are okay. llvm-svn: 103973
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Tweaked selector mangling again (GNU runtime).David Chisnall2010-05-091-6/+17
| | | | llvm-svn: 103368
* Fixed linkage problem from last commit (GNU runtime).David Chisnall2010-05-081-2/+2
| | | | llvm-svn: 103355
* Tweaked selector generation (GNU runtime). Removed the use of GlobalAliases ↵David Chisnall2010-05-081-9/+15
| | | | | | in the generated bitcode. llvm-svn: 103353
* As per Chris' request, return the Instruction from EmitCall and add the ↵David Chisnall2010-05-021-3/+8
| | | | | | metadata in the caller. llvm-svn: 102862
* Attach message send metadata to the lookup as well as to the call (GNU runtime).David Chisnall2010-05-011-7/+10
| | | | llvm-svn: 102839
* Make super message lookups cacheable (GNUstep Runtime)David Chisnall2010-05-011-14/+34
| | | | llvm-svn: 102837
* Tweaked EmitCall() to permit the caller to provide some metadata to attach ↵David Chisnall2010-05-011-9/+18
| | | | | | | | to the call site. Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining. llvm-svn: 102833
* Fixed incorrect type of alloca (GNU runtime).David Chisnall2010-04-301-2/+5
| | | | llvm-svn: 102711
* Changed signature of GenerateMessageSend() function to pass the ↵David Chisnall2010-04-281-4/+16
| | | | | | | | ObjCInterfaceDecl for class messages and removed the boolean IsClassMessage argument, which wasn't used anywhere. Emitted some metadata on message sends to allow a later pass to do some speculative inlining of class methods (GNU runtime). Speculative inlining of instance methods requires type feedback to be useful (work in progress), but for class methods it works quite nicely. llvm-svn: 102514
* Remove unused function.Benjamin Kramer2010-04-281-4/+0
| | | | llvm-svn: 102499
* Emit the correct symbol name for the class (GNU runtime).David Chisnall2010-04-281-5/+7
| | | | llvm-svn: 102497
* Fixed message send to void (broken by my last commit - GNU runtime).David Chisnall2010-04-271-1/+2
| | | | llvm-svn: 102459
* Ensure return from a message to nil is always 0 (GNU runtime).David Chisnall2010-04-271-1/+67
| | | | | | | | | This works around stack corruption / crashes resulting from PR6944, and also works around people who expect 'what works on my machine' to work everywhere (GCC crashes in a number of cases on SPARC that should now work correctly with clang). llvm-svn: 102430
* Make the static type of the exception variable in an Objective-CDouglas Gregor2010-04-261-3/+3
| | | | | | | @catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-231-3/+4
| | | | | | | | | | statements. Instead of the @try having a single @catch, where all of the @catch's were chained (using an O(n^2) algorithm nonetheless), @try just holds an array of its @catch blocks. The resulting AST is slightly more compact (not important) and better represents the actual language semantics (good). llvm-svn: 102221
* Fix -Wcast-qual warnings.Dan Gohman2010-04-191-1/+2
| | | | llvm-svn: 101786
* Don't just emit ivar metadata - emit CORRECT ivar metadata. (GNU runtime)David Chisnall2010-04-191-2/+8
| | | | llvm-svn: 101759
* Fix emitting ivar metadata for synthesized ivars and some 64-bit fixes. (GNU ↵David Chisnall2010-04-191-12/+15
| | | | | | runtime) llvm-svn: 101758
* Add some API code for future work.Fariborz Jahanian2010-04-121-0/+6
| | | | llvm-svn: 101052
* the big refactoring bits of PR3782.Rafael Espindola2010-03-301-3/+3
| | | | | | | | This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
* Fixed synthesizing properties declared in properties (GNU runtime).David Chisnall2010-03-201-1/+1
| | | | llvm-svn: 99077
* Fixed copy-and-paste error causing categories to contain the protocols ↵David Chisnall2010-03-131-2/+2
| | | | | | declared on the class, not the protocols declared on the category. llvm-svn: 98455
* Don't generate method metadata for @dynamic properties. Fixes PR6354.David Chisnall2010-02-261-7/+12
| | | | llvm-svn: 97199
* Use the power of types to track down another canonicalization bug inJohn McCall2010-02-261-3/+3
| | | | | | the ABI-computation interface. Fixes <rdar://problem/7691046>. llvm-svn: 97197
* StringRefize two random methods, remove a dead variable and a weird ↵Benjamin Kramer2010-02-091-6/+5
| | | | | | | | constructor call. This maybe fixes some of the errors GCC 4.5 gives on this code. llvm-svn: 95684
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-3/+6
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Revert "Numerous changes to selector handling:", this breaks a whole bunch ofDaniel Dunbar2010-02-031-36/+25
| | | | | | working code, for no apparent reason. llvm-svn: 95244
* First pass at adding GC support for GNU runtime. GC ivar maps not yet ↵David Chisnall2010-02-031-6/+97
| | | | | | | | constructed, GC flag not set. Please don't try using this yet - the runtime support is still very immature and your code will almost certainly crash if you do. llvm-svn: 95222
* Numerous changes to selector handling:David Chisnall2010-02-031-25/+36
| | | | | | | | | | | | | | | | | | | | | | | - Don't use GlobalAliases with non-0 GEPs (GNU runtime) - this was unsupported and LLVM will be generating errors if you do it soon. This also simplifies the code generated by the GNU runtime a bit. - Make GetSelector() return a constant (GNU runtime), not a load of a store of a constant. - Recognise @selector() expressions as valid static initialisers (as GCC does). - Add methods to GCObjCRuntime to emit selectors as constants (needed for using @selector() expressions as constants. These need implementing for the Mac runtimes - I couldn't figure out how to do this, they seem to require a load. - Store an ObjCMethodDecl in an ObjCSelectorExpr so that we can get at the type information for the selector. This is needed for generating typed selectors from @selector() expressions (as GCC does). Ideally, this information should be stored in the Selector, but that would be an invasive change. We should eventually add checks for common uses of @selector() expressions. Possibly adding an attribute that can be applied to method args providing the types of a selector so, for example, you'd do something like this: - (id)performSelector: __attribute__((selector_types(id, SEL, id)))(SEL) withObject: (id)object; Then, any @selector() expressions passed to the method will be check to ensure that it conforms to this signature. We do this at run time on the GNU runtime already, but it would be nice to do it at compile time on all runtimes. - Made @selector() expressions emit type info if available and the runtime supports it. Someone more familiar with the Mac runtime needs to implement the GetConstantSelector() function in CGObjCMac. This currently just assert()s. llvm-svn: 95189
* Unique ObjC strings (GNU Runtime); fix for PR6142. Note: Doing this in the ↵David Chisnall2010-01-271-2/+10
| | | | | | runtime-specific code is a bit ugly. It would be a good idea to hoist all of the string / protocol uniqueing code up into CGObjCRuntime or CodeGenModule and only handle emitting the original versions in the runtime-specific code. llvm-svn: 94676
OpenPOWER on IntegriCloud