Changeset 91 in dev for BasicCompiler_Common/Class.cpp


Ignore:
Timestamp:
Apr 7, 2007, 10:07:26 PM (17 years ago)
Author:
dai_9181
Message:

ログ機構(Smoothie::Logger)を導入。
動的型情報生成において、未使用クラスの登録は行わないようにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Class.cpp

    r90 r91  
    150150    DestructorMemberSubIndex( 0 ),
    151151    classType( Class ),
     152    isUsing( false ),
    152153    pobj_InheritsClass( NULL ),
    153154    ppobj_Member( NULL ),
     
    192193        delete method;
    193194    }
     195}
     196
     197bool CClass::IsUsing() const
     198{
     199    return isUsing;
     200}
     201void CClass::Using(){
     202    isUsing = true;
    194203}
    195204
     
    15091518
    15101519    while( Iterator_HasNext() ){
    1511         CClass *pClass = Iterator_GetNext();
     1520        const CClass &objClass = *Iterator_GetNext();
     1521
     1522        if( !objClass.IsUsing() ){
     1523            // 未使用のクラスは無視する
     1524            continue;
     1525        }
    15121526
    15131527        sprintf( temporary
     
    15161530            , ESC_NEW
    15171531            , ""                // 名前空間 (TODO: 実装)
    1518             , pClass->name      // クラス名
     1532            , objClass.name     // クラス名
    15191533            );
    15201534
     
    15431557
    15441558    while( Iterator_HasNext() ){
    1545         CClass *pClass = Iterator_GetNext();
    1546 
    1547         if( pClass->pobj_InheritsClass ){
     1559        const CClass &objClass = *Iterator_GetNext();
     1560
     1561        if( !objClass.IsUsing() ){
     1562            // 未使用のクラスは無視する
     1563            continue;
     1564        }
     1565
     1566        if( objClass.pobj_InheritsClass ){
    15481567            sprintf( temporary
    15491568                , "tempType=Search(\"%s\",\"%s\")"
    15501569                , ""                // 名前空間 (TODO: 実装)
    1551                 , pClass->name      // クラス名
     1570                , objClass.name     // クラス名
    15521571                );
    15531572
     
    15581577                , "tempType.SetBaseType(Search(\"%s\",\"%s\"))"
    15591578                , ""                                // 名前空間 (TODO: 実装)
    1560                 , pClass->pobj_InheritsClass->name  // 基底クラス名
     1579                , objClass.pobj_InheritsClass->name // 基底クラス名
    15611580                );
    15621581
     
    16191638    pCompilingClass = pUserProc->GetParentClassPtr();
    16201639    if( pCompilingClass ){
     1640        pCompilingClass->Using();
     1641
    16211642        pCompilingMethod = pCompilingClass->GetMethodInfo( pUserProc );
    16221643        if( !pCompilingMethod ){
Note: See TracChangeset for help on using the changeset viewer.