Changing "target" parameter via attribute

Iain Buclaw ibuclaw at ubuntu.com
Mon May 27 04:40:12 PDT 2013


Well it is in...

https://github.com/D-Programming-GDC/GDC/commit/15907b95026d451f443b4b6d263c85e0524e517e


As for testing:
---
{
  @attribute("target", T)  void func(string T)() { }

  func!"sse.4.1";
}
---

Error: undefined identifier T.


Looks like the frontend rejects this - will find out whether this is a
bug or intentional...


--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';



On 27 May 2013 12:17, Manu <turkeyman at gmail.com> wrote:
> For MinGW? I've never successfully managed to build that bloody thing! ;)
>
>
> On 27 May 2013 21:08, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
>>
>> On 27 May 2013 11:47, Manu <turkeyman at gmail.com> wrote:
>> > By 'it', you mean supporting @target? Or handling specific targets +
>> > mangling?
>> >
>> > I still need to be able to do something like '@attribute("target", T)
>> > void
>> > func(string T)()', or maybe '@target(T) void func(string T)()' one way
>> > or
>> > another. The template argument would be responsible for the appropriate
>> > mangling in this case.
>> > The reason is to be compatible with the DMD/LDC solutions, which would
>> > also
>> > use template selection.f
>> >
>> > The part I don't know is if T, a template argument to the function, can
>> > be
>> > used in the attribute declaration? This is critical.
>> >
>> >
>>
>> If it's a string constant, then answer should be yes.... can you pull
>> gdc head and re-compile to test?
>>
>> --
>> Iain Buclaw
>>
>> *(p < e ? p++ : p) = (c & 0x0f) + '0';
>
>


More information about the D.gnu mailing list