Changeset 40 in dev for BasicCompiler64/Compile_ProcOp.cpp
- Timestamp:
- Jan 28, 2007, 3:48:22 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/Compile_ProcOp.cpp
r34 r40 461 461 else temp=psi->name; 462 462 463 if(psi->ReturnType==DEF_OBJECT ){463 if(psi->ReturnType==DEF_OBJECT && psi->isReturnRef == false){ 464 464 //戻り値用オブジェクトのコンストラクタを呼び出す 465 465 if(psi->u.Return_pobj_c->ConstructorMemberSubIndex!=-1){ … … 470 470 else{ 471 471 //戻り値用の変数の定義 472 sprintf(temporary,"%s%c%c",temp,1,ESC_AS); 472 if( psi->isReturnRef ){ 473 sprintf(temporary,"%c%c",1,ESC_BYREF); 474 } 475 else temporary[0]=0; 476 477 sprintf(temporary+lstrlen(temporary),"%s%c%c",temp,1,ESC_AS); 473 478 GetTypeName(psi->ReturnType,psi->u.ReturnIndex,temporary+lstrlen(temporary)); 479 474 480 OpcodeDim(temporary,0); 475 481 } … … 568 574 else offset=0; 569 575 for(i3=0;i3<pobj_CompilingClass->iMemberNum;i3++){ 576 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3]; 570 577 MemberTypeSize= 571 GetTypeSize(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type,572 p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.lpIndex);578 GetTypeSize(pMember->TypeInfo.type, 579 pMember->TypeInfo.u.lpIndex); 573 580 574 581 MemberObjectNum= 575 JumpSubScripts(p obj_CompilingClass->ppobj_Member[i3]->SubScripts);576 577 offset=GetSizeOfClassMember(pobj_CompilingClass,p obj_CompilingClass->ppobj_Member[i3]->name,NULL);578 579 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type==DEF_OBJECT){580 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){581 i5=p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex;582 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる582 JumpSubScripts(pMember->SubScripts); 583 584 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL); 585 586 if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){ 587 if(pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex!=-1){ 588 i5=pMember->TypeInfo.u.pobj_Class->ConstructorMemberSubIndex; 589 if(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi->RealParmNum==1){ //Thisポインタを第一引数に持ち合わせるため、引数なしの場合はこの値が1になる 583 590 for(i4=0;i4<MemberObjectNum;i4++){ 584 591 //Thisポインタをrcxにコピー … … 589 596 590 597 //call constructor 591 op_call(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);598 op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi); 592 599 } 593 600 } … … 672 679 int MemberObjectNum; 673 680 for(i3=pobj_CompilingClass->iMemberNum-1;i3>=0;i3--){ 681 CMember *pMember = pobj_CompilingClass->ppobj_Member[i3]; 674 682 MemberTypeSize= 675 GetTypeSize(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type,676 p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.lpIndex);683 GetTypeSize(pMember->TypeInfo.type, 684 pMember->TypeInfo.u.lpIndex); 677 685 678 686 MemberObjectNum= 679 JumpSubScripts(p obj_CompilingClass->ppobj_Member[i3]->SubScripts);680 681 offset=GetSizeOfClassMember(pobj_CompilingClass,p obj_CompilingClass->ppobj_Member[i3]->name,NULL);682 683 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.type==DEF_OBJECT){684 if(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){687 JumpSubScripts(pMember->SubScripts); 688 689 offset=GetSizeOfClassMember(pobj_CompilingClass,pMember->name,NULL); 690 691 if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){ 692 if(pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex!=-1){ 685 693 for(i4=MemberObjectNum-1;i4>=0;i4--){ 686 694 //Thisポインタをrcxにコピー … … 691 699 692 700 //call destructor 693 i5=p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->DestructorMemberSubIndex;694 op_call(p obj_CompilingClass->ppobj_Member[i3]->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi);701 i5=pMember->TypeInfo.u.pobj_Class->DestructorMemberSubIndex; 702 op_call(pMember->TypeInfo.u.pobj_Class->ppobj_Method[i5]->psi); 695 703 } 696 704 }
Note:
See TracChangeset
for help on using the changeset viewer.