Ignore:
Timestamp:
Jul 21, 2008, 2:31:24 PM (16 years ago)
Author:
dai_9181
Message:

[702]を64bit版にマージ。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/compiler_x64/Compile_ProcOp.cpp

    r685 r704  
    445445            compiler.GetCompilingClass().NotifyStartConstructorCompile();
    446446
    447             //基底クラスかどうかの識別
    448             //(継承元がインターフェイスの場合も基底クラスと見なす)
    449             BOOL bThisIsSuperClass;
    450             if( !compiler.GetCompilingClass().HasSuperClass() ) bThisIsSuperClass=1;
    451             else if( compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod() == NULL ){
    452                 //インターフェイスを継承したときはコンストラクタを持たない
    453                 bThisIsSuperClass=1;
    454             }
    455             else bThisIsSuperClass=0;
    456 
    457             if(!bThisIsSuperClass){
     447            if( compiler.GetCompilingClass().HasSuperClass() )
     448            {
    458449                /* サブクラスコンストラクタをコンパイルしているときは、
    459450                    基底クラスのコンストラクタを呼び出す */
     
    483474                    RemoveStringPare(temporary);
    484475
    485                     Type dummyType;
    486                     CallProc( PROC_DEFAULT
    487                         , &compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc()
    488                         , compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc().GetName().c_str()
    489                         , temporary
    490                         , Type()        // baseTypeはなし
    491                         , dummyType
    492                     );
     476
     477                    ////////////////////////
     478                    // オーバーロードを解決
     479                    ////////////////////////
     480
     481                    std::vector<const UserProc *> subs;
     482                    compiler.GetCompilingClass().GetSuperClass().GetDynamicMethods().Enum( compiler.GetCompilingClass().GetSuperClass().GetName().c_str(), subs );
     483
     484                    const UserProc *pUserProc = NULL;
     485                    if( subs.size() > 0 )
     486                    {
     487                        //オーバーロードを解決
     488                        pUserProc=OverloadSolutionWithStrParam(  compiler.GetCompilingClass().GetSuperClass().GetName().c_str(),
     489                            subs,temporary,"");
     490                    }
     491                    if( !pUserProc )
     492                    {
     493                        compiler.errorMessenger.Output(1,NULL,cp);
     494                    }
     495                    else
     496                    {
     497                        Type dummyType;
     498                        CallProc( PROC_DEFAULT
     499                            , pUserProc
     500                            , pUserProc->GetName().c_str()
     501                            , temporary
     502                            , Type()        // baseTypeはなし
     503                            , dummyType
     504                            , true
     505                            , PROCFLAG_PERMIT_CONSTRUCTOR
     506                        );
     507                    }
    493508                }
    494509                else{
    495                     //基底クラスのコンストラクタを暗黙的に呼び出す
    496                     Opcode_CallProc("",
    497                         &compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc(),
    498                         0,
    499                         "");
     510                    if( compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod() != NULL )
     511                    {
     512                        // 基底クラスがデフォルトコンストラクタを保有するとき
     513
     514                        // 基底クラスのコンストラクタを暗黙的に呼び出す
     515                        Opcode_CallProc("",
     516                            &compiler.GetCompilingClass().GetSuperClass().GetConstructorMethod()->GetUserProc(),
     517                            PROCFLAG_PERMIT_CONSTRUCTOR,
     518                            ""
     519                        );
     520                    }
    500521                }
    501522            }
     
    555576                    Opcode_CallProc("",
    556577                        &method->GetUserProc(),
    557                         0,
     578                        PROCFLAG_PERMIT_DESTRUCTOR,
    558579                        "");
    559580                }
Note: See TracChangeset for help on using the changeset viewer.