Changeset 636 in dev for trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp
- Timestamp:
- Jun 10, 2008, 11:40:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Lexical/ObjectModule.cpp
r603 r636 58 58 void ObjectModule::StaticLink( ObjectModule &objectModule ) 59 59 { 60 const std::vector<int> relationTable = this->GetRelationTable( objectModule.relationalObjectModuleNames ); 61 60 62 long dataSectionBaseOffset = dataTable.GetSize(); 61 int sourceIndexBase = (int)sources.size();62 63 63 64 // メタ情報を結合 64 meta.StaticLink( objectModule.meta, dataSectionBaseOffset, sourceIndexBase );65 meta.StaticLink( objectModule.meta, dataSectionBaseOffset, relationTable ); 65 66 66 67 // グローバル ネイティブコードを結合 67 68 objectModule.globalNativeCode.ResetDataSectionBaseOffset( dataSectionBaseOffset ); 68 objectModule.globalNativeCode.ResetSourceIndexes( sourceIndexBase );69 objectModule.globalNativeCode.ResetSourceIndexes( relationTable ); 69 70 globalNativeCode.PutEx( objectModule.globalNativeCode ); 70 71 … … 73 74 dataTable.Add( objectModule.dataTable ); 74 75 75 // ソースコードを結合76 BOOST_FOREACH( const BasicSource &source, objectModule.sources )77 {78 this->sources.push_back( source );79 }80 81 76 // TODO: basbufがいらなくなったら消す 82 77 extern char *basbuf; 83 basbuf = this->sources[0].GetBuffer(); 78 basbuf = this->source.GetBuffer(); 79 } 80 81 const std::vector<int> ObjectModule::GetRelationTable( const Jenga::Common::Strings &oldRelationalObjectModuleNames ) 82 { 83 // 要素 = 古いインデックス、値 = 新しいインデックス 84 std::vector<int> relationTable; 85 86 // リレーションテーブルを構築 87 BOOST_FOREACH( const std::string &oldRelationalObjectModuleName, oldRelationalObjectModuleNames ) 88 { 89 bool isMatch = false; 90 for( int i=0; i<static_cast<int>(this->relationalObjectModuleNames.size()); i++ ) 91 { 92 if( oldRelationalObjectModuleName == this->relationalObjectModuleNames[i] ) 93 { 94 isMatch = true; 95 relationTable.push_back( i ); 96 break; 97 } 98 } 99 100 if( !isMatch ) 101 { 102 // エラー 103 _ASSERT( false ); 104 } 105 } 106 107 return relationTable; 84 108 } 85 109
Note:
See TracChangeset
for help on using the changeset viewer.