summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* DebugInfo can be enabled or disabled at function level (e.g. using an ↵Devang Patel2011-03-071-2/+2
| | | | | | attribute). However, at module level it is determined by command line option and the state of command line option does not change during compilation. Make this layering explicit and fix accidental cases where the code generator was checking whether module has debug info enabled instead of checking whether debug info is enabled for this function or not. llvm-svn: 127165
* Fix a typo.Dan Gohman2011-03-021-1/+1
| | | | llvm-svn: 126890
* Revert "Add CC_Win64ThisCall and set it in the necessary places."Tilmann Scheller2011-03-021-2/+1
| | | | | | This reverts commit 126863. llvm-svn: 126886
* Add CC_Win64ThisCall and set it in the necessary places.Tilmann Scheller2011-03-021-1/+2
| | | | llvm-svn: 126863
* Establish the iteration variable of an ObjC for-in loop beforeJohn McCall2011-02-221-7/+18
| | | | | | | emitting the collection expression. Fixes some really, really broken code. llvm-svn: 126193
* Objective-c armv7 API for atomic properties of Fariborz Jahanian2011-02-181-97/+135
| | | | | | scalar types. // rdar://7761305 llvm-svn: 125946
* Fix an IRGen bug in property setter calls whenFariborz Jahanian2011-02-081-1/+11
| | | | | | setter and getter types mismatch. // rdar://8966864 llvm-svn: 125125
* Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' Ken Dyck2011-01-191-4/+6
| | | | | | counterparts where char units are needed. llvm-svn: 123805
* Emit DW_TAG_lexical_scope to surround foreach.Devang Patel2011-01-191-0/+12
| | | | llvm-svn: 123802
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-3/+0
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-0/+2
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt2011-01-081-3/+3
| | | | | | | more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
* Rework a few things about how we emit ObjC's for enumeration statement.John McCall2011-01-071-95/+126
| | | | | | | | | | In particular, the iteration variable (if present) should be created and destroyed in a narrow span around the loop body, and the body should be emitted in a cleanup scope in case it's not a compound statement. Otherwise, rename a few variables and use phis instead of temporary variables for the index and buffer count. llvm-svn: 122988
* Add support for GNU runtime property set / get structure functions. Minor ↵David Chisnall2010-12-261-4/+4
| | | | | | refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point). llvm-svn: 122569
* Fix a bug in the emission of __real/__imag l-values on scalar operands.John McCall2010-12-051-2/+1
| | | | | | | | | Fix a bug in the emission of complex compound assignment l-values. Introduce a method to emit an expression whose value isn't relevant. Make that method evaluate its operand as an l-value if it is one. Fixes our volatile compliance in C++. llvm-svn: 120931
* More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet2010-12-041-2/+2
| | | | | | | | | | | | | | | | used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
* Test case for the l-value base only being evaluated once.John McCall2010-12-041-44/+43
| | | | | | | | | | Also, move the l-value emission code into CGObjC.cpp and teach it, for completeness, to store away self for a super send. Also, inline the super cases for property gets and sets and make them use the correct result type for implicit getter/setter calls. llvm-svn: 120887
* Kill the KVC l-value kind and calculate the base expression when emittingJohn McCall2010-12-041-20/+12
| | | | | | the l-value. llvm-svn: 120884
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-63/+55
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-4/+4
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-4/+4
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-4/+2
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* IRGen fix for using property-dot syntax to pass Fariborz Jahanian2010-09-101-1/+2
| | | | | | | reference object to a c++ member function. fixes radar 8409336. llvm-svn: 113602
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-3/+3
| | | | | | to the new constants. llvm-svn: 112047
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-251-1/+1
| | | | llvm-svn: 112044
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-2/+2
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Return type of a setter call caused byFariborz Jahanian2010-07-241-1/+1
| | | | | | | | use of property-dot syntax using 'super' as receiver is 'void'. This fixes a bug in generating correct API for setter call. Fixes radar 8203426. llvm-svn: 109297
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-2/+2
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-1/+2
| | | | llvm-svn: 108807
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unnecessary ASTContext parameter fromDouglas Gregor2010-07-011-1/+1
| | | | | | CXXRecordDecl::getDestructor(); no functionality change. llvm-svn: 107394
* Fix an Obj-C++ miscompile when calling an Obj-C method that returns a C++ ↵Anders Carlsson2010-06-211-2/+5
| | | | | | reference. llvm-svn: 106477
* When using property-dot assignment syntax to call a setter method,Fariborz Jahanian2010-06-071-2/+4
| | | | | | | type of rhs need be compared to setter's argument and not the getter type. Fixes radar 8062778 llvm-svn: 105560
* Re-land the fix for PR7139.Anders Carlsson2010-05-221-1/+1
| | | | llvm-svn: 104446
* Push a return-value slot throughout ObjC message-send codegen. Will beJohn McCall2010-05-221-13/+21
| | | | | | | critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. llvm-svn: 104422
* Unbreak self-host.Anders Carlsson2010-05-211-1/+1
| | | | llvm-svn: 104390
* Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle ↵Anders Carlsson2010-05-211-1/+1
| | | | | | setting null data member pointers correctly. Fixes PR7139. llvm-svn: 104387
* Allocate space in a block record for implicit references to the Objective CJohn McCall2010-05-211-2/+0
| | | | | | | | | | 'self' variable arising from uses of the 'super' keyword. Also reorganize some code so that BlockInfo (now CGBlockInfo) can be opaque outside of CGBlocks.cpp. Fixes rdar://problem/8010633. llvm-svn: 104312
* Correctly generate IR for ObjC messages sends to protocol-qualified types.John McCall2010-05-171-4/+5
| | | | | | Fixes rdar://problem/7992749 llvm-svn: 103965
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Implement semantic analysis and an AST representation for the namedDouglas Gregor2010-05-151-1/+2
| | | | | | | | | | | | return value optimization. Sema marks return statements with their NRVO candidates (which may or may not end up using the NRVO), then, at the end of a function body, computes and marks those variables that can be allocated into the return slot. I've checked this locally with some debugging statements (not committed), but there won't be any tests until CodeGen comes along. llvm-svn: 103865
* Code Gen support for Getter/Setter synthesis of Fariborz Jahanian2010-05-061-3/+23
| | | | | | C++ object properties. (still radar 7468090). llvm-svn: 103182
* Clean up the {} and else placement. This fixes an ambiguous else as well asChandler Carruth2010-05-061-6/+6
| | | | | | picking a more consistent pattern. llvm-svn: 103142
* This patch deals with Sema Part of Setter/Getter synthesisFariborz Jahanian2010-05-051-6/+0
| | | | | | | of properties which are of C++ objects. Code Gen to follow (Radar 7468090). llvm-svn: 103123
* Fixes a code gen. crash when ivar object has trivial constructor.Fariborz Jahanian2010-05-041-12/+14
| | | | llvm-svn: 103028
* Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.Anders Carlsson2010-05-021-1/+2
| | | | llvm-svn: 102882
* Support for construct/destruct of ivar arrayFariborz Jahanian2010-04-281-7/+18
| | | | | | | of c++ objects (NeXt runtime). radar 7900343. llvm-svn: 102546
* IRGen for initialization/destruction ofFariborz Jahanian2010-04-281-0/+49
| | | | | | | ivar class objects (NeXt runtime). (radar 7900343). llvm-svn: 102533
* Changed signature of GenerateMessageSend() function to pass the ↵David Chisnall2010-04-281-8/+10
| | | | | | | | 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
* CastExpr should not hold a pointer to the base path. More cleanup.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102249
OpenPOWER on IntegriCloud