Changeset 666 in dev for trunk/ab5.0/abdev/compiler_x86/Compile_Func.cpp
- Timestamp:
- Jun 26, 2008, 11:02:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/compiler_x86/Compile_Func.cpp
r562 r666 14 14 if( lstrcmpi( FuncName, "AddressOf" ) == 0 ) return FUNC_ADDRESSOF; 15 15 if( lstrcmpi( FuncName, "SizeOf" ) == 0 ) return FUNC_SIZEOF; 16 if( lstrcmpi( FuncName, "__ClassSizeOf" ) == 0 ) return FUNC_CLASS_SIZEOF; 16 17 if( lstrcmpi( FuncName, "VarPtr" ) == 0 ) return FUNC_VARPTR; 17 18 if( lstrcmpi( FuncName, "ObjPtr" ) == 0 ) return FUNC_OBJPTR; … … 524 525 } 525 526 } 526 void Opcode_Func_SizeOf( const std::string &typeName ){ 527 void Opcode_Func_SizeOf( const std::string &typeName ) 528 { 527 529 Type tempType; 528 530 if( !compiler.StringToType( typeName, tempType ) ){ … … 531 533 } 532 534 535 int typeSize = tempType.GetSize(); 536 537 //mov eax,size 538 compiler.codeGenerator.op_mov_RV( REG_EAX, typeSize ); 539 } 540 void Opcode_Func_ClassSizeOf( const std::string &typeName ) 541 { 542 Type tempType; 543 if( !compiler.StringToType( typeName, tempType ) ){ 544 compiler.errorMessenger.Output(3,typeName,cp); 545 return; 546 } 547 533 548 int typeSize = ( tempType.IsObject() ) ? 534 549 tempType.GetClass().GetSize() : tempType.GetSize(); … … 752 767 resultType.SetBasicType( DEF_LONG ); 753 768 break; 769 case FUNC_CLASS_SIZEOF: 770 if( isCallOn ) Opcode_Func_ClassSizeOf(Parameter); 771 resultType.SetBasicType( DEF_LONG ); 772 break; 754 773 case FUNC_VARPTR: 755 774 Opcode_Func_VarPtr( Parameter, resultType, isCallOn );
Note:
See TracChangeset
for help on using the changeset viewer.