Changeset 89 in dev for BasicCompiler64/Compile_ProcOp.cpp


Ignore:
Timestamp:
Apr 4, 2007, 2:03:09 AM (17 years ago)
Author:
dai_9181
Message:

実行時型情報の生成に対応。
関数の戻り値の型に抽象クラスを指定できるようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/Compile_ProcOp.cpp

    r86 r89  
    195195        obp+=31;
    196196    }
    197     else if( userProc.GetName() == "InitializeUserTypes" ){
     197    else if( userProc.GetName() == "InitializeUserTypes"
     198        && userProc.HasParentClass()
     199        && (string)userProc.GetParentClass().name == "_System_TypeBase" ){
     200
     201            pobj_DBClass->Compile_System_InitializeUserTypes();
    198202    }
    199203    else{
     
    233237    pUserProc->beginOpAddress=obp;
    234238
     239    //コンパイル中の関数が属するクラス
     240    pobj_CompilingClass=pUserProc->GetParentClassPtr();
     241
     242    //コンパイルスタートをクラス管理クラスに追加
     243    pobj_DBClass->StartCompile( pUserProc );
     244
     245    //コンパイル中の関数
     246    UserProc::CompileStartForUserProc( pUserProc );
     247
    235248    if(pUserProc->IsSystem()){
    236249        ////////////////////
     
    351364    extern int LocalVar_ThisPtrOffset;
    352365    LocalVar_ThisPtrOffset=AllLocalVarSize;
    353 
    354     //コンパイル中の関数が属するクラス
    355     pobj_CompilingClass=pUserProc->GetParentClassPtr();
    356 
    357     //コンパイルスタートをクラス管理クラスに追加
    358     pobj_DBClass->StartCompile( pUserProc );
    359 
    360     //コンパイル中の関数
    361     UserProc::CompileStartForUserProc( pUserProc );
    362366
    363367    //スタックフレーム管理用クラスを初期化
     
    446450        }
    447451        else{
    448             //戻り値用の変数の定義
    449             sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
     452            if( pUserProc->ReturnType().IsObject() ){
     453                sprintf(temporary,"%s=Nothing%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
     454            }
     455            else{
     456                //戻り値用の変数の定義
     457                sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
     458            }
    450459
    451460            OpcodeDim(temporary,0);
     
    520529                    RemoveStringPare(temporary);
    521530
    522                     Opcode_CallProc(temporary,
    523                         pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc,
    524                         0,
    525                         "",
    526                         0);
     531                    Type dummyType;
     532                    CallProc( PROC_DEFAULT
     533                        , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc
     534                        , pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str()
     535                        , temporary
     536                        , dummyType );
    527537                }
    528538                else{
Note: See TracChangeset for help on using the changeset viewer.