Commit Graph

48 Commits

Author SHA1 Message Date
Steve Naroff 66afeb5968 Some "prep" work for handling ObjC @-string constants that contain UTF-8. No 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
2009-03-31 16:53:37 +00:00
Chris Lattner d480892445 pull "runtime globals" into the same framework as other functions/global variables.
No intended functionality change.

llvm-svn: 67478
2009-03-22 21:03:39 +00:00
Fariborz Jahanian bac73acc24 Obscure code gen bug related to sending
message to 'super' in a class method declared in
cateogy (darwin specific).

llvm-svn: 65709
2009-02-28 20:07:56 +00:00
Fariborz Jahanian 21fc74c15a Some refactoring of Ivar offset code gen.
in preparation for nonfragile ivar offset work.

llvm-svn: 64225
2009-02-10 19:02:04 +00:00
Fariborz Jahanian 712bfa6478 ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).
llvm-svn: 63644
2009-02-03 19:03:09 +00:00
Fariborz Jahanian c88a70d885 objc2's ir-gen for nonfragile ivar access.
llvm-svn: 63578
2009-02-03 00:09:52 +00:00
Fariborz Jahanian 9f84b78ac1 Refactored code gen for ivar access in preparation for
objc2 nonfragile ivar access code gen.

llvm-svn: 63541
2009-02-02 20:02:29 +00:00
Fariborz Jahanian b15a3d5969 Use NonFragileABI as name of new Next abi. More comments
for the new meta-data.

llvm-svn: 62806
2009-01-22 23:02:58 +00:00
Fariborz Jahanian 279eda6275 Refactoring ObjC Next's runtime classes in preparation for
the new ObjC's abi.

llvm-svn: 62721
2009-01-21 22:04:16 +00:00
Fariborz Jahanian 0196a1cd2b This patch fixes the code gen failures which was a fallout from
not merging protocol properties into the classes which
use those protocols. With this patch, all my exceutable
test pass again.

llvm-svn: 62030
2009-01-10 21:06:09 +00:00
Nate Begeman f2a6e5f0c0 Remove tabs.
llvm-svn: 61097
2008-12-16 19:57:09 +00:00
Fariborz Jahanian c2ad6dc3b4 Consolidated @try and @synchronize into a single
code gen. method.

llvm-svn: 59767
2008-11-21 00:49:24 +00:00
Fariborz Jahanian e881b536e8 Introducing objc_assign_ivar to clang.
llvm-svn: 59740
2008-11-20 19:23:36 +00:00
Fariborz Jahanian d7db964495 Generate strong write barriers for __strong objects.
Also, took care of Daniel's commments.

llvm-svn: 59575
2008-11-19 00:59:10 +00:00
Fariborz Jahanian 83f45b55f8 Patch for generation of weak write barriers for objc
__weak objects.

llvm-svn: 59560
2008-11-18 22:37:34 +00:00
Fariborz Jahanian f5125d19e7 Generate objc_read_weak for __weak objc loads.
llvm-svn: 59553
2008-11-18 21:45:40 +00:00
Chris Lattner e132e2432a Start implementing support for @synchonized with the darwin ObjC API.
Patch by Fariborz!

llvm-svn: 59377
2008-11-15 21:26:17 +00:00
Daniel Dunbar cb4638599c Move IRBuilder type definition to common file.
- No functionality change.

llvm-svn: 58546
2008-11-01 01:53:16 +00:00
Daniel Dunbar a91c3e097f Add Obj-C runtime methods to get runtime specific functions for
implementing property access.

llvm-svn: 56542
2008-09-24 03:38:44 +00:00
Anders Carlsson 1963b0c38f Move handling of @try and @throw to the runtime class.
llvm-svn: 55983
2008-09-09 10:04:29 +00:00
Daniel Dunbar 41cf9dedc6 Change CodeGen to emit calls using (RValue,Type) list:
- 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
2008-09-09 01:06:48 +00:00
Anders Carlsson 3f35a266da Handle mutation while enumerating correctly. Fix some bugs.
llvm-svn: 55583
2008-08-31 04:05:03 +00:00
Daniel Dunbar 4b8c6db927 Add Objective-C property setter support.
- 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
2008-08-30 05:35:15 +00:00
Daniel Dunbar c722b8565c Refactor handling of calls:
- 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
2008-08-30 03:02:31 +00:00
Daniel Dunbar ca8531a2d7 Fix Obj-C super sends inside class methods.
- NeXT loads the super class at runtime; this required changing the
   runtime interface to pass more information down.

