Hi Everyone,

I've started working on Objective-C code generation. The attached diff contains my initial work. I've added a few hooks into the code generation code for handling the Objective-C AST nodes.

I've created a CodeGenObjCRuntime abstract class which encapsulates the runtime-specific components and a CodeGenObjCGNU concrete subclass for the GNU runtime. Currently, this only handles message sends (and assumes an id return type, which needs fixing later). It's also completely unoptimised as yet, and does slightly silly things like look up the selector every message send, rather than caching it after the first lookup (I'm not sure if this should be done here or if a later pass should know that sel_get_uid is a constant function and do the caching as an optimisation).

I am trying to keep the CodeGenObjC* classes free from clang-specific classes because I intend to use them with a Smalltalk and Self compiler (which won't use the clang AST representations) as well.

David

P.S. I've not used C++ for almost five years and not looked at the llvm/clang sources before Sunday, so I expect lots of comments.

Attachment: clang.diff
Description: Binary data

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

Reply via email to