Re: Inlining problems again

2014-04-05 Thread Iain Buclaw
On 5 April 2014 20:38, Iain Buclaw wrote: > On 5 Apr 2014 21:31, "Iain Buclaw" wrote: >> >> On 5 Apr 2014 19:55, "Johannes Pfau" wrote: >> > >> > Am Sun, 6 Apr 2014 02:51:28 +1000 >> > schrieb "Daniel Murphy" : >> > >> > > "Johannes Pfau" wrote in message >> > > news:lhp8h4$2j38$1...@digitalmar

Re: Inlining problems again

2014-04-05 Thread Iain Buclaw
On 5 Apr 2014 21:31, "Iain Buclaw" wrote: > > On 5 Apr 2014 19:55, "Johannes Pfau" wrote: > > > > Am Sun, 6 Apr 2014 02:51:28 +1000 > > schrieb "Daniel Murphy" : > > > > > "Johannes Pfau" wrote in message > > > news:lhp8h4$2j38$1...@digitalmars.com... > > > > > > > But we'd want this to work/inl

Re: Inlining problems again

2014-04-05 Thread Iain Buclaw
On 5 Apr 2014 19:55, "Johannes Pfau" wrote: > > Am Sun, 6 Apr 2014 02:51:28 +1000 > schrieb "Daniel Murphy" : > > > "Johannes Pfau" wrote in message > > news:lhp8h4$2j38$1...@digitalmars.com... > > > > > But we'd want this to work/inline nevertheless, right?: > > > > > > void test(co

Re: Inlining problems again

2014-04-05 Thread Johannes Pfau
Am Sun, 6 Apr 2014 02:51:28 +1000 schrieb "Daniel Murphy" : > "Johannes Pfau" wrote in message > news:lhp8h4$2j38$1...@digitalmars.com... > > > But we'd want this to work/inline nevertheless, right?: > > > > void test(const(char)[] a) > > { > > } > > > > char[] abc; > > test(abc); >

Re: Inlining problems again

2014-04-05 Thread Daniel Murphy
"Johannes Pfau" wrote in message news:lhp8h4$2j38$1...@digitalmars.com... But we'd want this to work/inline nevertheless, right?: void test(const(char)[] a) { } char[] abc; test(abc); Then we still need to tell GCC that const(char)[] is a variant of char[] or it won'

Re: Inlining problems again

2014-04-05 Thread Johannes Pfau
Am Sat, 5 Apr 2014 15:31:30 +0100 schrieb Iain Buclaw : > On 5 Apr 2014 13:45, "Johannes Pfau" wrote: > > > > 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 t

Re: Inlining problems again

2014-04-05 Thread Johannes Pfau
Am Sat, 5 Apr 2014 15:31:30 +0100 schrieb Iain Buclaw : > > I've had another thought for a while now that involves not > constifying 'in' parameters, but at the same time not loosing its > guarantee. > But we'd want this to work/inline nevertheless, right?: void test(const(char)[]

Re: Inlining problems again

2014-04-05 Thread Iain Buclaw
On 5 Apr 2014 13:45, "Johannes Pfau" wrote: > > Am Sat, 5 Apr 2014 07:37:00 +0100 > schrieb Iain Buclaw : > > > > 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 a

Re: Inlining problems again

2014-04-05 Thread Johannes Pfau
Am Sat, 5 Apr 2014 07:37:00 +0100 schrieb Iain Buclaw : > > 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 o

Re: Inlining problems again

2014-04-04 Thread Iain Buclaw
On 4 April 2014 14:42, Artur Skawina wrote: > On 04/04/14 15:14, Johannes Pfau wrote: >> Am Fri, 04 Apr 2014 11:52:13 +0200 >> schrieb Artur Skawina : >> >>> Built latest gcc4-8-based gdc (fdf0c614) today; immediately ran into >>> this: >>> >>> Which is much more reasonable, and shouldn't require

Re: Inlining problems again

2014-04-04 Thread Iain Buclaw
On 4 April 2014 14:42, Artur Skawina wrote: > On 04/04/14 15:14, Johannes Pfau wrote: >> Am Fri, 04 Apr 2014 11:52:13 +0200 >> schrieb Artur Skawina : >> >>> Built latest gcc4-8-based gdc (fdf0c614) today; immediately ran into >>> this: >>> >>> Which is much more reasonable, and shouldn't require

Re: Inlining problems again

2014-04-04 Thread Artur Skawina
On 04/04/14 15:42, Artur Skawina wrote: > On 04/04/14 15:14, Johannes Pfau wrote: >> Am Fri, 04 Apr 2014 11:52:13 +0200 >> schrieb Artur Skawina : >> >>> Built latest gcc4-8-based gdc (fdf0c614) today; immediately ran into >>> this: >>> >>> Which is much more reasonable, and shouldn't require such

Re: Inlining problems again

2014-04-04 Thread Artur Skawina
On 04/04/14 15:14, Johannes Pfau wrote: > Am Fri, 04 Apr 2014 11:52:13 +0200 > schrieb Artur Skawina : > >> Built latest gcc4-8-based gdc (fdf0c614) today; immediately ran into >> this: >> >> Which is much more reasonable, and shouldn't require such hacks. >> I thought that inlining /templated/ fu

Re: Inlining problems again

2014-04-04 Thread Johannes Pfau
Am Fri, 04 Apr 2014 11:52:13 +0200 schrieb Artur Skawina : > Built latest gcc4-8-based gdc (fdf0c614) today; immediately ran into > this: > > Which is much more reasonable, and shouldn't require such hacks. > I thought that inlining /templated/ functions across modules already > worked; is this a