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.

Attachment: objc_ivar.diff
Description: Binary data


_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to