digitalmars.D - DMDFE - where retStyle() is defined ?
- Carlos Smith (14/14) Mar 24 2007 Hi,
- Walter Bright (2/53) Mar 24 2007
- Carlos Smith (8/9) Mar 24 2007 Hey Walter,
- Walter Bright (2/16) Mar 24 2007 It's part of the back end, not the front end.
- Ary Manzana (8/61) Mar 24 2007 Thanks, I need that for Descent (for the moment I used a stub function
- Walter Bright (2/4) Mar 24 2007 It's a backend symbol.
- Ary Manzana (4/9) Mar 24 2007 Will I do find without it to point out semantic errors?
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(). That function is declared in mtype.h within the struct TypeFunction, but is not defined anywhere. The declaration is also present in the version 0.173 but is not used anywhere. It is used by func.c in version 1.009. Where is defined that function ? I grepped every thing in the distribution and i did not found it.
Mar 24 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; }
Mar 24 2007
"Walter Bright" <newshound digitalmars.com> wroteenum RET TypeFunction::retStyle() { ... }Hey Walter, Many thanks for the fast response. Just updated mtype.c with this code, and every think linked Ok ! So dmdfe.exe now display V 1.009. Now, may i politely ask why the dmd-1.009 source code did not have it ?
Mar 24 2007
Carlos Smith wrote:"Walter Bright" <newshound digitalmars.com> wroteIt's part of the back end, not the front end.enum RET TypeFunction::retStyle() { ... }Hey Walter, Many thanks for the fast response. Just updated mtype.c with this code, and every think linked Ok ! So dmdfe.exe now display V 1.009. Now, may i politely ask why the dmd-1.009 source code did not have it ?
Mar 24 2007
Walter Bright escribió:Carlos Smith wrote: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, AryHi, 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; }
Mar 24 2007
Ary Manzana wrote:I'd also like to know what a Symbol (not Dsymbol) is, and wether I'll need it to point out semantic errors.It's a backend symbol.
Mar 24 2007
Walter Bright escribió:Ary Manzana wrote:Will I do find without it to point out semantic errors? Thanks, AryI'd also like to know what a Symbol (not Dsymbol) is, and wether I'll need it to point out semantic errors.It's a backend symbol.
Mar 24 2007