Changeset 116 in dev for BasicCompiler64


Ignore:
Timestamp:
May 12, 2007, 4:34:39 PM (17 years ago)
Author:
dai_9181
Message:

暗黙的なアップキャストを可能にした

Location:
BasicCompiler64
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_Calc.cpp

    r75 r116  
    215215
    216216    if( calcType.IsObject() && !calcType.Equals( varType ) ){
    217         //キャスト演算子のオーバーロードに対応する
    218         CallCastOperatorProc(REG_RAX,calcType,bCalcUseHeap,varType);
     217        bool isUpCast = false;
     218        if( varType.IsObject() ){
     219            if( varType.GetClass().IsEqualsOrSubClass( &calcType.GetClass() ) ){
     220                isUpCast = true;
     221            }
     222        }
     223        if( !isUpCast ){
     224            //キャスト演算子のオーバーロードに対応する
     225            CallCastOperatorProc(REG_RAX,calcType,bCalcUseHeap,varType);
     226        }
    219227    }
    220228
  • BasicCompiler64/Compile_Var.cpp

    r107 r116  
    537537                CClass::RefType refType;
    538538                GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
     539            }
     540
     541            int typeDefIndex = Smoothie::Meta::typeDefs.GetIndex( VarName );
     542            if( typeDefIndex != -1 ){
     543                // TypeDef後の型名だったとき
     544                lstrcpy( VarName, Smoothie::Meta::typeDefs[typeDefIndex].GetBaseName().c_str() );
    539545            }
    540546
Note: See TracChangeset for help on using the changeset viewer.