Changeset 350 in dev for trunk/abdev/BasicCompiler64
- Timestamp:
- Oct 14, 2007, 9:41:03 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler64
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/BasicCompiler.vcproj
r345 r350 795 795 > 796 796 <File 797 RelativePath=".\Compile_Interface.cpp"798 >799 <FileConfiguration800 Name="Debug|Win32"801 >802 <Tool803 Name="VCCLCompilerTool"804 UsePrecompiledHeader="2"805 />806 </FileConfiguration>807 <FileConfiguration808 Name="Release|Win32"809 >810 <Tool811 Name="VCCLCompilerTool"812 UsePrecompiledHeader="2"813 />814 </FileConfiguration>815 </File>816 <File817 797 RelativePath=".\Compile_Object.cpp" 818 798 > -
trunk/abdev/BasicCompiler64/Compile_CallProc.cpp
r349 r350 164 164 ///////////////////////////////// 165 165 pMethod = NULL; 166 if( ! isStatic ) pMethod = pobj_c->GetDynamicMethodO fInterfaceMethod( pUserProc );166 if( ! isStatic ) pMethod = pobj_c->GetDynamicMethodOrInterfaceMethod( pUserProc ); 167 167 if( ! pMethod ){ 168 168 //動的メソッドが取得できなかったときは静的メソッドを当たる -
trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp
r331 r350 179 179 UserProc::CompileStartForUserProc( pBackUserProc ); 180 180 cp=BackCp; 181 } 182 else if( userProc.HasParentClass() 183 && userProc.IsCastOperator() 184 && userProc.ReturnType().IsInterface() ) 185 { 186 // インターフェイス型にキャストするためのメソッド 187 188 int vtblMasterListIndex = userProc.GetParentClass().GetVtblMasterListIndex( &userProc.ReturnType().GetClass() ); 189 190 char temporary[1024]; 191 sprintf( temporary, 192 "Return New %s(ObjPtr( This ),Get_LONG_PTR( (Get_LONG_PTR( ObjPtr(This) ) + SizeOf(LONG_PTR)*%d) As VoidPtr ) As VoidPtr )", 193 userProc.ReturnType().GetClass().GetName().c_str(), 194 vtblMasterListIndex 195 ); 196 MakeMiddleCode( temporary ); 197 198 ChangeOpcode( temporary ); 181 199 } 182 200 else{ -
trunk/abdev/BasicCompiler64/Compile_Var.cpp
r339 r350 1226 1226 } 1227 1227 1228 //コンストラクタ呼び出し 1229 if( type.IsObject() &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){ 1228 //New呼び出し 1229 if( type.IsObject() 1230 && !type.IsInterface() 1231 &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0 1232 &&InitBuf[0]=='\0') 1233 { 1230 1234 char objectSize[255]; 1231 1235 if( subscripts.size() == 0 ){ -
trunk/abdev/BasicCompiler64/NumOpe.cpp
r347 r350 233 233 GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType); 234 234 235 objClass.EnumDynamicMethodsO fInterfaceMethods( methodName, userProcs );235 objClass.EnumDynamicMethodsOrInterfaceMethods( methodName, userProcs ); 236 236 if(userProcs.size()){ 237 237 //オーバーロードを解決 … … 751 751 752 752 753 if( strstr(expression,"xxxxx")) 754 { 755 int test=0; 756 } 753 757 754 758 //////////////////////////////// … … 789 793 // ダウンキャストを許可する 790 794 } 791 else if( idCalc == CALC_AS792 && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST ) && ((CClass *)index_stack[sp-1])->IsInterface()793 ){794 // インターフェイスへのキャスト795 // TODO: 実装796 CastToInterface( pobj_reg->GetLockingReg(), REG_R15, *(CClass *)index_stack[sp-2], *(CClass *)index_stack[sp-1] );797 }798 795 else{ 799 796 //オーバーロードされたオペレータを呼び出す … … 853 850 || term[0] == '\"' ) 854 851 { 855 if( baseType.IsObject() || baseType.IsNull() )852 if( !baseType.IsPointer() ) 856 853 { 857 854 //要求タイプがオブジェクト、または未定のとき -
trunk/abdev/BasicCompiler64/Opcode.h
r339 r350 245 245 void SetReg_WholeVariable( const Type &type, RELATIVE_VAR *pRelativeVar,int reg); 246 246 247 //Compile_Interface.cpp248 bool CastToInterface( int reg, int vtblReg, const CClass &baseClass, const CClass &interfaceClass );249 250 247 //Compile_Object.cpp 251 248 void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter,const Type &baseTypeInfo ); -
trunk/abdev/BasicCompiler64/OperatorProc.cpp
r345 r350 33 33 } 34 34 35 int CallOperatorProc(BYTE idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp){ 35 int CallOperatorProc(BYTE idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp) 36 { 37 Type leftType( type_stack[sp-2], index_stack[sp-2] ); 38 Type rightType( type_stack[sp-1] & (~FLAG_CAST), index_stack[sp-1] ); 39 36 40 //オーバーロードされたオペレータ関数を呼び出す 37 CClass *pobj_c; 38 pobj_c=(CClass *)index_stack[sp-2]; 41 const CClass *pobj_c = &leftType.GetClass(); 39 42 40 43 std::vector<const UserProc *> subs; … … 56 59 Parameters params; 57 60 58 if(bTwoTerm){ 59 params.push_back( new Parameter( "", Type( type_stack[sp-1], index_stack[sp-1] ) ) ); 61 if(bTwoTerm) 62 { 63 params.push_back( new Parameter( "", rightType ) ); 60 64 } 61 65 … … 94 98 } 95 99 96 int right_side_size = Type(type_stack[sp-1],index_stack[sp-1]).GetSize();100 int right_side_size = rightType.GetSize(); 97 101 98 102 if(bTwoTerm){
Note:
See TracChangeset
for help on using the changeset viewer.