Ignore:
Timestamp:
May 5, 2008, 12:26:44 PM (16 years ago)
Author:
dai_9181
Message:

VtblGeneratorクラスを追加。Classes/CClassクラスのvtbl生成関連の実装をVtblGeneratorクラスに移動した。

File:
1 edited

Legend:

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

    r558 r559  
    3636{
    3737    // 静的メソッドがコピーコンストラトされることは想定しない
    38     compiler.errorMessenger.OutputFatalError();
     38    throw;
    3939}
    4040
     
    144144    return count;
    145145}
    146 
    147 void Methods::GenerateVTablePart( long &vtableDataTableOffset ) const
    148 {
    149     const UserProc **ppsi = (const UserProc **)malloc(GetVtblNum()*sizeof(UserProc *));
    150 
    151     //関数テーブルに値をセット
    152     int i2 = 0;
    153     const Methods &methods = *this;
    154     BOOST_FOREACH( const CMethod *pMethod, methods ){
    155         if(pMethod->IsVirtual()){
    156             if( !pMethod->GetUserProc().IsUsing() )
    157             {
    158                 //ts((char *)pMethod->GetUserProc().GetFullName().c_str());
    159             }
    160             pMethod->GetUserProc().Using();
    161 
    162             if(pMethod->IsAbstract()){
    163                 compiler.errorMessenger.OutputFatalError();
    164 
    165                 ppsi[i2]=0;
    166             }
    167             else{
    168                 ppsi[i2]=&pMethod->GetUserProc();
    169             }
    170             i2++;
    171         }
    172     }
    173 
    174     vtableDataTableOffset = compiler.GetObjectModule().dataTable.AddBinary( (void *)ppsi, GetVtblNum()*sizeof(LONG_PTR) );
    175 
    176     for( int i=0; i < GetVtblNum(); i++ ){
    177         pobj_Reloc->AddSchedule_DataSection(static_cast<DWORD>(vtableDataTableOffset+i*sizeof(LONG_PTR)));
    178     }
    179 
    180     free(ppsi);
    181 }
Note: See TracChangeset for help on using the changeset viewer.