Changeset 334 in dev for trunk/abdev/BasicCompiler32/Compile_Func.cpp
- Timestamp:
- Sep 28, 2007, 12:05:10 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Func.cpp
r332 r334 296 296 userProc.Using(); 297 297 } 298 void Opcode_CreateSimpleDelegate( const char *methodInstanceName, const UserProc &userProc )298 void Opcode_CreateSimpleDelegate( const CClass &dgClass, const char *methodInstanceName, const UserProc &userProc ) 299 299 { 300 300 ///////////////////////////////////////////////////////////////// … … 339 339 compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE ); 340 340 341 //push this341 //push eax 342 342 compiler.codeGenerator.op_push( REG_EAX ); 343 343 … … 347 347 ///////////////////////////////////////////////////////////////// 348 348 349 std::vector<const UserProc *> subs; 350 dgClass.GetStaticMethods().Enum( "_CreateDelegate", subs ); 351 349 352 // call _System_CreateSimpleDynamicDelegate 350 extern const UserProc *pSub_System_CreateSimpleDynamicDelegate; 351 compiler.codeGenerator.op_call( pSub_System_CreateSimpleDynamicDelegate ); 353 compiler.codeGenerator.op_call( subs[0] ); 352 354 } 353 355 void Opcode_Func_AddressOf( const char *name, const Type &baseType, bool isCallOn, Type &resultType ){ … … 356 358 357 359 const Parameters *pBaseParams = NULL; 358 bool isDelegate = false;359 360 if( baseType.IsProcPtr() ) 360 361 { … … 362 363 pBaseParams = &compiler.GetObjectModule().meta.GetProcPointers()[baseType.GetIndex()]->Params(); 363 364 } 364 else if( baseType.IsObject() && baseType.GetClass().GetName() == "_SimpleDelegate" ) 365 { 366 extern const Delegate *pConstructingDelegate; 367 if( !pConstructingDelegate ) 368 { 369 SetError(); 370 } 365 else if( baseType.IsDelegate() ) 366 { 371 367 // 左辺でデリゲートを要求されているとき 372 pBaseParams = &pConstructingDelegate->Params(); 373 374 isDelegate = true; 368 pBaseParams = &baseType.GetClass().GetDelegate().Params(); 375 369 } 376 370 … … 402 396 } 403 397 404 if( isDelegate)398 if( baseType.IsDelegate() ) 405 399 { 406 400 if( isCallOn ) 407 401 { 408 402 // デリゲートのとき 409 Opcode_CreateSimpleDelegate( name, *pUserProc );403 Opcode_CreateSimpleDelegate( baseType.GetClass(), name, *pUserProc ); 410 404 } 411 405 resultType = baseType;
Note:
See TracChangeset
for help on using the changeset viewer.