[cfe-dev] Objective-C: methods, ivars, and cleanup

David Chisnall csdavec at swansea.ac.uk
Thu Apr 3 10:39:12 PDT 2008


There were two issues with the last ObjC CodeGen patch.  This should  
address one of them (assignment to self).

I have modified CodeGenFunction so that CurFuncDecl is now a Decl (not  
a FunctionDecl) and stores either the FunctionDecl for C functions or  
the ObjCMethodDecl for Objective-C methods.  In future, it will  
presumably store method decls for C++ methods as well.  I have also  
added dyn_casts wherever it is used (only in one place, at the moment)  
to check it is the correct type.  (Note:  __func__ and friends do not  
currently work correctly for Objective-C).

I have also added a LoadObjCSelf method which returns an llvm::Value  
containing the current value of self.  This is needed because self is  
accessed from outside CodeGenFunction.

Modifying the value of self now works and both ivar accesses and  
message sends use the correct one.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc_ivar.diff
Type: application/octet-stream
Size: 4889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080403/6b8ed846/attachment.obj>
-------------- next part --------------



More information about the cfe-dev mailing list