Changeset 562 in dev for trunk/ab5.0


Ignore:
Timestamp:
May 5, 2008, 1:47:06 PM (16 years ago)
Author:
dai_9181
Message:

CClass::GetDelegateメソッドを廃止し、代わりにMeta::ToDelegateメソッドを実装。

Location:
trunk/ab5.0/abdev
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp

    r527 r562  
    6666            // デリゲート同士の比較の場合
    6767            // ※共変戻り値及び反辺引数をサポートすること
    68             if( !varType.GetClass().GetDelegate().IsSimilar( calcType.GetClass().GetDelegate() ) )
     68            const ::Delegate *pVarDelegate = &compiler.GetObjectModule().meta.ToDelegate( varType.GetClass() );
     69            const ::Delegate *pCalcDelegate = &compiler.GetObjectModule().meta.ToDelegate( calcType.GetClass() );
     70            if( !pVarDelegate->IsSimilar( *pCalcDelegate ) )
    6971            {
    7072                // 等しいと見なされないとき
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h

    r561 r562  
    384384    }
    385385
    386     // デリゲート情報を取得
    387     const ::Delegate &GetDelegate() const;
    388 
    389386    // ユーザ指定のアラインメント固定値
    390387    int GetFixedAlignment() const
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Meta.h

    r524 r562  
    153153        return delegates;
    154154    }
     155
     156    const ::Delegate &ToDelegate( const CClass &_class );
    155157};
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp

    r561 r562  
    294294
    295295    return result;
    296 }
    297 
    298 const ::Delegate &CClass::GetDelegate() const
    299 {
    300     const ::Delegate *dg = compiler.GetObjectModule().meta.GetDelegates().GetHashArrayElement( GetName().c_str() );
    301     while( dg )
    302     {
    303         if( dg->IsEqualSymbol( GetNamespaceScopes(), GetName() ) ){
    304             //名前空間とクラス名が一致した
    305             return *dg;
    306         }
    307         dg = dg->GetChainNext();
    308     }
    309 
    310     Jenga::Throw( "CClass::GetDelegateメソッドに失敗" );
    311     static ::Delegate dummy;
    312     return dummy;
    313296}
    314297
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Meta.cpp

    r448 r562  
    163163    meta.GetDelegates().PullOutAll();
    164164}
     165
     166const ::Delegate &Meta::ToDelegate( const CClass &_class )
     167{
     168    const ::Delegate *dg = this->GetDelegates().GetHashArrayElement( _class.GetName().c_str() );
     169    while( dg )
     170    {
     171        if( dg->IsEqualSymbol( _class.GetNamespaceScopes(), _class.GetName() ) ){
     172            //名前空間とクラス名が一致した
     173            return *dg;
     174        }
     175        dg = dg->GetChainNext();
     176    }
     177
     178    throw;
     179}
  • trunk/ab5.0/abdev/compiler_x86/Compile_Func.cpp

    r537 r562  
    443443    {
    444444        // 左辺でデリゲートを要求されているとき
    445         const Delegate *pTempDelegate = &baseType.GetClass().GetDelegate();
     445        const Delegate *pTempDelegate = &compiler.GetObjectModule().meta.ToDelegate( baseType.GetClass() );
    446446        pBaseParams = &pTempDelegate->Params();
    447447        pBaseReturnType = &pTempDelegate->ReturnType();
     
    611611        }
    612612
    613         Opcode_CallDelegate( compiler.GetCompilingClass().GetDelegate(), methodPtrParamStr, objPtrValueStr, paramsStr + i );
     613        Opcode_CallDelegate( compiler.GetObjectModule().meta.ToDelegate( compiler.GetCompilingClass() ), methodPtrParamStr, objPtrValueStr, paramsStr + i );
    614614    }
    615615
Note: See TracChangeset for help on using the changeset viewer.