DMDFE - where retStyle() is defined ?

Walter Bright newshound at digitalmars.com
Sat Mar 24 20:53:38 PDT 2007


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;
> }



More information about the Digitalmars-d mailing list