Changeset 673 in dev
- Timestamp:
- Jun 29, 2008, 1:44:08 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/ParamImpl.cpp
r527 r673 202 202 if( !targetResultType.IsNull() ){ 203 203 //戻り値も比較対象にする 204 if( !returnType.Equals( targetResultType ) ){ 204 205 Type temp( targetResultType ); 206 ResolveFormalGenericTypeParameter( temp, leftType, &userProc ); 207 208 if( !returnType.Equals( temp ) ){ 205 209 return false; 206 210 } -
trunk/ab5.0/abdev/compiler_x86/NumOpe.cpp
r664 r673 8 8 using namespace ActiveBasic::Compiler; 9 9 10 void PushReturnValue(int type){ 10 void PushReturnValue( const Type &type ) 11 { 11 12 //関数の戻り値をスタックへプッシュする 12 13 //※この処理内では、esi、ediは使用不可 13 14 14 if(type==DEF_OBJECT || type==DEF_STRUCT){ 15 if( type.IsObject() || type.IsStruct() ) 16 { 15 17 //push eax 16 18 compiler.codeGenerator.op_push(REG_EAX); 17 19 } 18 else if(type==DEF_DOUBLE){ 20 else if( type.IsDouble() ) 21 { 19 22 //sub esp,8 20 23 compiler.codeGenerator.op_sub_esp(8); … … 23 26 compiler.codeGenerator.op_fstp_basereg( DEF_DOUBLE, REG_ESP ); 24 27 } 25 else if(type==DEF_SINGLE){ 28 else if( type.IsSingle() ) 29 { 26 30 //sub esp,4 27 31 compiler.codeGenerator.op_sub_esp(4); … … 30 34 compiler.codeGenerator.op_fstp_basereg( DEF_SINGLE, REG_ESP ); 31 35 } 32 else if(type==DEF_INT64||type==DEF_QWORD){ 36 else if( type.Is64() ) 37 { 33 38 //push edx 34 39 compiler.codeGenerator.op_push(REG_EDX); … … 37 42 compiler.codeGenerator.op_push(REG_EAX); 38 43 } 39 else if(type==DEF_LONG){ 40 //push eax 41 compiler.codeGenerator.op_push(REG_EAX); 42 } 43 else if(type==DEF_INTEGER || (compiler.IsUnicode()&&type==DEF_CHAR)){ 44 else if( type.IsInteger() || ( compiler.IsUnicode() && type.GetBasicType() == DEF_CHAR ) ) 45 { 44 46 //movsx ebx,ax 45 47 compiler.codeGenerator.op_movsx_R32R16( REG_EBX, REG_EAX ); … … 48 50 compiler.codeGenerator.op_push(REG_EBX); 49 51 } 50 else if(type==DEF_SBYTE || (compiler.IsUnicode()==false&&type==DEF_CHAR)){ 52 else if( type.IsSByte() || ( !compiler.IsUnicode() && type.GetBasicType() == DEF_CHAR ) ) 53 { 51 54 //movsx ebx,al 52 55 compiler.codeGenerator.op_movsx_R32R8( REG_EBX, REG_EAX ); … … 55 58 compiler.codeGenerator.op_push(REG_EBX); 56 59 } 57 else if( type==DEF_DWORD||type==DEF_WORD||type==DEF_BYTE||type==DEF_BOOLEAN||58 IsPtrType(type)){60 else if( type.IsLong() || type.IsDWord() || type.IsWord() || type.IsByte() || type.IsBoolean() || type.IsPointer() ) 61 { 59 62 //push eax 60 63 compiler.codeGenerator.op_push(REG_EAX); -
trunk/ab5.0/abdev/compiler_x86/Opcode.h
r603 r673 56 56 57 57 //NumOpe.cpp 58 void PushReturnValue( int type);58 void PushReturnValue( const Type &type ); 59 59 bool TermOpeOnlyVariable( const char *term, Type &resultType, RELATIVE_VAR &relativeVar, bool isWriteAccess ); 60 60 bool TermOpe( -
trunk/ab5.0/abdev/compiler_x86/OperatorProc.cpp
r465 r673 195 195 if( !pUserProc->ReturnType().IsNull() ){ 196 196 //スタックへプッシュ 197 PushReturnValue( pUserProc->ReturnType().GetBasicType());197 PushReturnValue( pUserProc->ReturnType() ); 198 198 } 199 199 … … 205 205 } 206 206 207 Type temp( pUserProc->ReturnType() ); 208 ResolveFormalGenericTypeParameter( temp, leftType, pUserProc ); 209 207 210 sp--; 208 type_stack[sp-1] =pUserProc->ReturnType().GetBasicType();209 index_stack[sp-1] =pUserProc->ReturnType().GetIndex();211 type_stack[sp-1] = temp.GetBasicType(); 212 index_stack[sp-1] = temp.GetIndex(); 210 213 211 214 if( pUserProc->ReturnType().IsStruct() )
Note:
See TracChangeset
for help on using the changeset viewer.