Changeset 73 in dev for BasicCompiler32/Compile_ProcOp.cpp
- Timestamp:
- Mar 16, 2007, 11:07:14 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_ProcOp.cpp
r64 r73 214 214 } 215 215 216 void CompileBufferInProcedure(S UBINFO*psi){216 void CompileBufferInProcedure(SubInfo *psi){ 217 217 extern char *basbuf; 218 218 extern HANDLE hHeap; 219 extern S UBINFO**ppSubHash;219 extern SubInfo **ppSubHash; 220 220 extern BOOL bDebugCompile; 221 221 int i3,i4,VarSize,LocalVarSchedule,EspOffsetSchedule,BufferSize,BaseOffset; … … 280 280 281 281 //パラメータ用の変数データを考慮 282 for(i3=psi->RealParmNum-1;i3>=0;i3--){ 282 for(i3=psi->realParams.size()-1;i3>=0;i3--){ 283 Parameter ¶m = *psi->realParams[i3]; 284 283 285 //変数データを追加 284 286 LocalVar=(VARIABLE *)HeapReAlloc(hHeap,0,LocalVar,(MaxLocalVarNum+1)*sizeof(VARIABLE)); 285 287 286 lstrcpy( LocalVar[MaxLocalVarNum].name,psi->pRealParmInfo[i3].name);288 lstrcpy( LocalVar[MaxLocalVarNum].name,param.GetVarName().c_str() ); 287 289 288 290 // TODO: パラメータのConst定義の指定が未完成 289 291 LocalVar[MaxLocalVarNum].bConst=false; 290 292 291 LocalVar[MaxLocalVarNum].bArray=p si->pRealParmInfo[i3].bArray;292 memcpy(LocalVar[MaxLocalVarNum].SubScripts,p si->pRealParmInfo[i3].SubScripts,MAX_ARRAYDIM*sizeof(int));293 294 LocalVar[MaxLocalVarNum].type=p si->pRealParmInfo[i3].type;293 LocalVar[MaxLocalVarNum].bArray=param.IsArray()?TRUE:FALSE; 294 memcpy(LocalVar[MaxLocalVarNum].SubScripts,param.GetSubScriptsPtr(),MAX_ARRAYDIM*sizeof(int)); 295 296 LocalVar[MaxLocalVarNum].type=param.GetBasicType(); 295 297 if(LocalVar[MaxLocalVarNum].type==DEF_OBJECT 296 298 ||LocalVar[MaxLocalVarNum].type==DEF_STRUCT){ … … 299 301 } 300 302 301 LocalVar[MaxLocalVarNum].u.index=p si->pRealParmInfo[i3].u.index;302 303 if( psi->pRealParmInfo[i3].bByVal&&psi->pRealParmInfo[i3].type==DEF_STRUCT){303 LocalVar[MaxLocalVarNum].u.index=param.GetIndex(); 304 305 if( param.IsRef() == false && param.IsStruct() ){ 304 306 //構造体のByValパラメータ 305 307 LocalVar[MaxLocalVarNum].fRef=REF_PARAMETER | OBJECT_PARAMETER; … … 307 309 } 308 310 else{ 309 if( psi->pRealParmInfo[i3].bByVal&&psi->pRealParmInfo[i3].bArray==0){311 if( param.IsRef() == false && param.IsArray() == false ){ 310 312 LocalVar[MaxLocalVarNum].fRef=0; 311 313 VarSize=GetTypeSize(LocalVar[MaxLocalVarNum].type,LocalVar[MaxLocalVarNum].u.index); … … 344 346 345 347 //コンパイル中の関数 346 extern S UBINFO*pCompilingSubInfo;348 extern SubInfo *pCompilingSubInfo; 347 349 pCompilingSubInfo=psi; 348 350 … … 442 444 443 445 //call _DebugSys_StartProc 444 extern S UBINFO*pSub_DebugSys_StartProc;446 extern SubInfo *pSub_DebugSys_StartProc; 445 447 op_call(pSub_DebugSys_StartProc); 446 448 } … … 684 686 685 687 //call _DebugSys_EndProc 686 extern S UBINFO*pSub_DebugSys_EndProc;688 extern SubInfo *pSub_DebugSys_EndProc; 687 689 op_call(pSub_DebugSys_EndProc); 688 690 } … … 806 808 807 809 //call _esp_error 808 extern S UBINFO*pSub_esp_error;810 extern SubInfo *pSub_esp_error; 809 811 op_call( pSub_esp_error ); 810 812 … … 840 842 } 841 843 void CompileLocal(){ 842 extern S UBINFO**ppSubHash;844 extern SubInfo **ppSubHash; 843 845 int i2; 844 S UBINFO*psi;846 SubInfo *psi; 845 847 846 848 extern BOOL bDll; … … 856 858 //_System_InitStaticLocalVariablesは一番最後にコンパイル 857 859 //※一般関数内の静的変数オブジェクトをすべて収集しなければならない 858 extern S UBINFO*pSub_System_InitStaticLocalVariables;860 extern SubInfo *pSub_System_InitStaticLocalVariables; 859 861 pSub_System_InitStaticLocalVariables->bCompile=1; 860 862 861 863 //_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル 862 extern S UBINFO*pSub_System_Call_Destructor_of_GlobalObject;864 extern SubInfo *pSub_System_Call_Destructor_of_GlobalObject; 863 865 pSub_System_Call_Destructor_of_GlobalObject->bCompile=1; 864 866
Note:
See TracChangeset
for help on using the changeset viewer.