summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add ObjC constant string support for NeXT.Daniel Dunbar2008-08-121-6/+3
| | | | | | | | | | Changed CGObjCRuntime::GenerateConstantString interface to take std::string instead of char* and size. Change ObjC functions which call on GenerateConstantString to bitcast result to appropriate type. llvm-svn: 54659
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | | - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and SourceLocation.h) - Move ASTContext constructor into implementation llvm-svn: 54627
* Add dummy Mac Objective-C runtime interface.Daniel Dunbar2008-08-111-1/+1
| | | | | | - Not currently accessible and completely non-functional. llvm-svn: 54624
* update to make IRBuilder API change.Chris Lattner2008-08-081-12/+12
| | | | llvm-svn: 54548
* don't pass in null as the Name for GenerateClassStructure,Chris Lattner2008-07-211-3/+2
| | | | | | | it goes and makes std::strings out of them, which is not defined. llvm-svn: 53843
* refactor more objc codegen interfaces to pass around selectors soChris Lattner2008-06-261-29/+19
| | | | | | we don't push strings into LLVM IR and then have to read them back out. llvm-svn: 52765
* indenting and other minor things.Chris Lattner2008-06-261-4/+4
| | | | llvm-svn: 52764
* refactor interface to GenerateClassStructure to avoid converting a Chris Lattner2008-06-261-7/+6
| | | | | | string to LLVM IR and then regenerating the string from IR. llvm-svn: 52762
* remove the old getSelector implementation, which removes someChris Lattner2008-06-261-61/+2
| | | | | | calls to getStringValue llvm-svn: 52761
* avoid a lot of unneeded selector processing work by passing aroundChris Lattner2008-06-261-5/+5
| | | | | | selectors instead of Value*'s. llvm-svn: 52760
* use cheaper/simpler getselector call for @selector exprs.Chris Lattner2008-06-261-1/+1
| | | | llvm-svn: 52759
* start avoid doing lots of unneeded work handling selectorsChris Lattner2008-06-261-17/+33
| | | | llvm-svn: 52758
OpenPOWER on IntegriCloud