llvm-svn: 55307
2008-08-25 08:19:24 +00:00
Daniel Dunbar 97db84ce6d Trim CGObjCRuntime::GenerateMessageSend[Super]
- 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
2008-08-23 03:46:30 +00:00
Daniel Dunbar 7c6d3a7c50 Change ObjCRuntime::LookupClass -> GetClass, and now takes the
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
2008-08-16 00:25:02 +00:00
Daniel Dunbar 9299250939 Change CGObjCRuntime methods to take appropriate clang Decls.
- 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
2008-08-15 22:20:32 +00:00
Daniel Dunbar 89da6ad1db Change ObjCRuntime GenerateProtocol[Ref] methods to take
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
2008-08-13 00:59:25 +00:00
Daniel Dunbar 5d71559c01 Drop Sender from GenerateMessageSend*
- Was unused and generated a unnecessary load of self

Update NeXT runtime to get proper object & selector types from
       ASTContext.

llvm-svn: 54667
2008-08-12 05:28:47 +00:00
Daniel Dunbar 6630e10ccc Protocol related tweaks
- Implement type conversion of ObjCQualifiedIdType
 - Wire @protocol(...) to GenerateProtocolRef in ScalarExprEmitter

llvm-svn: 54666
2008-08-12 05:08:18 +00:00
Daniel Dunbar 8b8683f9f6 Add ObjC constant string support for NeXT.
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
2008-08-12 00:12:39 +00:00
Daniel Dunbar 48595de697 Update for IRBuilder template change (update LLVM!)
llvm-svn: 54642
2008-08-11 16:50:21 +00:00
Daniel Dunbar 221fa94e40 More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation

llvm-svn: 54627
2008-08-11 04:54:23 +00:00
Daniel Dunbar 303e2c2f1f Add dummy Mac Objective-C runtime interface.
- Not currently accessible and completely non-functional.

llvm-svn: 54624
2008-08-11 02:45:11 +00:00
Chris Lattner c893a67fe3 update to make IRBuilder API change.
llvm-svn: 54548
2008-08-08 19:57:58 +00:00
Chris Lattner bf231a61fd refactor more objc codegen interfaces to pass around selectors so
we don't push strings into LLVM IR and then have to read them back out.

llvm-svn: 52765
2008-06-26 05:08:00 +00:00
Chris Lattner d9b98863c4 remove the old getSelector implementation, which removes some
calls to getStringValue

llvm-svn: 52761
2008-06-26 04:44:19 +00:00
Chris Lattner 6cfec78e48 avoid a lot of unneeded selector processing work by passing around
selectors instead of Value*'s.

llvm-svn: 52760
2008-06-26 04:42:20 +00:00
Chris Lattner 9a05d04a0d use cheaper/simpler getselector call for @selector exprs.
llvm-svn: 52759
2008-06-26 04:38:58 +00:00
Chris Lattner 6d522c0133 start avoid doing lots of unneeded work handling selectors
llvm-svn: 52758
2008-06-26 04:37:12 +00:00
Chris Lattner 42587147d4 improve indentation, avoid thrashing on maps and recalculating strings as much.
llvm-svn: 52757
2008-06-26 04:24:57 +00:00
Chris Lattner 87ab27d42f give CreateObjCRuntime a full CGM so it can get whatever state it needs,
instead of passing in just a couple random things it currently 
happens to use.

llvm-svn: 52756
2008-06-26 04:19:03 +00:00
Argyrios Kyrtzidis 28172cb812 Include <string> header to allow compiling for MSVC.
llvm-svn: 51847
2008-06-01 21:23:24 +00:00
Anton Korobeynikov 1200aca763 Support for code generation of Objective-C top-level language constructs.
Implemented by David Chisnall!

llvm-svn: 51835
2008-06-01 14:13:53 +00:00
Chris Lattner 61705c1a6e update to follow mainline llvm API change.
llvm-svn: 49607
2008-04-13 07:32:11 +00:00
Chris Lattner 4bd5596d08 Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!

llvm-svn: 48969
2008-03-30 23:03:07 +00:00
Chris Lattner 7a51313d8a Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.

llvm-svn: 48402
2008-03-15 23:59:48 +00:00