Changeset 253 in dev for trunk/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp
- Timestamp:
- Jul 30, 2007, 4:12:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp
r251 r253 65 65 66 66 isSuccessful = true; 67 break; 68 } 69 else 70 { 71 it++; 72 } 73 } 74 75 if( isSuccessful == false ) 76 { 77 SetError(); 78 } 79 } 80 81 void CodeGenerator::opfix_offset( const PertialSchedule *pPertialSchedule, long offset ) 82 { 83 bool isSuccessful = false; 84 85 PertialSchedules::iterator it = pertialSchedules.begin(); 86 while( it != pertialSchedules.end() ) 87 { 88 if( (*it) == pPertialSchedule ) 89 { 90 if( pPertialSchedule->GetTypeSize() == sizeof(long) ) 91 { 92 pNativeCode->Overwrite( 93 pPertialSchedule->GetCodePos(), 94 pNativeCode->GetLong(pPertialSchedule->GetCodePos()) + offset 95 ); 96 97 // TODO: 未完成(用が無くなったら消す) 98 pNativeCode->OverwriteOld( 99 pPertialSchedule->GetObpOld(), 100 pNativeCode->_GetLong_ObpOld(pPertialSchedule->GetObpOld()) + offset 101 ); 102 } 103 else 104 { 105 SetError(); 106 } 107 108 it = pertialSchedules.erase( it ); 109 delete pPertialSchedule; 110 111 isSuccessful = true; 112 break; 67 113 } 68 114 else … … 280 326 pNativeCode->Put( (long)0 ); 281 327 } 282 void CodeGenerator::op_jmp_goto_schedule( const GotoLabelSchedule &gotoLabelSchedule)328 void CodeGenerator::op_jmp_goto_schedule( const std::string &name, int lineNum, int sourceCodePos ) 283 329 { 284 330 // オペコード 285 331 pNativeCode->Put( (char)0xE9 ); 286 332 287 gotoLabelSchedules.push_back( gotoLabelSchedule ); 333 const GotoLabelSchedule *pGotoLabelSchedule = NULL; 334 if( name.size() == 0 ) 335 { 336 pGotoLabelSchedule = new GotoLabelSchedule( name, pNativeCode->GetSize(), sourceCodePos ); 337 } 338 else 339 { 340 pGotoLabelSchedule = new GotoLabelSchedule( name, pNativeCode->GetSize(), sourceCodePos ); 341 } 342 gotoLabelSchedules.push_back( pGotoLabelSchedule ); 343 344 pertialSchedules.push_back( pGotoLabelSchedule ); 288 345 289 346 pNativeCode->Put( (long)0 );
Note:
See TracChangeset
for help on using the changeset viewer.