enable @restrict for slices?

kinke noone at nowhere.com
Tue Sep 13 19:39:44 UTC 2022


On Tuesday, 13 September 2022 at 18:56:10 UTC, Bruce Carneal 
wrote:
> Currently applying an @restrict attribute to a slice argument 
> results in something like this from ldc:
>
> ```d
> Attribute 'noalias' applied to incompatible type! i16 ({ i64, 
> i16* })* ...
> ```
>
>
> Might this be upgraded to match gdc's current behavior on 
> godbolt? (allow @restrict for both pointers and slices)  I 
> don't see a downside apart from the, hopefully modest, work 
> required to get it in place.

Yeah that would definitely be nice. - I guess this would require 
passing slices as 2 separate arguments in LLVM IR, which probably 
messes with a bunch of assumptions of a 1:1 mapping of D params 
to IR params - so probably not *that* simple.


More information about the digitalmars-d-ldc mailing list