[LLVMdev] DIFactory

Renato Golin rengolin at systemcall.org
Fri Jul 16 06:22:24 PDT 2010


On 14 July 2010 22:21, Devang Patel <devang.patel at gmail.com> wrote:
>> I understand that the objects are lightweight, thus the ability to
>> pass them as objects, but some casting could be allowed, especially to
>> DIDescriptor (copy ctor? new and assignment operators?).
>
> If it helps then go ahead add them.

Hi Devang,

I've managed to make it work, so I can pass all sorts of DI* objects
when a DIDescriptor is required, but now I also have to do the other
way round and cast them back to DI*. This is getting a bit too ugly...

Is there any strong reason to re-invent polymorphism here?

The fact that the objects are light is not a reason, just an enabling
fact. And they might grow bigger in the future, so there must be a
strong underlying reason not to use pointers as IRBuilder does... But
I can't figure it out... ;)

-- 
cheers,
--renato

http://systemcall.org/

Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm



More information about the llvm-dev mailing list