summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Some "prep" work for handling ObjC @-string constants that contain UTF-8. No ↵Steve Naroff2009-03-311-2/+4
| | | | | | | | 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
* Use CodeGenModule API for ObjC runtime function references.Fariborz Jahanian2009-03-301-14/+28
| | | | | | Patch by David Chisnall. llvm-svn: 68043
* Obscure code gen bug related to sending Fariborz Jahanian2009-02-281-0/+2
| | | | | | | 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/+20
| | | | | | in preparation for nonfragile ivar offset work. llvm-svn: 64225
* Patch fixes messaging for GNU runtime.Fariborz Jahanian2009-02-041-58/+36
| | | | | | Patch by David Chisnall llvm-svn: 63769
* GNUStep fast enumeration.Fariborz Jahanian2009-02-031-1/+3
| | | | | | Patch by David Chisnall. llvm-svn: 63666
* ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).Fariborz Jahanian2009-02-031-13/+19
| | | | llvm-svn: 63644
* objc2's ir-gen for nonfragile ivar access.Fariborz Jahanian2009-02-031-0/+2
| | | | llvm-svn: 63578
* Thread CGFunctionInfo construction through CodeGenTypes.Daniel Dunbar2009-02-021-4/+6
| | | | | | - Inefficient & leaks memory currently, will be cleaned up subsequently. llvm-svn: 63567
* More ABI API cleanup.Daniel Dunbar2009-02-021-2/+2
| | | | | | | - Lift CGFunctionInfo creation above ReturnTypeUsesSret and EmitFunction{Epi,Pro}log. llvm-svn: 63553
* ABI handling API changes.Daniel Dunbar2009-02-021-3/+4
| | | | | | | | | | | - Lift CGFunctionInfo creation up to callers of EmitCall. - Move isVariadic bit out of CGFunctionInfo, take as argument to GetFunctionType instead. No functionality change. llvm-svn: 63550
* Refactored code gen for ivar access in preparation forFariborz Jahanian2009-02-021-0/+16
| | | | | | objc2 nonfragile ivar access code gen. llvm-svn: 63541
* improvements for GNU objc runtime support, patch by David Chisnall!Chris Lattner2009-01-271-32/+54
| | | | llvm-svn: 63092
* revert the gnu objc patches, they regress codegen-gnu.mChris Lattner2009-01-211-11/+7
| | | | llvm-svn: 62708
* switch from getTypeAtIndex to getElementType. It is non-virtualChris Lattner2009-01-211-1/+1
| | | | | | and more idiomatic. llvm-svn: 62705
* Fix objc type conversion issues with the GNU runtime, patch byChris Lattner2009-01-211-7/+11
| | | | | | David Chisnall llvm-svn: 62703
* (LLVM up) Match TargetData API change in LLVM TOT.Daniel Dunbar2009-01-121-1/+1
| | | | llvm-svn: 62101
* This patch fixes the code gen failures which was a fallout fromFariborz Jahanian2009-01-101-2/+4
| | | | | | | | not merging protocol properties into the classes which use those protocols. With this patch, all my exceutable test pass again. llvm-svn: 62030
* Provide a new kind of iterator, the specific_decl_iterator, thatDouglas Gregor2009-01-091-1/+1
| | | | | | | | | filters the decls seen by decl_iterator with two criteria: the dynamic type of the declaration and a run-time predicate described by a member function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl considerably. It has no measurable performance impact. llvm-svn: 61994
* Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl).Steve Naroff2009-01-081-1/+1
| | | | | | | | Convert clients to use the standard getDeclContext() API. Doug, thanks for the review! llvm-svn: 61935
* This is a large/messy diff that unifies the ObjC AST's with DeclContext.Steve Naroff2009-01-081-2/+2
| | | | | | | | | | | | | | | - ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts. - ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext). - ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-) - Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective. - Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch(). - Simplified Sema::ActOnAtEnd() considerably. Still more work to do. - Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl. - Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl. This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction. llvm-svn: 61929
* Code gen. for ivar references; including bitfieldFariborz Jahanian2008-12-151-1/+2
| | | | | | ivars. llvm-svn: 61043
* Correct CodeGen assumption that LongTy == Int32Ty in a few places. This ↵Sebastian Redl2008-12-041-2/+2
| | | | | | makes several CodeGenObjC tests pass on 64-bit by fixing assertions. This doesn't mean that the result is actually what the GNU runtime expects, though. llvm-svn: 60515
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-6/+7
| | | | | | | | | | | uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. llvm-svn: 59947
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-11/+11
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-8/+9
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* Consolidated @try and @synchronize into a singleFariborz Jahanian2008-11-211-12/+5
| | | | | | code gen. method. llvm-svn: 59767
* Introducing objc_assign_ivar to clang.Fariborz Jahanian2008-11-201-0/+8
| | | | llvm-svn: 59740
* Generate strong write barriers for __strong objects.Fariborz Jahanian2008-11-191-0/+16
| | | | | | Also, took care of Daniel's commments. llvm-svn: 59575
* Patch for generation of weak write barriers for objcFariborz Jahanian2008-11-181-2/+10
| | | | | | __weak objects. llvm-svn: 59560
* Generate objc_read_weak for __weak objc loads.Fariborz Jahanian2008-11-181-0/+8
| | | | llvm-svn: 59553
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-5/+5
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* Start implementing support for @synchonized with the darwin ObjC API.Chris Lattner2008-11-151-0/+7
| | | | | | Patch by Fariborz! llvm-svn: 59377
* Move IRBuilder type definition to common file.Daniel Dunbar2008-11-011-8/+7
| | | | | | - No functionality change. llvm-svn: 58546
* Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.Daniel Dunbar2008-10-171-3/+1
| | | | llvm-svn: 57716
* Add Obj-C runtime methods to get runtime specific functions forDaniel Dunbar2008-09-241-8/+13
| | | | | | implementing property access. llvm-svn: 56542
* Move FunctionType conversion into CGCall.cpp:Daniel Dunbar2008-09-101-27/+2
| | | | | | | | | | | | | - Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo. - Updated Obj-C runtimes to use this instead of rolling the llvm::FunctionType by hand. - Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}. Add ABIArgInfo class to encapsulate ABI decision of how to lower types to LLVM. - Will move to target sometime soon. llvm-svn: 56047
* Move handling of @try and @throw to the runtime class.Anders Carlsson2008-09-091-0/+17
| | | | llvm-svn: 55983
* Change CodeGen to emit calls using (RValue,Type) list:Daniel Dunbar2008-09-091-4/+5
| | | | | | | | | | | | | | - 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/+8
| | | | llvm-svn: 55583
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-10/+14
| | | | | | | | | | | | | | | | | | | | | | - 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-14/+22
| | | | | | | | | | | | | | | | - 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-6/+11
| | | | | | | - 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-52/+39
| | | | | | | | | | | | | | | | | | - 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
* Add NeXT runtime support for generating methods.Daniel Dunbar2008-08-161-10/+0
| | | | | | | | | | | | | Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an ImplicitParamDecl. Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in CodeGenFunction). Change the Objective-C method generation to use EmitParmDecl for implicit parameters. llvm-svn: 54838
* Change ObjCRuntime::LookupClass -> GetClass, and now takes theDaniel Dunbar2008-08-161-8/+10
| | | | | | | | | | | | | 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-61/+147
| | | | | | | | | - 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
* Add GetAddrOfConstantCString methodDaniel Dunbar2008-08-131-5/+5
| | | | | | | | | | | | | | | | | | - Returns addr of constant for argument + '\0'. - I couldn't think of a better name. - Move appropriate users of GetAddrOfConstantString to this. Rename getStringForStringLiteral to GetStringForStringLiteral. Add GetAddrOfConstantStringFromLiteral - This combines GetAddrOfConstantString and GetStringForStringLiteral. This method can be, but is not yet, more efficient. Change GetAddrOfConstantString to not add terminating '\0' - <rdar://problem/6140956> llvm-svn: 54768
* Change ObjCRuntime GenerateProtocol[Ref] methods to takeDaniel Dunbar2008-08-131-16/+34
| | | | | | | | | | | 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-4/+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