Ignore:
Timestamp:
Sep 24, 2008, 2:02:16 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

BOOST_FOREACHを可能なものはVC++ 2005 for eachへ置換(やや速くなる)。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common/src
Files:
14 edited

Legend:

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

    r743 r750  
    3737
    3838    extern BasicSources sourcesLinkRelationalObjectModule;
    39     BOOST_FOREACH( const BasicSource &source, sourcesLinkRelationalObjectModule )
     39    foreach( const BasicSource &source, sourcesLinkRelationalObjectModule )
    4040    {
    4141        pIncludedFilesRelation = &source.GetIncludedFilesRelation();
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp

    r551 r750  
    2828void CodeGenerator::ResolveExitSubSchedule()
    2929{
    30     BOOST_FOREACH( long exitSubCodePosition, exitSubCodePositions )
     30    foreach( long exitSubCodePosition, exitSubCodePositions )
    3131    {
    3232        pNativeCode->Overwrite( exitSubCodePosition, (long)( pNativeCode->GetSize()-(exitSubCodePosition+sizeof(long)) ) );
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp

    r745 r750  
    2424Compiler::~Compiler()
    2525{
    26     BOOST_FOREACH( ObjectModule *pStaticLibrary, staticLibraries )
     26    foreach( ObjectModule *pStaticLibrary, staticLibraries )
    2727    {
    2828        delete pStaticLibrary;
     
    3333void Compiler::PreStaticLink( const ObjectModules &staticLibraries )
    3434{
    35     BOOST_FOREACH( const ObjectModule *pStaticLibrary, staticLibraries )
     35    foreach( const ObjectModule *pStaticLibrary, staticLibraries )
    3636    {
    3737        // 関連オブジェクトモジュールの名前リスト
     
    4141void Compiler::StaticLink( ObjectModules &staticLibraries )
    4242{
    43     BOOST_FOREACH( ObjectModule *pStaticLibrary, staticLibraries )
     43    foreach( ObjectModule *pStaticLibrary, staticLibraries )
    4444    {
    4545        if( &this->GetObjectModule() == pStaticLibrary )
     
    160160        // 仮型パラメータを実型パラメータに変換
    161161        Types actualTypes;
    162         BOOST_FOREACH( const GenericType &genericType, genericTypes )
     162        foreach( const GenericType &genericType, genericTypes )
    163163        {
    164164            actualTypes.push_back( genericType.GetType() );
     
    378378                // テンプレート展開済みのクラスの場合
    379379                std::string actualGenericTypesName;
    380                 BOOST_FOREACH( const Type &typeParameter, type.GetClass().expandedClassActualTypeParameters )
     380                foreach( const Type &typeParameter, type.GetClass().expandedClassActualTypeParameters )
    381381                {
    382382                    if( actualGenericTypesName.size() )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTableGenerator.cpp

    r745 r750  
    2828    //dataTable.schedules.push_back( Schedule( Schedule::TypeInfo, &objClass, dataTableOffset + offsetForTypeInfo ) );
    2929
    30     BOOST_FOREACH( const std::string &initMemberValue, initMemberValues )
     30    foreach( const std::string &initMemberValue, initMemberValues )
    3131    {
    3232        int i = 0;
     
    207207    bool isSuccessful = true;
    208208    int i = 0;
    209     BOOST_FOREACH( const std::string &paramStr, parameters )
     209    foreach( const std::string &paramStr, parameters )
    210210    {
    211211        if( paramStr.size() == 0 )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp

    r745 r750  
    5050    void ResolveJmpFinally()
    5151    {
    52         BOOST_FOREACH( const PertialSchedule *pPertialSchedule, finallySchedules )
     52        foreach( const PertialSchedule *pPertialSchedule, finallySchedules )
    5353        {
    5454            compiler.codeGenerator.opfix_JmpPertialSchedule( pPertialSchedule );
     
    192192
    193193        int pos = 0;
    194         BOOST_FOREACH( const CatchScope &catchScope, catchScopes )
     194        foreach( const CatchScope &catchScope, catchScopes )
    195195        {
    196196            // パラメータのクラス名
     
    214214
    215215        pos = 0;
    216         BOOST_FOREACH( const CatchScope &catchScope, catchScopes )
     216        foreach( const CatchScope &catchScope, catchScopes )
    217217        {
    218218            // パラメータのクラス名
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp

    r732 r750  
    208208
    209209    bool result = true;
    210     BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){
     210    foreach( Member *pMember, objClass.GetDynamicMembers() ){
    211211        if(pMember->GetType().IsStruct()){
    212212            //循環参照でないかをチェック
     
    332332
    333333    //メソッド
    334     BOOST_FOREACH( const CMethod *pMethod, pobj_c->GetDynamicMethods() )
     334    foreach( const CMethod *pMethod, pobj_c->GetDynamicMethods() )
    335335    {
    336336        //基底クラスと重複する場合はオーバーライドを行う
     
    363363    {
    364364        // インターフェイス メソッドのオーバーライド
    365         BOOST_FOREACH( ::Interface *pInterface, pobj_c->GetInterfaces() )
     365        foreach( ::Interface *pInterface, pobj_c->GetInterfaces() )
    366366        {
    367367            if( interfaceName[0] )
     
    438438        // 型パラメータ文字列から型データを取得
    439439        Types actualTypeParameters;
    440         BOOST_FOREACH( const std::string &typeParameterStr, typeParameterStrings )
     440        foreach( const std::string &typeParameterStr, typeParameterStrings )
    441441        {
    442442            Type type;
     
    517517{
    518518    // まずは継承されたインターフェイスを実装する
    519     BOOST_FOREACH( ::Interface *pInheritsInterface, pInterface->GetClass().GetInterfaces() )
     519    foreach( ::Interface *pInheritsInterface, pInterface->GetClass().GetInterfaces() )
    520520    {
    521521        // TODO: actualTypeParametersの引渡し
     
    532532    // 基底クラスのメソッドからインターフェイスメソッドを再実装する
    533533    /////////////////////////////////////////////////////////////////
    534     BOOST_FOREACH( CMethod *pMethod, _class.GetDynamicMethods() )
     534    foreach( CMethod *pMethod, _class.GetDynamicMethods() )
    535535    {
    536536        DynamicMethod *pMethodForOverride = pInterface->GetDynamicMethods().FindForOverride( pInterface->GetActualTypeParameters(), &pMethod->GetUserProc() );
     
    612612    SplitParameter( interfaceNames, paramStrs );
    613613   
    614     BOOST_FOREACH( const std::string &paramStr, paramStrs )
     614    foreach( const std::string &paramStr, paramStrs )
    615615    {
    616616        char className[VN_SIZE];
     
    619619
    620620        Types actualTypeParameters;
    621         BOOST_FOREACH( const std::string &typeParameterStr, typeParameterStrings )
     621        foreach( const std::string &typeParameterStr, typeParameterStrings )
    622622        {
    623623            Type type;
     
    821821                // 型パラメータ文字列から型データを取得
    822822                Types actualTypeParameters;
    823                 BOOST_FOREACH( const std::string &typeParameterStr, typeParameterStrings )
     823                foreach( const std::string &typeParameterStr, typeParameterStrings )
    824824                {
    825825                    Type type;
     
    13891389
    13901390    // パラメータのジェネリック型を解決
    1391     BOOST_FOREACH( const Parameter *pParam, pBaseMethod->GetUserProc().Params() )
     1391    foreach( const Parameter *pParam, pBaseMethod->GetUserProc().Params() )
    13921392    {
    13931393        Type type = pParam->IsTypeParameter()
     
    13981398        pUserProc->GetParameters().push_back( new Parameter( *pParam, type ) );
    13991399    }
    1400     BOOST_FOREACH( const Parameter *pParam, pBaseMethod->GetUserProc().RealParams() )
     1400    foreach( const Parameter *pParam, pBaseMethod->GetUserProc().RealParams() )
    14011401    {
    14021402        Type type = pParam->IsTypeParameter()
     
    14401440    // 実型パラメータに値型が含まれないとき
    14411441    bool isValueType = false;
    1442     BOOST_FOREACH( const Type &actualType, actualTypes )
     1442    foreach( const Type &actualType, actualTypes )
    14431443    {
    14441444        if( actualType.IsValueType() )
     
    14531453
    14541454    // 展開済みのクラスがあればそれを返す
    1455     BOOST_FOREACH( const ExpandedTemplateClass *pExpandedTemplateClass, _class.expandedTemplateClasses )
     1455    foreach( const ExpandedTemplateClass *pExpandedTemplateClass, _class.expandedTemplateClasses )
    14561456    {
    14571457        if( pExpandedTemplateClass->GetActualTypes().IsEquals( actualTypes ) )
     
    14871487    {
    14881488        Types expandedSuperClassActualTypes;
    1489         BOOST_FOREACH( const Type &superClassActualType, _class.GetSuperClassActualTypeParameters() )
     1489        foreach( const Type &superClassActualType, _class.GetSuperClassActualTypeParameters() )
    14901490        {
    14911491            expandedSuperClassActualTypes.push_back( TemplateExpand_ResolveType( superClassActualType, actualTypes ) );
     
    14971497
    14981498    // インターフェイスのジェネリック型を解決
    1499     BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
     1499    foreach( const ::Interface *pInterface, _class.GetInterfaces() )
    15001500    {
    15011501        const CClass *pExpandedInterfaceClass = TemplateExpand( *const_cast<CClass *>(&pInterface->GetClass()), actualTypes );
     
    15041504
    15051505        // インターフェイス メソッドのジェネリック型を解決
    1506         BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() )
     1506        foreach( const CMethod *pMethod, pInterface->GetDynamicMethods() )
    15071507        {
    15081508            if( pMethod->GetUserProc().GetParentClassPtr() == &_class )
     
    15331533
    15341534    // メンバのジェネリック型を解決
    1535     BOOST_FOREACH( const Member *pMember, _class.GetDynamicMembers() )
     1535    foreach( const Member *pMember, _class.GetDynamicMembers() )
    15361536    {
    15371537        Type type = pMember->GetType();
     
    15491549
    15501550    // クラス メソッドのジェネリック型を解決
    1551     BOOST_FOREACH( const CMethod *pMethod, _class.GetDynamicMethods() )
     1551    foreach( const CMethod *pMethod, _class.GetDynamicMethods() )
    15521552    {
    15531553        if( pMethod->GetUserProc().GetParentClassPtr() == &_class )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp

    r735 r750  
    144144            std::string namespaceScopesCommandStr;
    145145            std::string endNamespaceScopesCommandStr;
    146             BOOST_FOREACH( const std::string &namespaceStr, dg.GetNamespaceScopes() )
     146            foreach( const std::string &namespaceStr, dg.GetNamespaceScopes() )
    147147            {
    148148                if( namespaceScopesCommandStr.size() )
     
    205205        LexicalAnalyzer::ExtractParameterVarNames( dg.GetParamStr().c_str(), paramVarNames, dg.GetSourceIndex() );
    206206        std::string tempParamStrForCall;
    207         BOOST_FOREACH( const std::string &varName, paramVarNames )
     207        foreach( const std::string &varName, paramVarNames )
    208208        {
    209209            if( !tempParamStrForCall.empty() )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Enum.cpp

    r715 r750  
    160160    buffer.reserve(65536);
    161161
    162     BOOST_FOREACH( const EnumInfo &enumInfo, enums )
     162    foreach( const EnumInfo &enumInfo, enums )
    163163    {
    164         BOOST_FOREACH( const std::string &namespaceStr, enumInfo.GetNamespaceScopes() ){
     164        foreach( const std::string &namespaceStr, enumInfo.GetNamespaceScopes() ){
    165165            buffer.append("Namespace ").append(namespaceStr) += '\n';
    166166        }
     
    179179        buffer.append("\tEnd Sub\n");
    180180
    181         BOOST_FOREACH( const EnumMember &member, enumInfo.GetMembers() )
     181        foreach( const EnumMember &member, enumInfo.GetMembers() )
    182182        {
    183183            buffer.append("\tStatic ")
     
    190190        buffer.append("End Class\n");
    191191
    192         BOOST_FOREACH( const std::string &namespaceStr, enumInfo.GetNamespaceScopes() ){
     192        foreach( const std::string &namespaceStr, enumInfo.GetNamespaceScopes() ){
    193193            buffer.append("End Namespace\n");
    194194        }
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp

    r710 r750  
    120120
    121121    //パラメータ
    122     BOOST_FOREACH( const std::string &paramStr, parameterStrings )
     122    foreach( const std::string &paramStr, parameterStrings )
    123123    {
    124124        int i = 0;
     
    384384
    385385    //パラメータをコピー
    386     BOOST_FOREACH( Parameter *pParam, userProc.GetParameters() ){
     386    foreach( Parameter *pParam, userProc.GetParameters() ){
    387387        userProc.RealParams().push_back( new Parameter( *pParam ) );
    388388    }
     
    733733    {
    734734        ::Interface *pTargetInterface = NULL;
    735         BOOST_FOREACH( ::Interface *pInterface, pobj_c->GetInterfaces() )
     735        foreach( ::Interface *pInterface, pobj_c->GetInterfaces() )
    736736        {
    737737            if( pInterface->GetClass().GetName() == interfaceName )
     
    855855
    856856    // パラメータのエラーチェック
    857     BOOST_FOREACH( const Parameter *pParam, pDllProc->Params() ){
     857    foreach( const Parameter *pParam, pDllProc->Params() ){
    858858        if( pParam->IsObject() ){
    859859            compiler.errorMessenger.Output(25,pParam->GetVarName(),nowLine);
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalScope.cpp

    r677 r750  
    2323}
    2424void LexicalScope::RunScheduleOfBreak(){
    25     BOOST_FOREACH( const PertialSchedule *pBreakPertialSchedule, breakPertialSchedules )
     25    foreach( const PertialSchedule *pBreakPertialSchedule, breakPertialSchedules )
    2626    {
    2727        compiler.codeGenerator.opfix_JmpPertialSchedule( pBreakPertialSchedule );
     
    7676
    7777    //使用済みローカル変数の生存チェックを外す
    78     BOOST_FOREACH( Variable *pVar, (*pVars) )
     78    foreach( Variable *pVar, (*pVars) )
    7979    {
    8080        if( pVar->isLiving && pVar->GetScopeLevel() == level )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp

    r587 r750  
    77void Linker::ResolveDataTableSchedules( long dataSectionBaseOffset )
    88{
    9     BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
     9    foreach( const Schedule &schedule, nativeCode.GetSchedules() )
    1010    {
    1111        if( schedule.GetType() == Schedule::DataTable )
     
    1818    }
    1919
    20     BOOST_FOREACH( const Schedule &schedule, dataTable.schedules )
     20    foreach( const Schedule &schedule, dataTable.schedules )
    2121    {
    2222        if( schedule.GetType() == Schedule::DataTable )
     
    4040void Linker::ResolveCatchAddressSchedules( long codeSectionBaseOffset )
    4141{
    42     BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
     42    foreach( const Schedule &schedule, nativeCode.GetSchedules() )
    4343    {
    4444        if( schedule.GetType() == Schedule::CatchAddress )
     
    5555    }
    5656
    57     BOOST_FOREACH( const Schedule &schedule, dataTable.schedules )
     57    foreach( const Schedule &schedule, dataTable.schedules )
    5858    {
    5959        if( schedule.GetType() == Schedule::CatchAddress )
     
    8181void Linker::ResolveDllProcSchedules( long codeSectionBaseOffset, long importSectionBaseOffset, long lookupSize, long hintSize )
    8282{
    83     BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
     83    foreach( const Schedule &schedule, nativeCode.GetSchedules() )
    8484    {
    8585        if( schedule.GetType() == Schedule::DllProc )
     
    105105void Linker::ResolveUserProcSchedules( long codeSectionBaseOffset )
    106106{
    107     BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
     107    foreach( const Schedule &schedule, nativeCode.GetSchedules() )
    108108    {
    109109        if( schedule.GetType() == Schedule::UserProc
     
    139139    int allInitVarSize = compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize();
    140140
    141     BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
     141    foreach( const Schedule &schedule, nativeCode.GetSchedules() )
    142142    {
    143143        if( schedule.GetType() == Schedule::GlobalVar )
     
    163163void Linker::ResolveVtblSchedule( long dataSectionBaseOffset )
    164164{
    165     BOOST_FOREACH( const Schedule &schedule, nativeCode.GetSchedules() )
     165    foreach( const Schedule &schedule, nativeCode.GetSchedules() )
    166166    {
    167167        if( schedule.GetType() == Schedule::ComVtbl )
     
    186186    }
    187187
    188     BOOST_FOREACH( const Schedule &schedule, dataTable.schedules )
     188    foreach( const Schedule &schedule, dataTable.schedules )
    189189    {
    190190        if( schedule.GetType() == Schedule::ComVtbl )
     
    226226void Linker::ResolveTypeInfoSchedule( long dataSectionBaseOffset )
    227227{
    228     BOOST_FOREACH( const Schedule &schedule, dataTable.schedules )
     228    foreach( const Schedule &schedule, dataTable.schedules )
    229229    {
    230230        if( schedule.GetType() == Schedule::TypeInfo )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp

    r719 r750  
    409409{
    410410    int count = 0;
    411     BOOST_FOREACH( const ErrorInfo &errorInfo, errorInfos )
     411    foreach( const ErrorInfo &errorInfo, errorInfos )
    412412    {
    413413        if( !errorInfo.IsWarning() )
     
    425425{
    426426    int count = 0;
    427     BOOST_FOREACH( const ErrorInfo &errorInfo, errorInfos )
     427    foreach( const ErrorInfo &errorInfo, errorInfos )
    428428    {
    429429        if( errorInfo.IsWarning() )
     
    438438{
    439439    const ErrorInfo *pErrorInfo = NULL;
    440     BOOST_FOREACH( const ErrorInfo &errorInfo, errorInfos )
     440    foreach( const ErrorInfo &errorInfo, errorInfos )
    441441    {
    442442        if( errorInfo.GetErrorLineNum() == errorLineNum )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp

    r637 r750  
    4747
    4848        int i=0;
    49         BOOST_FOREACH( Member *member, objClass.GetStaticMembers() )
     49        foreach( Member *member, objClass.GetStaticMembers() )
    5050        {
    5151            if( pEnumInfo )
     
    122122    std::string result;
    123123
    124     BOOST_FOREACH( const Member *pMember, _class.GetDynamicMembers() )
     124    foreach( const Member *pMember, _class.GetDynamicMembers() )
    125125    {
    126126        if( result.size() )
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/VtblGenerator.cpp

    r632 r750  
    99    //関数テーブルに値をセット
    1010    int i2 = 0;
    11     BOOST_FOREACH( const CMethod *pMethod, methods )
     11    foreach( const CMethod *pMethod, methods )
    1212    {
    1313        if(pMethod->IsVirtual()){
     
    6666
    6767    // インターフェイスのvtblを生成
    68     BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
     68    foreach( const ::Interface *pInterface, _class.GetInterfaces() )
    6969    {
    7070        int tempVtblOffset = GenerateVTablePart( pInterface->GetDynamicMethods() );
     
    100100
    101101        // テンプレート展開されたクラスも
    102         BOOST_FOREACH( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, pClass->expandedTemplateClasses )
     102        foreach( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, pClass->expandedTemplateClasses )
    103103        {
    104104            if( !pExpandedTemplateClass->GetClass().expandedTemplateClasses.empty() )
     
    149149
    150150    // インターフェイスのvtbl
    151     BOOST_FOREACH( const ::Interface *pInterface, _class.GetInterfaces() )
     151    foreach( const ::Interface *pInterface, _class.GetInterfaces() )
    152152    {
    153153        LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().dataTable.GetPtr() + pInterface->GetVtblOffset());
     
    184184
    185185        // テンプレート展開されたクラスも
    186         BOOST_FOREACH( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, pClass->expandedTemplateClasses )
     186        foreach( ActiveBasic::Common::Lexical::ExpandedTemplateClass *pExpandedTemplateClass, pClass->expandedTemplateClasses )
    187187        {
    188188            if( !pExpandedTemplateClass->GetClass().expandedTemplateClasses.empty() )
Note: See TracChangeset for help on using the changeset viewer.