Changeset 803 in dev for branches/egtra/ab5.0/abdev/BasicCompiler_Common
- Timestamp:
- Feb 11, 2011, 10:05:14 PM (14 years ago)
- Location:
- branches/egtra/ab5.0/abdev/BasicCompiler_Common
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/egtra/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
r798 r803 276 276 UserProc *GetSubFromObp(ULONG_PTR pos) 277 277 { 278 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 279 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 278 foreach (auto pUserProc, compiler.GetObjectModule().meta.GetUserProcs()) 280 279 { 281 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext();282 283 280 if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pos && 284 281 pos < rva_to_real(pUserProc->GetEndOpAddress())) -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/Diagnose.cpp
r750 r803 34 34 int codeSizeOfGlobalProc = 0; 35 35 int codeSizeOfClassMethod = 0; 36 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 37 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 36 foreach (auto pUserProc, compiler.GetObjectModule().meta.GetUserProcs()) 38 37 { 39 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext();40 38 if( pUserProc->IsCompiled() ){ 41 39 if( pUserProc->HasParentClass() ){ … … 60 58 int codeSizeOfEnum = 0; 61 59 62 // イテレータをリセット 63 compiler.GetObjectModule().meta.GetClasses().Iterator_Reset(); 64 65 while( compiler.GetObjectModule().meta.GetClasses().Iterator_HasNext() ){ 60 foreach (auto pClass, compiler.GetObjectModule().meta.GetClasses()) 61 { 66 62 int codeSizeOfClass = 0; 67 63 68 CClass &objClass = * compiler.GetObjectModule().meta.GetClasses().Iterator_GetNext();64 CClass &objClass = *pClass; 69 65 70 66 if( !objClass.IsEnum() ){ … … 99 95 /////////////////////////////////////////////////////////////////// 100 96 101 // イテレータをリセット 102 compiler.GetObjectModule().meta.GetClasses().Iterator_Reset(); 103 104 while( compiler.GetObjectModule().meta.GetClasses().Iterator_HasNext() ){ 97 foreach (auto pClass, compiler.GetObjectModule().meta.GetClasses()) 98 { 105 99 int codeSizeOfClass = 0; 106 100 107 CClass &objClass = * compiler.GetObjectModule().meta.GetClasses().Iterator_GetNext();101 CClass &objClass = *pClass; 108 102 109 103 // 動的メソッド -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp
r751 r803 319 319 320 320 bool IsNeedProcCompile(){ 321 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 322 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 323 { 324 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext(); 321 foreach (auto pUserProc, compiler.GetObjectModule().meta.GetUserProcs()) 322 { 325 323 if( pUserProc->IsUsing() && pUserProc->IsCompiled() == false ){ 326 324 return true; … … 385 383 386 384 repeat: 387 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 388 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 389 { 390 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext(); 385 foreach (auto pUserProc, compiler.GetObjectModule().meta.GetUserProcs()) 386 { 391 387 CompileBufferInProcedure( *pUserProc ); 392 388 } … … 410 406 //プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合 411 407 412 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 413 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 408 foreach(auto pUserProc, compiler.GetObjectModule().meta.GetUserProcs()) 414 409 { 415 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext();416 410 CompileBufferInProcedure( *pUserProc ); 417 411 } -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r763 r803 1 1 #include "stdafx.h" 2 2 3 #include <boost/range/algorithm.hpp> 3 4 #include <Compiler.h> 4 5 … … 411 412 if(pobj_dti->lplpSpBase[i2]==0) return; 412 413 413 UserProc *pUserProc = NULL; 414 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 415 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 414 auto const& t = compiler.GetObjectModule().meta.GetUserProcs(); 415 auto it = boost::find_if<boost::return_found>(t, [&](UserProc *pUserProc) -> bool { 416 return rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] && 417 pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress()); 418 }); 419 if (it == boost::end(t)) 416 420 { 417 pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext(); 418 if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] && 419 pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress())){ 420 break; 421 } 422 } 423 if(!pUserProc) return; 421 return; 422 } 423 UserProc *pUserProc = *it; 424 424 425 425 foreach( Variable *pVar, pUserProc->GetLocalVars() ){ … … 696 696 //プロシージャ コンボボックス 697 697 SendMessage(hProcCombo,CB_RESETCONTENT,0,0); 698 for(i2=pobj_dti->iProcLevel;i2>=0;i2--){ 699 698 for(i2=pobj_dti->iProcLevel;i2>=0;i2--) 699 { 700 auto const& t = compiler.GetObjectModule().meta.GetUserProcs(); 701 auto it = boost::find_if<boost::return_found>(t, [&](UserProc* p) { 702 return rva_to_real(p->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] && 703 pobj_dti->lplpObp[i2] < rva_to_real(p->GetEndOpAddress()); 704 }); 700 705 UserProc *pUserProc = NULL; 701 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 702 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 706 if (it != boost::end(t)) 703 707 { 704 pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext(); 705 706 if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] && 707 pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress())) 708 { 709 lstrcpy(temporary,pUserProc->GetName().c_str()); 710 break; 711 } 708 pUserProc = *it; 709 lstrcpy(temporary, pUserProc->GetName().c_str()); 712 710 } 713 711 if(!pUserProc){ … … 811 809 i2=pobj_dti->iProcLevel-i2; 812 810 813 if(pobj_dti->lplpSpBase[i2]){ 814 815 UserProc *pUserProc = NULL; 816 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 817 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 811 if(pobj_dti->lplpSpBase[i2]) 812 { 813 auto const& t = compiler.GetObjectModule().meta.GetUserProcs(); 814 auto it = boost::find_if<boost::return_found>(t, [&](UserProc* p) { 815 return rva_to_real(p->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] && 816 pobj_dti->lplpObp[i2] < rva_to_real(p->GetEndOpAddress()); 817 }); 818 819 if (it != boost::end(t)) 818 820 { 819 pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext(); 820 821 if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] && 822 pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress())){ 823 break; 824 } 825 } 826 827 if(pUserProc){ 828 compiler.StartProcedureCompile( pUserProc ); 821 compiler.StartProcedureCompile(*it); 829 822 } 830 823 } -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/hash.cpp
r598 r803 33 33 34 34 // ハッシュ値を取得 35 DllProc *pDllProc = compiler.GetObjectModule().meta.GetDllProcs().GetHashArrayElement( simpleName );36 while(pDllProc){35 foreach (auto pDllProc, compiler.GetObjectModule().meta.GetDllProcs().GetHashArrayElement(simpleName)) 36 { 37 37 if( pDllProc->IsEqualSymbol( LexicalAnalyzer::FullNameToSymbol( fullName ) ) ){ 38 38 return pDllProc; 39 39 } 40 41 pDllProc=pDllProc->GetChainNext();42 40 } 43 41 -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp
r750 r803 1348 1348 delete pobj_LoopRefCheck; 1349 1349 pobj_LoopRefCheck=0; 1350 1351 // イテレータの準備1352 classes.Iterator_Init();1353 1350 } 1354 1351 … … 1412 1409 1413 1410 compiler.GetObjectModule().meta.GetUserProcs().Put( pUserProc ); 1414 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Init();1415 1411 1416 1412 LexicalAnalyzer::AddMethod( -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Const.cpp
r637 r803 206 206 } 207 207 } 208 209 // イテレータを初期化210 compiler.GetObjectModule().meta.GetGlobalConsts().Iterator_Init();211 compiler.GetObjectModule().meta.GetGlobalConstMacros().Iterator_Init();212 208 } 213 209 -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp
r750 r803 127 127 Jenga::Common::SourceTemplate sourceTemplate( ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\templates\\delegate_class.tab" ); 128 128 129 delegates.Iterator_Reset(); 130 while( delegates.Iterator_HasNext() ) 131 { 132 const Delegate &dg = *delegates.Iterator_GetNext(); 129 foreach (auto pDelegate, delegates) 130 { 131 const Delegate &dg = *pDelegate; 133 132 134 133 if( dg.IsExternal() ) … … 263 262 void LexicalAnalyzer::RefleshDelegatesParameterAndReturnType( Delegates &delegates ) 264 263 { 265 delegates.Iterator_Reset(); 266 while( delegates.Iterator_HasNext() ) 267 { 268 Delegate &dg = *delegates.Iterator_GetNext(); 269 RefleshDelegateParameterAndReturnType( dg ); 270 } 271 } 264 foreach (auto *pDelegate, delegates) 265 { 266 RefleshDelegateParameterAndReturnType(*pDelegate); 267 } 268 } -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp
r750 r803 257 257 nativeCode.PutEx( masterObjectModule.globalNativeCode ); 258 258 259 masterObjectModule.meta.GetUserProcs().Iterator_Reset(); 260 while( masterObjectModule.meta.GetUserProcs().Iterator_HasNext() ) 261 { 262 const UserProc *pUserProc = masterObjectModule.meta.GetUserProcs().Iterator_GetNext(); 263 259 foreach (auto pUserProc, masterObjectModule.meta.GetUserProcs()) 260 { 264 261 if( pUserProc->GetNativeCode().GetSize() > 0 ) 265 262 { -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp
r750 r803 18 18 int back_cp=cp; 19 19 20 classes.Iterator_Reset();21 while(classes.Iterator_HasNext()){22 CClass &objClass = * classes.Iterator_GetNext();20 foreach(auto pClass, classes) 21 { 22 CClass &objClass = *pClass; 23 23 if( objClass.IsExternal() ) 24 24 { … … 83 83 //////////////////////////////////////////////////////////////////// 84 84 85 // イテレータをリセット 86 classes.Iterator_Reset(); 87 88 while( classes.Iterator_HasNext() ){ 89 const CClass &objClass = *classes.Iterator_GetNext(); 85 foreach (auto pClass, classes) 86 { 87 const CClass &objClass = *pClass; 90 88 91 89 if( !objClass.IsUsing() ){ … … 152 150 ChangeOpcode( temporary ); 153 151 154 // イテレータをリセット 155 classes.Iterator_Reset(); 156 157 while( classes.Iterator_HasNext() ){ 158 const CClass &objClass = *classes.Iterator_GetNext(); 152 foreach (auto pClass, classes) 153 { 154 const CClass &objClass = *pClass; 159 155 160 156 if( !objClass.IsUsing() ){ -
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/VtblGenerator.cpp
r750 r803 93 93 void VtblGenerator::GenerateVTablesForAllClasses( Classes &classes ) 94 94 { 95 classes.Iterator_Reset(); 96 while( classes.Iterator_HasNext() ) 95 foreach (auto pClass, classes) 97 96 { 98 CClass *pClass = classes.Iterator_GetNext();99 97 GenerateFullVTables( *pClass ); 100 98 … … 177 175 void VtblGenerator::ActionVtblScheduleForAllClasses( Classes &classes, LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection, LONG_PTR MemPos_DataSection ) 178 176 { 179 classes.Iterator_Reset(); 180 while( classes.Iterator_HasNext() ) 177 foreach(auto pClass, classes) 181 178 { 182 CClass *pClass = classes.Iterator_GetNext();183 179 ActionVtblSchedule( *pClass, ImageBase, MemPos_CodeSection, MemPos_DataSection ); 184 180
Note:
See TracChangeset
for help on using the changeset viewer.