Inlining problems again

Iain Buclaw ibuclaw at gdcproject.org
Sat Apr 5 07:31:30 PDT 2014


On 5 Apr 2014 13:45, "Johannes Pfau" <nospam at example.com> wrote:
>
> Am Sat, 5 Apr 2014 07:37:00 +0100
> schrieb Iain Buclaw <ibuclaw at gdcproject.org>:
> >
> > Reason for no inline is "mismatched arguments" - which means that the
> > caller and callee disagree on the arguments to pass to the function.
> > The fix is to make sure that caller and callee arguments match when
> > generating the function on both sides.  We could prevent this from
> > recurring by putting in an assert in the codegen.
>
> Root cause is that const(char)[] is a distinct type compared to char[]
> so I think we need to make const(char)[] a variant of char[].
>
> We could use build_variant_type_copy and then modify the copy
> to use the correct basetype. Here's a proof of concept, could you finish
> this Iain?
>
> (We should probably check all types which have a 'next' type if a
> similar change makes sense for these)
>

I've had another thought for a while now that involves not constifying 'in'
parameters, but at the same time not loosing its guarantee.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20140405/a0d3017a/attachment.html>


More information about the D.gnu mailing list