summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-1/+1
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Attempt to unbreak Windows build.Daniel Dunbar2009-01-161-3/+3
| | | | llvm-svn: 62295
* Fix some unused variable, control reaches end of non-void function,Daniel Dunbar2009-01-151-3/+2
| | | | | | and uninitialized use options. llvm-svn: 62270
* Fix a misleading comment.Steve Naroff2009-01-101-4/+4
| | | | llvm-svn: 62031
* This patch fixes the code gen failures which was a fallout fromFariborz Jahanian2009-01-101-9/+6
| | | | | | | | not merging protocol properties into the classes which use those protocols. With this patch, all my exceutable test pass again. llvm-svn: 62030
* assert if attempting to code gen. a property setter/getterFariborz Jahanian2009-01-101-0/+4
| | | | | | coming from a protocol. llvm-svn: 62017
* Couple of code gen. fixes in ObjC's colection-statement. HardFariborz Jahanian2009-01-061-1/+3
| | | | | | to track down, easy to fix. This is on going. llvm-svn: 61817
* Removed a slot in ObjCMemRegExpr used inFariborz Jahanian2008-12-181-2/+2
| | | | | | code gen which did not belong there. llvm-svn: 61203
* Code gen. for ivar references; including bitfieldFariborz Jahanian2008-12-151-1/+3
| | | | | | ivars. llvm-svn: 61043
* Store the size of the EH stack inside each BreakContinue struct so we know ↵Anders Carlsson2008-12-131-1/+2
| | | | | | when a break/continue won't cross a try block. llvm-svn: 60998
* Patch for ObjCIvarRefExpr containing the fieldFariborz Jahanian2008-12-131-1/+3
| | | | | | matching the storage layout for this ivar llvm-svn: 60996
* Support for implementation of property in the case whereFariborz Jahanian2008-12-091-6/+8
| | | | | | | the synthesis is in an implementation of s subclass of a super class where the property has been declared. llvm-svn: 60792
* Change condition under which 'retain'/'copy' are directly evaluated.Fariborz Jahanian2008-12-081-4/+6
| | | | llvm-svn: 60729
* Code gen for aggregate-valued properties and a test case.Fariborz Jahanian2008-11-261-4/+7
| | | | llvm-svn: 60122
* Fix 80-col violations.Daniel Dunbar2008-11-251-2/+4
| | | | llvm-svn: 60051
* Implemented ir-gen for 'implicit' properties using the new AST nodes.Fariborz Jahanian2008-11-221-12/+33
| | | | llvm-svn: 59886
* New AST node to access "implicit" setter/getter using property dor syntax.Fariborz Jahanian2008-11-221-26/+7
| | | | | | | Issuing diagnostics when assigning to read-only properties. This is work in progress. llvm-svn: 59874
* Consolidated @try and @synchronize into a singleFariborz Jahanian2008-11-211-2/+2
| | | | | | code gen. method. llvm-svn: 59767
* Rename IdentifierInfo::isName to ::isStr. Use a nifty trickChris Lattner2008-11-201-1/+1
| | | | | | | from Sebastian to enforce that a literal string is passed in, and use this to avoid having to call strlen on it. llvm-svn: 59706
* fix save-oChris Lattner2008-11-191-1/+1
| | | | llvm-svn: 59611
* simplifyChris Lattner2008-11-191-1/+1
| | | | llvm-svn: 59610
* This reworks some of the Diagnostic interfaces a bit to change how diagnosticsChris Lattner2008-11-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are formed. In particular, a diagnostic with all its strings and ranges is now packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a ton of random stuff. This has the benefit of simplifying the interface, making it more extensible, and allowing us to do more checking for things like access past the end of the various arrays passed in. In addition to introducing DiagnosticInfo, this also substantially changes how Diagnostic::Report works. Instead of being passed in all of the info required to issue a diagnostic, Report now takes only the required info (a location and ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to stuff strings and ranges into the DiagnosticInfo with the << operator. When the dtor runs on the DiagnosticInfo object (which should happen at the end of the statement), the diagnostic is actually emitted with all of the accumulated information. This is a somewhat tricky dance, but it means that the accumulated DiagnosticInfo is allowed to keep pointers to other expression temporaries without those pointers getting invalidated. This is just the minimal change to get this stuff working, but this will allow us to eliminate the zillions of variant "Diag" methods scattered throughout (e.g.) sema. For example, instead of calling: Diag(BuiltinLoc, diag::err_overload_no_match, typeNames, SourceRange(BuiltinLoc, RParenLoc)); We will soon be able to just do: Diag(BuiltinLoc, diag::err_overload_no_match) << typeNames << SourceRange(BuiltinLoc, RParenLoc)); This scales better to support arbitrary types being passed in (not just strings) in a type-safe way. Go operator overloading?! llvm-svn: 59502
* Start implementing support for @synchonized with the darwin ObjC API.Chris Lattner2008-11-151-0/+6
| | | | | | Patch by Fariborz! llvm-svn: 59377
* Rework IRgen invariant w.r.t. current insert point.Daniel Dunbar2008-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - EmitStmt is no longer required to finish with a current insertion point defined (i.e. it does not need to make dummy blocks). Instead, it can clear the insertion point in the builder which indicates that the current insertion point is unreachable. - CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint which respectively test if there is an insert point and ensure an insertion point exists (by making a dummy block). - Clearly mark functions in CodeGenFunction which can be called with no insertion point defined. Currently this is a limited set, and EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR. Remove EmitDummyBlock, which is no longer needed. Clients who haven't already cleared the insertion point (typically via EmitBranch) can do so by hand. Remove isDummyBlock, which has effectively been renamed to HaveInsertPoint. The main thrust of this change is that we no longer have create dummy blocks just to destroy them a short time later in EmitBlock in the common case that there is no unreachable code following something like a goto. Additionally, this means that we are not using the hokey condition in isDummyBlock that a block without a name is a dummy block. Guess how well that works when we never emit block names! llvm-svn: 59089
* Centralize basic block creation in CodeGenFunction::createBasicBlock.Daniel Dunbar2008-11-111-10/+9
| | | | | | - No functionality change. llvm-svn: 59017
* Add a new expression class, ObjCSuperExpr, to handle the Objective-C ↵Douglas Gregor2008-11-041-3/+1
| | | | | | 'super'. Remove ObjCThis from PredefinedExpr llvm-svn: 58698
* Debug info bug fix, function start wasn't getting generated correctlyDaniel Dunbar2008-10-181-8/+2
| | | | | | for Obj-C methods. llvm-svn: 57769
* silence release-assert warnings.Chris Lattner2008-10-121-3/+3
| | | | llvm-svn: 57392
* Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when ↵Ted Kremenek2008-10-061-3/+3
| | | | | | processing the Decl of an Objective-C foreach statement. llvm-svn: 57209
* Implement Obj-C synthesized setters for copy / retain.Daniel Dunbar2008-09-241-22/+63
| | | | llvm-svn: 56547
* Implement Obj-C getter synthesis for copy and retain.Daniel Dunbar2008-09-241-12/+56
| | | | | | Also, "simple" getter synthesis no longer uses temporary AST objects. llvm-svn: 56544
* Make sure to store the exception in the catch parameter.Anders Carlsson2008-09-111-8/+0
| | | | llvm-svn: 56102
* Make sure to emit the catch parameter as well as the catch body.Anders Carlsson2008-09-111-0/+8
| | | | llvm-svn: 56101
* Factor CodeGenFunction::StartFunction out of GenerateCode andDaniel Dunbar2008-09-091-41/+11
| | | | | | StartObjCMethod. llvm-svn: 56030
* Use a unified return block.Daniel Dunbar2008-09-091-0/+5
| | | | | | | - For the time being this means our emitted code is somewhat worse, especially for aggregates. This will be fixed. llvm-svn: 56013
* Move handling of @try and @throw to the runtime class.Anders Carlsson2008-09-091-0/+10
| | | | llvm-svn: 55983
* Change CodeGen to emit calls using (RValue,Type) list:Daniel Dunbar2008-09-091-5/+6
| | | | | | | | | | | | | | - 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
* Set function attributes (sext, zext, etc.) on Objective-C methods.Daniel Dunbar2008-09-041-0/+3
| | | | llvm-svn: 55812
* Fix infinite loop in for ... in code generation.Daniel Dunbar2008-09-041-1/+1
| | | | | | - Patch via Thomas Clement, thanks! llvm-svn: 55804
* Fix ObjCPropertRefExpr to be able to encode all the information forDaniel Dunbar2008-09-031-8/+18
| | | | | | | uses which refer to methods not properties. - Not yet wired in Sema. llvm-svn: 55681
* Handle mutation while enumerating correctly. Fix some bugs.Anders Carlsson2008-08-311-7/+48
| | | | llvm-svn: 55583
* Initial support for CodeGen of for ... in statements.Anders Carlsson2008-08-311-1/+151
| | | | llvm-svn: 55580
* Stub out CodeGenFunction::EmitObjCForCollectionStmt.Anders Carlsson2008-08-301-0/+6
| | | | | | Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it. llvm-svn: 55573
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-12/+22
| | | | | | | | | | | | | | | | | | | | | | - 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-2/+8
| | | | | | | | | | | | | | | | - 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
* Add special "property reference" CodeGen::LValue type for emittingDaniel Dunbar2008-08-291-0/+6
| | | | | | | | Objective-C property references. - This handles property references "more correctly" but setters still don't work. llvm-svn: 55534
* Initial support for Obj-C dot-syntax for getters.Daniel Dunbar2008-08-271-0/+20
| | | | llvm-svn: 55410
* Objective-C @synthesize support.Daniel Dunbar2008-08-261-4/+86
| | | | | | | | | | | - Only supports simple assignment and atomic semantics are ignored. - Not quite usable yet because the methods do not actually get added to the class metadata. - Added ObjCPropertyDecl::getSetterKind (one of Assign, Copy, Retain). - Rearrange CodeGenFunction so synthesis can reuse function prolog / epilog code. llvm-svn: 55365
* Fix Obj-C super sends inside class methods.Daniel Dunbar2008-08-251-6/+10
| | | | | | | - 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-29/+5
| | | | | | | | | | | | | | | | | | - 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
OpenPOWER on IntegriCloud