DMDFE - where retStyle() is defined ?

Ary Manzana ary at esperanto.org.ar
Sat Mar 24 21:34:20 PDT 2007


Walter Bright escribió:
> Carlos Smith wrote:
>> Hi,
>>
>> I am trying to bring DMDFE 0.173 to the 1.009 level.
>>
>> The last thing missing to allow the production
>> of an exe is an undefined reference to a function retStyle().
> -------------------------------------------------------------
> 
>> /***************************
>>  * Determine return style of function.
>>  */
>>
>> enum RET TypeFunction::retStyle()
>> {
>>     /* For C++ and Pascal, structs and reals are on the stack.
>>        For C, reals and 1,2,4 byte structs are return in registers,
>>        others are returned in a static.
>>      */
>>     //printf("TypeFunction::retStyle() %s\n", toChars());
>>     Type *tn = next->toBasetype();
>>
>>     if (tn->ty == Tstruct)
>>     {
>>         if (global.params.isLinux && linkage != LINKd)
>>             ;
>>         else
>>         {
>>             switch ((int)tn->size())
>>             {   case 1:
>>                 case 2:
>>                 case 4:
>>                 case 8:
>>                     return RETregs;     // return small structs in regs
>>                                         // (not 3 byte structs!)
>>                 default:
>>                     break;
>>             }
>>         }
>>         return RETstack;
>>     }
>>     else if (global.params.isLinux &&
>>              linkage == LINKc &&
>>              tn->iscomplex())
>>     {
>>         if (tn->ty == Tcomplex32)
>>             return RETregs;     // in EDX:EAX, not ST1:ST0
>>         else
>>             return RETstack;
>>     }
>>     else
>>         return RETregs;
>> }

Thanks, I need that for Descent (for the moment I used a stub function 
and thought I didn't search well). May I also ask why is this code 
missing? Maybe it's part of the backend?

I'd also like to know what a Symbol (not Dsymbol) is, and wether I'll 
need it to point out semantic errors.

Thanks,
Ary



More information about the Digitalmars-d mailing list