summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCRuntime.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Numerous changes to selector handling:", this breaks a whole bunch ofDaniel Dunbar2010-02-031-6/+0
| | | | | | working code, for no apparent reason. llvm-svn: 95244
* Numerous changes to selector handling:David Chisnall2010-02-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Created __builtin___NSStringMakeConstantString() builtin, which generates ↵David Chisnall2010-01-231-1/+1
| | | | | | constant Objective-C strings. llvm-svn: 94274
* Patch fixes a code gen. bug in generation of objc_assign_ivarFariborz Jahanian2009-09-241-1/+2
| | | | | | (objc GC's API). llvm-svn: 82724
* IRgen/ObjC: Make the target method decl available to GenerateMessageSendSuper.Daniel Dunbar2009-09-171-2/+9
| | | | llvm-svn: 82117
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-15/+15
| | | | llvm-svn: 81346
* Re-implemented generation of objc_memmove_collectableFariborz Jahanian2009-08-311-1/+1
| | | | | | API for copying GC'able aggregates (Next runtime only). llvm-svn: 80607
* fix objc codegen to not have its own list of things that eventually get into ↵Chris Lattner2009-07-171-3/+0
| | | | | | | | llvm.used, just populate CGM's list directly. llvm-svn: 76266
* Implemented memmove_collectable API for Next runtimeFariborz Jahanian2009-07-081-0/+4
| | | | | | | when struct variables with GC'able members are copied into. Will provide a test case later. llvm-svn: 74984
* Patch fixes an obscure bug when 'used' attribute is applied toFariborz Jahanian2009-06-231-0/+3
| | | | | | | | | variables in ObjC's Next runtime mode. Next runtime also implicitly applies 'used' attribute on some of its meta-data. This results in two 'llvm.used' arrays to be generated, and one of them is renamed to 'llvm.used1'. llvm-svn: 74008
* Reflow some comments.Mike Stump2009-05-161-6/+5
| | | | llvm-svn: 71937
* Patch to support Gnu runtime's typed selectors.Fariborz Jahanian2009-05-051-2/+8
| | | | | | Patch by David Chisnall. llvm-svn: 71023
* Add a ComputeIvarBaseOffset overload taking an implementationDaniel Dunbar2009-05-031-0/+6
| | | | | | | | decl. Only this routine will be suitable for computing the offset of a synthesized ivar. - No functionality change. llvm-svn: 70696
* Compute Objective-C metadata size information from the record layout,Daniel Dunbar2009-05-031-6/+0
| | | | | | not the shadow structure. llvm-svn: 70691
* Coalesce the ivar offset calculation further.Daniel Dunbar2009-05-031-1/+3
| | | | llvm-svn: 70683
* Add CGObjCRuntime::GetConcreteClassStruct to encapsulate access to theDaniel Dunbar2009-04-221-3/+9
| | | | | | underlying llvm::StructType for an interface. llvm-svn: 69796
* Merge ivar access amongst the three runtimes.Daniel Dunbar2009-04-221-2/+22
| | | | | | | | | - For now, this means we are always doing the address computations by hand instead of constructing a proper GEP. Right now, however, this is less important than having fewer entry points to dealing with Objective-C interface layout. llvm-svn: 69787
* Make ObjCInterfaceDecl's const in some more places.Daniel Dunbar2009-04-221-1/+1
| | | | llvm-svn: 69775
* Kill ASTContext::[gs]etFieldForDecl, instead we just lookup thingsDaniel Dunbar2009-04-211-1/+0
| | | | | | | | when we need them -- which is exactly what some code was already doing! - No intended functionality change. llvm-svn: 69648
* Remove LateBoundIVars() runtime interface, it is unused.Daniel Dunbar2009-04-211-9/+3
| | | | llvm-svn: 69641
* Some "prep" work for handling ObjC @-string constants that contain UTF-8. No ↵Steve Naroff2009-03-311-1/+2
| | | | | | | | functionality change. Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen). llvm-svn: 68114
* pull "runtime globals" into the same framework as other functions/global ↵Chris Lattner2009-03-221-3/+3
| | | | | | | | variables. No intended functionality change. llvm-svn: 67478
* Obscure code gen bug related to sending Fariborz Jahanian2009-02-281-0/+1
| | | | | | | message to 'super' in a class method declared in cateogy (darwin specific). llvm-svn: 65709
* Some refactoring of Ivar offset code gen.Fariborz Jahanian2009-02-101-0/+3
| | | | | | in preparation for nonfragile ivar offset work. llvm-svn: 64225
* ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).Fariborz Jahanian2009-02-031-6/+6
| | | | llvm-svn: 63644
* objc2's ir-gen for nonfragile ivar access.Fariborz Jahanian2009-02-031-0/+1
| | | | llvm-svn: 63578
* Refactored code gen for ivar access in preparation forFariborz Jahanian2009-02-021-0/+7
| | | | | | objc2 nonfragile ivar access code gen. llvm-svn: 63541
* Use NonFragileABI as name of new Next abi. More comments Fariborz Jahanian2009-01-221-1/+1
| | | | | | for the new meta-data. llvm-svn: 62806
* Refactoring ObjC Next's runtime classes in preparation forFariborz Jahanian2009-01-211-0/+1
| | | | | | the new ObjC's abi. llvm-svn: 62721
* This patch fixes the code gen failures which was a fallout fromFariborz Jahanian2009-01-101-1/+3
| | | | | | | | not merging protocol properties into the classes which use those protocols. With this patch, all my exceutable test pass again. llvm-svn: 62030
* Remove tabs.Nate Begeman2008-12-161-1/+1
| | | | llvm-svn: 61097
* Consolidated @try and @synchronize into a singleFariborz Jahanian2008-11-211-4/+2
| | | | | | code gen. method. llvm-svn: 59767
* Introducing objc_assign_ivar to clang.Fariborz Jahanian2008-11-201-0/+2
| | | | llvm-svn: 59740
* Generate strong write barriers for __strong objects.Fariborz Jahanian2008-11-191-0/+4
| | | | | | Also, took care of Daniel's commments. llvm-svn: 59575
* Patch for generation of weak write barriers for objcFariborz Jahanian2008-11-181-1/+3
| | | | | | __weak objects. llvm-svn: 59560
* Generate objc_read_weak for __weak objc loads.Fariborz Jahanian2008-11-181-0/+2
| | | | llvm-svn: 59553
* Start implementing support for @synchonized with the darwin ObjC API.Chris Lattner2008-11-151-0/+3
| | | | | | Patch by Fariborz! llvm-svn: 59377
* Move IRBuilder type definition to common file.Daniel Dunbar2008-11-011-6/+5
| | | | | | - No functionality change. llvm-svn: 58546
* Add Obj-C runtime methods to get runtime specific functions forDaniel Dunbar2008-09-241-0/+6
| | | | | | implementing property access. llvm-svn: 56542
* Move handling of @try and @throw to the runtime class.Anders Carlsson2008-09-091-0/+7
| | | | llvm-svn: 55983
* Change CodeGen to emit calls using (RValue,Type) list:Daniel Dunbar2008-09-091-5/+4
| | | | | | | | | | | | | | - Add CodeGenFunction::EmitAnyExprToTemp o Like EmitAnyExpr, but emits aggregates to a temporary location if none is available. Seems like this should be simpler (even aside from using first class aggregates). - Killed CodeGenFunction::EmitCallArg (just append the pair) - Conversion of RValues to actual call arguments is now isolated in CodeGenFunction::EmitCall. llvm-svn: 55970
* Handle mutation while enumerating correctly. Fix some bugs.Anders Carlsson2008-08-311-0/+4
| | | | llvm-svn: 55583
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. llvm-svn: 55561
* Refactor handling of calls:Daniel Dunbar2008-08-301-3/+7
| | | | | | | | | | | | | | | | - Added CodeGenFunction::EmitCall which just takes the callee, return type, and a list of (Value*,QualType) pairs. - Added CodeGenFunction::EmitCallArg which handles emitting code for a call argument and turning it into an appropriate (Value*,QualType) pair. - Changed Objective-C runtime interface so that the actual emission of arguments for message sends is (once again) done in the code to emit a message send. No intended functionality change, this is prep work for better ABI support and for Objective-C property setter support. llvm-svn: 55560
* Fix Obj-C super sends inside class methods.Daniel Dunbar2008-08-251-4/+7
| | | | | | | - NeXT loads the super class at runtime; this required changing the runtime interface to pass more information down. llvm-svn: 55307
* Trim CGObjCRuntime::GenerateMessageSend[Super]Daniel Dunbar2008-08-231-14/+16
| | | | | | | | | | | | | | | | | | - Returns an RValue. - Reduced to only taking the CodeGenFunction, Expr, and Receiver. - Becomes responsible for emitting the arguments. Add CodeGenFunction::EmitCallExprExt - Takes optional extra arguments to insert at the head of the call. - This allows the Obj-C runtimes to call into this and isolates the argument and call instruction generation code to one place. Upshot is that we now pass structures (more) correctly. Also, fix one aspect of generating methods which take structure arguments (for NeXT). This probably needs to be merged with the SetFunctionAttributes code in CodeGenModule.cpp llvm-svn: 55223
* Change ObjCRuntime::LookupClass -> GetClass, and now takes theDaniel Dunbar2008-08-161-10/+13
| | | | | | | | | | | | | ObjCInterfaceDecl. Change ObjCRuntime::GenerateMessageSendSuper to take the ObjCInterfaceDecl for the super class, instead of just its name. Change EmitObjCMessageExpr to make the right runtime calls for super sends in class methods (i.e. a super send with the class object as the receiver). llvm-svn: 54833
* Change CGObjCRuntime methods to take appropriate clang Decls.Daniel Dunbar2008-08-151-45/+33
| | | | | | | | | - This is in prep for implementation class support for the NeXT runtime, for which the existing methods don't provide enough information (and additionally make too many assumptions about how things should be emitted). llvm-svn: 54824
* Change ObjCRuntime GenerateProtocol[Ref] methods to takeDaniel Dunbar2008-08-131-8/+13
| | | | | | | | | | | ObjCProtocolDecl directly. Implement CodeGen support for forward protocol decls (no-ops are so nice to implement). Also moved CGObjCRuntime.h out of CodeGenModule.h llvm-svn: 54709
* Drop Sender from GenerateMessageSend*Daniel Dunbar2008-08-121-11/+0
| | | | | | | | | - Was unused and generated a unnecessary load of self Update NeXT runtime to get proper object & selector types from ASTContext. llvm-svn: 54667
OpenPOWER on IntegriCloud